summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-04 20:40:07 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-04 20:40:48 -0500
commit78e6770c4c276db3647952f21a6bf3ea465edb88 (patch)
tree64190d80ea0c3933dffaee3cf0e43cde5ea0e6a6 /src/xact.cc
parent4a14f3224b9063202ca39a67c9aff42ae4274942 (diff)
downloadfork-ledger-78e6770c4c276db3647952f21a6bf3ea465edb88.tar.gz
fork-ledger-78e6770c4c276db3647952f21a6bf3ea465edb88.tar.bz2
fork-ledger-78e6770c4c276db3647952f21a6bf3ea465edb88.zip
Segregated symbols into 5 separate namespaces
The different namespaces are: Function Value expression functions, which receive a "context" Option Command-line options Precommand Commands which are invoked before reading the journal Command Commands which are invoked after reading the journal Directive Directives that occur at column 0 in a data file This greatly eases the ability for Python uses to add intercept hooks to change how the basic Ledger module functions. An example of what should be possible soon: import ledger def my_foo_handler(value): print "--foo received:", value ledger.add_handler(ledger.Option, "foo=", my_foo_handler)
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 3291c5be..473837b6 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -422,8 +422,12 @@ namespace {
}
}
-expr_t::ptr_op_t xact_t::lookup(const string& name)
+expr_t::ptr_op_t xact_t::lookup(const symbol_t::kind_t kind,
+ const string& name)
{
+ if (kind != symbol_t::FUNCTION)
+ return item_t::lookup(kind, name);
+
switch (name[0]) {
case 'c':
if (name == "code")
@@ -448,7 +452,7 @@ expr_t::ptr_op_t xact_t::lookup(const string& name)
break;
}
- return item_t::lookup(name);
+ return item_t::lookup(kind, name);
}
bool xact_t::valid() const