diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-25 03:30:23 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-25 03:30:23 -0400 |
commit | 66bc51db6d17d9fd01baed7ae85099094a00c091 (patch) | |
tree | 533d4389dcf13a90d701ea9043cd0e5d2bdccc36 /valexpr.cc | |
parent | 3a3227298dcd4faabd93e6f4bcaede10f29b13fd (diff) | |
download | fork-ledger-66bc51db6d17d9fd01baed7ae85099094a00c091.tar.gz fork-ledger-66bc51db6d17d9fd01baed7ae85099094a00c091.tar.bz2 fork-ledger-66bc51db6d17d9fd01baed7ae85099094a00c091.zip |
added pysample.dat, which provides a more realistic example of using Python
Diffstat (limited to 'valexpr.cc')
-rw-r--r-- | valexpr.cc | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -303,7 +303,8 @@ void value_expr_t::compute(value_t& result, const details_t& details) const } else if (PyObject * err = PyErr_Occurred()) { PyErr_Print(); - result = 0; + throw value_expr_error(std::string("While calling Python function '") + + constant_s + "'"); } else { result = 0; @@ -319,7 +320,8 @@ void value_expr_t::compute(value_t& result, const details_t& details) const } catch(const boost::python::error_already_set&) { PyErr_Print(); - result = 0; + throw value_expr_error(std::string("While calling Python function '") + + constant_s + "'"); } #endif break; @@ -572,13 +574,13 @@ value_expr_t * parse_value_term(std::istream& in) node->right = new value_expr_t(value_expr_t::O_ARG); value_expr_t * cur = node->right; cur->left = parse_value_expr(in, true); - while (peek_next_nonws(in) == ',') { - in.get(c); + in.get(c); + while (! in.eof() && c == ',') { cur->right = new value_expr_t(value_expr_t::O_ARG); cur = cur->right; cur->left = parse_value_expr(in, true); + in.get(c); } - in.get(c); if (c != ')') unexpected(c, ')'); } else { |