summaryrefslogtreecommitdiff
path: root/src/report.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-08 04:30:05 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-08 04:30:05 -0400
commit2d5ad7dee89ebe9c014270882e44d3a7a8a626fd (patch)
tree20a6d2c34d86dcc9f68201dc1028f9053834ba7b /src/report.cc
parentf7f5ed3d0fe96854f048609433fc68a3fb6fcf34 (diff)
downloadfork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.tar.gz
fork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.tar.bz2
fork-ledger-2d5ad7dee89ebe9c014270882e44d3a7a8a626fd.zip
Added support for value expression definitions.
Example: ] expr f(x) := x + 100 ] expr f(100) 200
Diffstat (limited to 'src/report.cc')
-rw-r--r--src/report.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/report.cc b/src/report.cc
index 209ad502..e510ac8d 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -504,6 +504,9 @@ option_t<report_t> * report_t::lookup_option(const char * p)
expr_t::ptr_op_t report_t::lookup(const string& name)
{
+ if (expr_t::ptr_op_t def = session.lookup(name))
+ return def;
+
const char * p = name.c_str();
switch (*p) {
case 'a':
@@ -639,7 +642,7 @@ expr_t::ptr_op_t report_t::lookup(const string& name)
if (option_t<report_t> * handler = lookup_option(p))
return MAKE_OPT_FUNCTOR(report_t, handler);
- return session.lookup(name);
+ return NULL;
}
} // namespace ledger