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/format.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/format.cc')
-rw-r--r-- | src/format.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/format.cc b/src/format.cc index d949c350..b93a42a4 100644 --- a/src/format.cc +++ b/src/format.cc @@ -263,12 +263,15 @@ format_t::element_t * format_t::parse_elements(const string& fmt, args3_node->set_left(call1_node); args3_node->set_right(args2_node); + expr_t::ptr_op_t seq1_node(new expr_t::op_t(expr_t::op_t::O_SEQ)); + seq1_node->set_left(args3_node); + expr_t::ptr_op_t justify_node(new expr_t::op_t(expr_t::op_t::IDENT)); justify_node->set_ident("justify"); expr_t::ptr_op_t call2_node(new expr_t::op_t(expr_t::op_t::O_CALL)); call2_node->set_left(justify_node); - call2_node->set_right(args3_node); + call2_node->set_right(seq1_node); string prev_expr = boost::get<expr_t>(current->data).text(); @@ -280,9 +283,12 @@ format_t::element_t * format_t::parse_elements(const string& fmt, args4_node->set_left(call2_node); args4_node->set_right(colorize_op); + expr_t::ptr_op_t seq2_node(new expr_t::op_t(expr_t::op_t::O_SEQ)); + seq2_node->set_left(args4_node); + expr_t::ptr_op_t call3_node(new expr_t::op_t(expr_t::op_t::O_CALL)); call3_node->set_left(ansify_if_node); - call3_node->set_right(args4_node); + call3_node->set_right(seq2_node); current->data = expr_t(call3_node); } else { |