summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-27 20:37:21 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-27 20:37:21 -0400
commite14d7b6e543850bae6c46f01a80b11c41ea383cf (patch)
tree7e6d191cadc7aff167fae2c8cadf3edce6a513d3 /valexpr.cc
parent0c76ac5b8f962525d20228f7fa3a7ec3d3d40ea7 (diff)
downloadfork-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.cc25
1 files changed, 8 insertions, 17 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 801f4e51..5826f420 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -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;
}