summaryrefslogtreecommitdiff
path: root/src/expr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-10 12:22:19 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-10 12:22:19 -0500
commit5ffa987daf4d97c52066e4c28733d826d3726297 (patch)
treeab058dec32702ccce9d1f7cacacb5b5c157d6798 /src/expr.cc
parent9e07e61fadf7f3c9d1fd32a3805f6e97163eba15 (diff)
parent3f638d355c977fd5513ab1db380c5813599f3664 (diff)
downloadfork-ledger-5ffa987daf4d97c52066e4c28733d826d3726297.tar.gz
fork-ledger-5ffa987daf4d97c52066e4c28733d826d3726297.tar.bz2
fork-ledger-5ffa987daf4d97c52066e4c28733d826d3726297.zip
Merge branch 'next'
Diffstat (limited to 'src/expr.cc')
-rw-r--r--src/expr.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/expr.cc b/src/expr.cc
index aa9a7b0e..c59f8a57 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -64,6 +64,29 @@ value_t expr_t::real_calc(scope_t& scope)
if (locus) {
add_error_context(_("While evaluating value expression:"));
add_error_context(op_context(ptr, locus));
+
+ if (SHOW_INFO()) {
+ add_error_context(_("The value expression tree was:"));
+ std::ostringstream buf;
+ ptr->dump(buf, 0);
+
+ std::istringstream in(buf.str());
+ std::ostringstream out;
+ char linebuf[1024];
+ bool first = true;
+ while (in.good() && ! in.eof()) {
+ in.getline(linebuf, 1023);
+ std::streamsize len = in.gcount();
+ if (len > 0) {
+ if (first)
+ first = false;
+ else
+ out << '\n';
+ out << " " << linebuf;
+ }
+ }
+ add_error_context(out.str());
+ }
}
throw;
}