diff options
author | John Wiegley <johnw@newartisans.com> | 2011-02-10 23:00:36 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-02-10 23:00:36 -0500 |
commit | 20f4ccde96de05cdbd330e6bbb94af363bef486a (patch) | |
tree | 72b3492edc8d5c5ad52a6d36e02e5edf9bc08c68 /src/op.cc | |
parent | 21a123e525927b1785078f6630e2a52d410f11c8 (diff) | |
download | fork-ledger-20f4ccde96de05cdbd330e6bbb94af363bef486a.tar.gz fork-ledger-20f4ccde96de05cdbd330e6bbb94af363bef486a.tar.bz2 fork-ledger-20f4ccde96de05cdbd330e6bbb94af363bef486a.zip |
Added some debug code
Diffstat (limited to 'src/op.cc')
-rw-r--r-- | src/op.cc | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -150,6 +150,15 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) value_t result; +#if defined(DEBUG_ON) + if (! skip_debug && SHOW_DEBUG("expr.calc")) { + for (int i = 0; i < depth; i++) + ledger::_log_buffer << '.'; + ledger::_log_buffer << op_context(this) << " => ..."; + DEBUG("expr.calc", ""); + } +#endif + switch (kind) { case VALUE: result = as_value(); @@ -252,6 +261,21 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth) if (! func) throw_(calc_error, _("Calling unknown function '%1'") << name); +#if defined(DEBUG_ON) + if (! skip_debug && SHOW_DEBUG("expr.calc")) { + for (int i = 0; i < depth; i++) + ledger::_log_buffer << '.'; + ledger::_log_buffer << " args: "; + if (call_args.args.is_sequence()) { + foreach (value_t& arg, call_args) + ledger::_log_buffer << arg << " "; + } else { + ledger::_log_buffer << call_args.args[0] << " "; + } + DEBUG("expr.calc", ""); + } +#endif + if (func->is_function()) result = func->as_function()(call_args); else |