summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xact.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 83e36078..883c320d 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -204,6 +204,10 @@ namespace {
return string_value(xact.reported_account()->name);
}
+ value_t get_account_depth(xact_t& xact) {
+ return long(xact.reported_account()->depth);
+ }
+
template <value_t (*Func)(xact_t&)>
value_t get_wrapper(call_scope_t& scope) {
return (*Func)(find_scope<xact_t>(scope));
@@ -235,6 +239,11 @@ expr_t::ptr_op_t xact_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
break;
+ case 'd':
+ if (name == "depth")
+ return WRAP_FUNCTOR(get_wrapper<&get_account_depth>);
+ break;
+
case 'e':
if (name == "entry")
return WRAP_FUNCTOR(get_wrapper<&get_entry>);