summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-31 01:21:46 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-31 01:21:46 -0400
commit6423e44c115fea89eb567bb20f65a6370131b04b (patch)
tree5d003ae8d88d05eded90b7af66f6aee2dc3a1a8d
parent6983e6a38a6d06fd82667301940c976d56cb7ed1 (diff)
downloadfork-ledger-6423e44c115fea89eb567bb20f65a6370131b04b.tar.gz
fork-ledger-6423e44c115fea89eb567bb20f65a6370131b04b.tar.bz2
fork-ledger-6423e44c115fea89eb567bb20f65a6370131b04b.zip
Pre-commands (like "parse") now correctly recognized.
-rw-r--r--src/report.cc54
1 files 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;