summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-27 18:37:55 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-27 18:37:55 -0400
commitc93175183e790cf7f1100dfd554197161a69e6fe (patch)
treeab83255a7c883047a6e3a36bbb2097cc13c8f216 /valexpr.cc
parente5a8bbf997f14ea2edf52d6dfe733969cc67589b (diff)
downloadfork-ledger-c93175183e790cf7f1100dfd554197161a69e6fe.tar.gz
fork-ledger-c93175183e790cf7f1100dfd554197161a69e6fe.tar.bz2
fork-ledger-c93175183e790cf7f1100dfd554197161a69e6fe.zip
Added the concept of "balance setting transactions".
Diffstat (limited to 'valexpr.cc')
-rw-r--r--valexpr.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 4fed821e..0a2f27ee 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -833,7 +833,8 @@ value_expr_t * parse_value_term(std::istream& in, scope_t * scope,
bool definition = false;
if (c == '=') {
in.get(c);
- if (peek_next_nonws(in) == '=') {
+ if ((flags & PARSE_VALEXPR_NO_ASSIGN) ||
+ peek_next_nonws(in) == '=') {
in.unget();
c = '\0';
} else {
@@ -1160,10 +1161,16 @@ value_expr_t * parse_logic_expr(std::istream& in, scope_t * scope,
case '!':
case '=': {
bool negate = c == '!';
- if ((c = peek_next_nonws(in)) == '=')
+ if (! negate && (flags & PARSE_VALEXPR_NO_ASSIGN)) {
+ in.unget();
+ break;
+ }
+ else if ((c = peek_next_nonws(in)) == '=') {
in.get(c);
- else
+ }
+ else {
unexpected(c, '=');
+ }
value_expr prev(node.release());
node.reset(new value_expr_t(negate ? value_expr_t::O_NEQ :
value_expr_t::O_EQ));