summaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-21 18:07:27 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-21 18:07:27 +0100
commit521b935aa8ef68ac3a8a1fe1a37eed39b41eec95 (patch)
treeb7e482b7ea2d7725387046fdd6523e0f15f1dfa3 /src/item.cc
parent7287aad336161eb9a143f188c92d462e62051374 (diff)
downloadfork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.tar.gz
fork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.tar.bz2
fork-ledger-521b935aa8ef68ac3a8a1fe1a37eed39b41eec95.zip
Restored --percent option, added baseline test
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/item.cc b/src/item.cc
index e54fa6be..9e297052 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -247,6 +247,10 @@ namespace {
return 0L;
}
+ value_t ignore(item_t&) {
+ return false;
+ }
+
template <value_t (*Func)(item_t&)>
value_t get_wrapper(call_scope_t& scope) {
return (*Func)(find_scope<item_t>(scope));
@@ -330,6 +334,11 @@ expr_t::ptr_op_t item_t::lookup(const string& name)
return WRAP_FUNCTOR(ledger::has_tag);
break;
+ case 'i':
+ if (name == "is_account")
+ return WRAP_FUNCTOR(get_wrapper<&ignore>);
+ break;
+
case 'm':
if (name == "meta")
return WRAP_FUNCTOR(ledger::get_tag);
@@ -343,6 +352,8 @@ expr_t::ptr_op_t item_t::lookup(const string& name)
case 'p':
if (name == "pending")
return WRAP_FUNCTOR(get_wrapper<&get_pending>);
+ else if (name == "parent")
+ return WRAP_FUNCTOR(get_wrapper<&ignore>);
break;
case 's':