diff options
author | John Wiegley <johnw@newartisans.com> | 2008-07-27 20:37:21 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-07-27 20:37:21 -0400 |
commit | e14d7b6e543850bae6c46f01a80b11c41ea383cf (patch) | |
tree | 7e6d191cadc7aff167fae2c8cadf3edce6a513d3 /valexpr.cc | |
parent | 0c76ac5b8f962525d20228f7fa3a7ec3d3d40ea7 (diff) | |
download | fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.tar.gz fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.tar.bz2 fork-ledger-e14d7b6e543850bae6c46f01a80b11c41ea383cf.zip |
Cleaned up the value expression code a bit before undertaking the real work of
getting everything back up to what it was (plus the new code written for 3.0).
Diffstat (limited to 'valexpr.cc')
-rw-r--r-- | valexpr.cc | 25 |
1 files changed, 8 insertions, 17 deletions
@@ -163,26 +163,17 @@ namespace { } } +value_t get_amount(scope_t& scope) +{ + assert("I can't get the amount!"); +} + ptr_op_t symbol_scope_t::lookup(const string& name) { switch (name[0]) { -#if 0 - case 'l': - if (name == "last") - return WRAP_FUNCTOR(bind(xpath_fn_last, _1)); - break; - - case 'p': - if (name == "position") - return WRAP_FUNCTOR(bind(xpath_fn_position, _1)); - break; - - case 't': - if (name == "text") - return WRAP_FUNCTOR(bind(xpath_fn_text, _1)); - else if (name == "type") - return WRAP_FUNCTOR(bind(xpath_fn_type, _1)); -#endif + case 'a': + if (name[1] == '\0' || name == "amount") + return WRAP_FUNCTOR(bind(get_amount, _1)); break; } |