summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-14 03:11:48 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-14 03:11:48 -0500
commita461e17eee16ec51d2f074a0f46cb552edaa3ffd (patch)
tree6d9bbf95b19108ee0672812ec1373889c5646262 /src/account.cc
parent7a447912216e467a402e48be49f143f1b4be8261 (diff)
downloadfork-ledger-a461e17eee16ec51d2f074a0f46cb552edaa3ffd.tar.gz
fork-ledger-a461e17eee16ec51d2f074a0f46cb552edaa3ffd.tar.bz2
fork-ledger-a461e17eee16ec51d2f074a0f46cb552edaa3ffd.zip
Added historical support for single-letter valexprs
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/account.cc b/src/account.cc
index da43745a..e6c7af56 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -249,7 +249,7 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
switch (name[0]) {
case 'a':
- if (name == "amount")
+ if (name[1] == '\0' || name == "amount")
return WRAP_FUNCTOR(get_wrapper<&get_amount>);
else if (name == "account")
return WRAP_FUNCTOR(get_wrapper<&get_account>);
@@ -272,11 +272,20 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
case 'i':
if (name == "is_account")
return WRAP_FUNCTOR(get_wrapper<&get_true>);
+ else if (name == "is_index")
+ return WRAP_FUNCTOR(get_wrapper<&get_subcount>);
break;
case 'l':
if (name == "latest_cleared")
return WRAP_FUNCTOR(get_wrapper<&get_latest_cleared>);
+ else if (name[1] == '\0')
+ return WRAP_FUNCTOR(get_wrapper<&get_depth>);
+ break;
+
+ case 'n':
+ if (name[1] == '\0')
+ return WRAP_FUNCTOR(get_wrapper<&get_subcount>);
break;
case 'p':
@@ -300,6 +309,16 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
if (name == "use_direct_amount")
return WRAP_FUNCTOR(get_wrapper<&ignore>);
break;
+
+ case 'N':
+ if (name[1] == '\0')
+ return WRAP_FUNCTOR(get_wrapper<&get_count>);
+ break;
+
+ case 'O':
+ if (name[1] == '\0')
+ return WRAP_FUNCTOR(get_wrapper<&get_total>);
+ break;
}
return NULL;