diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-05 04:24:15 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-05 04:24:15 -0500 |
commit | 15555d497f56e4b4d39e9a14f74b2c82cce52b90 (patch) | |
tree | 1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/textual.cc | |
parent | 94b2518c4156e5a6b2be45bdbeeacf1ced0cd17f (diff) | |
parent | 060fc0e00bacb96d1d16163779d98c45c3999014 (diff) | |
download | fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.gz fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.bz2 fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.zip |
Merge branch 'next'
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/textual.cc b/src/textual.cc index c2976ee1..6e2c919f 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -140,7 +140,8 @@ namespace { std::streamsize len, account_t * account); - virtual expr_t::ptr_op_t lookup(const string& name); + virtual expr_t::ptr_op_t lookup(const symbol_t::kind_t kind, + const string& name); }; void parse_amount_expr(scope_t& scope, @@ -749,11 +750,7 @@ void instance_t::general_directive(char * line) break; } - scoped_array<char> directive(new char[std::strlen(p) + DIR_PREFIX_LEN + 1]); - std::strcpy(directive.get(), DIR_PREFIX); - std::strcpy(directive.get() + DIR_PREFIX_LEN, p); - - if (expr_t::ptr_op_t op = lookup(directive.get())) { + if (expr_t::ptr_op_t op = lookup(symbol_t::DIRECTIVE, p)) { call_scope_t args(*this); args.push_back(string_value(p)); op->as_function()(args); @@ -1233,9 +1230,10 @@ xact_t * instance_t::parse_xact(char * line, } } -expr_t::ptr_op_t instance_t::lookup(const string& name) +expr_t::ptr_op_t instance_t::lookup(const symbol_t::kind_t kind, + const string& name) { - return scope.lookup(name); + return scope.lookup(kind, name); } std::size_t journal_t::parse(std::istream& in, |