diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-09 16:21:19 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-09 16:21:19 -0600 |
commit | cbc7bd337bf523e9424c789a87be1d4a360740b2 (patch) | |
tree | 348355c7897db74256ff11d690d924c40544b68c /src/value.cc | |
parent | 3886428d1db0a103a050b7394c133abb793eba06 (diff) | |
download | fork-ledger-cbc7bd337bf523e9424c789a87be1d4a360740b2.tar.gz fork-ledger-cbc7bd337bf523e9424c789a87be1d4a360740b2.tar.bz2 fork-ledger-cbc7bd337bf523e9424c789a87be1d4a360740b2.zip |
Allow valuation of sequences
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/value.cc b/src/value.cc index 9f69016d..6e1ed79d 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1407,17 +1407,22 @@ value_t value_t::value(const optional<datetime_t>& moment, return NULL_VALUE; case AMOUNT: - if (optional<amount_t> val = - as_amount().value(moment, in_terms_of)) + if (optional<amount_t> val = as_amount().value(moment, in_terms_of)) return *val; return NULL_VALUE; case BALANCE: - if (optional<balance_t> bal = - as_balance().value(moment, in_terms_of)) + if (optional<balance_t> bal = as_balance().value(moment, in_terms_of)) return *bal; return NULL_VALUE; + case SEQUENCE: { + value_t temp; + foreach (const value_t& value, as_sequence()) + temp.push_back(value.value(moment, in_terms_of)); + return temp; + } + default: break; } |