diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-08 04:30:05 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-08 04:30:05 -0400 |
commit | 2d5ad7dee89ebe9c014270882e44d3a7a8a626fd (patch) | |
tree | 20a6d2c34d86dcc9f68201dc1028f9053834ba7b /src/report.cc | |
parent | f7f5ed3d0fe96854f048609433fc68a3fb6fcf34 (diff) | |
download | fork-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.cc | 5 |
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 |