From 6423e44c115fea89eb567bb20f65a6370131b04b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 31 Jan 2009 01:21:46 -0400 Subject: Pre-commands (like "parse") now correctly recognized. --- src/report.cc | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/report.cc b/src/report.cc index 2c34fc5d..1f3ecf14 100644 --- a/src/report.cc +++ b/src/report.cc @@ -668,6 +668,32 @@ expr_t::ptr_op_t report_t::lookup(const string& name) break; } } + else if (std::strncmp(p, "ledger_precmd_", 14) == 0) { + p = p + 14; + switch (*p) { + case 'p': + if (std::strcmp(p, "parse") == 0) + return WRAP_FUNCTOR(parse_command); + else if (std::strcmp(p, "period") == 0) + return WRAP_FUNCTOR(period_command); + break; + + case 'c': + if (std::strcmp(p, "compile") == 0) + return WRAP_FUNCTOR(compile_command); + break; + + case 'e': + if (std::strcmp(p, "eval") == 0) + return WRAP_FUNCTOR(eval_command); + break; + + case 'f': + if (std::strcmp(p, "format") == 0) + return WRAP_FUNCTOR(format_command); + break; + } + } break; case 'm': @@ -919,33 +945,7 @@ expr_t::ptr_op_t report_t::lookup(const string& name) break; case 'p': - if (std::strncmp(p, "ledger_precmd_", 14) == 0) { - p = p + 14; - switch (*p) { - case 'p': - if (std::strcmp(p, "parse") == 0) - return WRAP_FUNCTOR(parse_command); - else if (std::strcmp(p, "period") == 0) - return WRAP_FUNCTOR(period_command); - break; - - case 'c': - if (std::strcmp(p, "compile") == 0) - return WRAP_FUNCTOR(compile_command); - break; - - case 'e': - if (std::strcmp(p, "eval") == 0) - return WRAP_FUNCTOR(eval_command); - break; - - case 'f': - if (std::strcmp(p, "format") == 0) - return WRAP_FUNCTOR(format_command); - break; - } - } - else if (std::strcmp(p, "print_balance") == 0) + if (std::strcmp(p, "print_balance") == 0) return WRAP_FUNCTOR(print_balance); break; -- cgit v1.2.3