diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-08 03:33:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-08 03:33:56 -0400 |
commit | 842359474e36d8406305b874e82c12594dbc154c (patch) | |
tree | 49f186fe2cdbc212430bf18dcde972a8b2c33198 /valexpr.cc | |
parent | 612e94ceaa1f063250b706530b9515ce77b32c59 (diff) | |
download | fork-ledger-842359474e36d8406305b874e82c12594dbc154c.tar.gz fork-ledger-842359474e36d8406305b874e82c12594dbc154c.tar.bz2 fork-ledger-842359474e36d8406305b874e82c12594dbc154c.zip |
optimize python iterations of entries, transactions; use exceptions more
Diffstat (limited to 'valexpr.cc')
-rw-r--r-- | valexpr.cc | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -642,11 +642,10 @@ value_expr_t * parse_logic_expr(std::istream& in) } default: - if (! in.eof()) { - std::ostringstream err; - err << "Unexpected character '" << c << "'"; - throw value_expr_error(err.str()); - } + if (! in.eof()) + throw value_expr_error(std::string("Unexpected character '") + + c + "'"); + break; } } } @@ -687,22 +686,19 @@ value_expr_t * parse_value_expr(std::istream& in) node->right = choices = new value_expr_t(value_expr_t::O_COL); choices->left = parse_logic_expr(in); c = peek_next_nonws(in); - if (c != ':') { - std::ostringstream err; - err << "Unexpected character '" << c << "'"; - throw value_expr_error(err.str()); - } + if (c != ':') + throw value_expr_error(std::string("Unexpected character '") + + c + "'"); in.get(c); choices->right = parse_logic_expr(in); break; } default: - if (! in.eof()) { - std::ostringstream err; - err << "Unexpected character '" << c << "'"; - throw value_expr_error(err.str()); - } + if (! in.eof()) + throw value_expr_error(std::string("Unexpected character '") + + c + "'"); + break; } c = peek_next_nonws(in); } |