diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-10 02:26:20 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-10 02:26:20 -0500 |
commit | bf24b93818989bc10afb10554b236c16c47298c1 (patch) | |
tree | 244b8022107bb849454b739438bf1af050b6f145 /src/query.cc | |
parent | f49b7b2166b47c381ba251ccab503b0cde259b3e (diff) | |
download | fork-ledger-bf24b93818989bc10afb10554b236c16c47298c1.tar.gz fork-ledger-bf24b93818989bc10afb10554b236c16c47298c1.tar.bz2 fork-ledger-bf24b93818989bc10afb10554b236c16c47298c1.zip |
Fixes to the value expression parser and evaluator
Diffstat (limited to 'src/query.cc')
-rw-r--r-- | src/query.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/query.cc b/src/query.cc index 98a3de1d..e48e65b5 100644 --- a/src/query.cc +++ b/src/query.cc @@ -307,15 +307,14 @@ query_t::parser_t::parse_query_term(query_t::lexer_t::token_t::kind_t tok_contex throw_(parse_error, _("Metadata equality operator not followed by term")); - expr_t::ptr_op_t cons = new expr_t::op_t(expr_t::op_t::O_CONS); - expr_t::ptr_op_t arg2 = new expr_t::op_t(expr_t::op_t::VALUE); assert(tok.value); arg2->set_value(mask_t(*tok.value)); - cons->set_left(arg1); - cons->set_right(arg2); - node->set_right(cons); + node->set_right(expr_t::op_t::new_node + (expr_t::op_t::O_SEQ, + expr_t::op_t::new_node + (expr_t::op_t::O_CONS, arg1, arg2))); } else { node->set_right(arg1); } |