Provide a "depth" variable for xacts
This commit is contained in:
parent
e8c90ef96f
commit
e32129b25c
1 changed files with 9 additions and 0 deletions
|
|
@ -204,6 +204,10 @@ namespace {
|
||||||
return string_value(xact.reported_account()->name);
|
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&)>
|
template <value_t (*Func)(xact_t&)>
|
||||||
value_t get_wrapper(call_scope_t& scope) {
|
value_t get_wrapper(call_scope_t& scope) {
|
||||||
return (*Func)(find_scope<xact_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>);
|
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'd':
|
||||||
|
if (name == "depth")
|
||||||
|
return WRAP_FUNCTOR(get_wrapper<&get_account_depth>);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
if (name == "entry")
|
if (name == "entry")
|
||||||
return WRAP_FUNCTOR(get_wrapper<&get_entry>);
|
return WRAP_FUNCTOR(get_wrapper<&get_entry>);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue