diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-18 16:56:58 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-18 16:56:58 -0500 |
commit | 9a389650ea9b159b17a61b99c5bd3a017511337a (patch) | |
tree | c41c49ff32d8781e6f2718d1d20f351704bd56d4 | |
parent | 97122cf1f7ba03ecafd6aef72a20cfd46a8103ec (diff) | |
download | fork-ledger-9a389650ea9b159b17a61b99c5bd3a017511337a.tar.gz fork-ledger-9a389650ea9b159b17a61b99c5bd3a017511337a.tar.bz2 fork-ledger-9a389650ea9b159b17a61b99c5bd3a017511337a.zip |
Allow ! and - operators on sequence values
-rw-r--r-- | src/value.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/value.cc b/src/value.cc index 797c144c..f4df3329 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1193,6 +1193,13 @@ void value_t::in_place_negate() case BALANCE: as_balance_lval().in_place_negate(); return; + case SEQUENCE: { + value_t temp; + foreach (const value_t& value, as_sequence()) + temp.push_back(- value); + *this = temp; + return; + } default: break; } @@ -1222,6 +1229,13 @@ void value_t::in_place_not() case STRING: set_boolean(as_string().empty()); return; + case SEQUENCE: { + value_t temp; + foreach (const value_t& value, as_sequence()) + temp.push_back(! value); + *this = temp; + return; + } default: break; } |