diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-10 01:28:42 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-10 01:28:57 -0500 |
commit | 3e39329eff14b02d9f72c506839ea9bf908116aa (patch) | |
tree | f124bdf6b35d198f349c73452f8e44734d6c4113 /src/textual.cc | |
parent | a5f0b6e5dc0aeb8cfbb264631732c224107793f8 (diff) | |
download | fork-ledger-3e39329eff14b02d9f72c506839ea9bf908116aa.tar.gz fork-ledger-3e39329eff14b02d9f72c506839ea9bf908116aa.tar.bz2 fork-ledger-3e39329eff14b02d9f72c506839ea9bf908116aa.zip |
Added "bucket" directive, as alt for A
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/textual.cc b/src/textual.cc index 1d8de046..c3a44be6 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -119,7 +119,7 @@ namespace { void period_xact_directive(char * line); void xact_directive(char * line, std::streamsize len); void include_directive(char * line); - void account_directive(char * line); + void master_account_directive(char * line); void end_directive(char * line); void alias_directive(char * line); void tag_directive(char * line); @@ -643,7 +643,7 @@ void instance_t::include_directive(char * line) count += instance.count; } -void instance_t::account_directive(char * line) +void instance_t::master_account_directive(char * line) { if (account_t * acct = account_stack.front()->find_account(line)) account_stack.push_front(acct); @@ -710,7 +710,7 @@ bool instance_t::general_directive(char * line) switch (*p) { case 'a': if (std::strcmp(p, "account") == 0) { - account_directive(next_element(line)); + master_account_directive(next_element(line)); return true; } else if (std::strcmp(p, "alias") == 0) { @@ -719,8 +719,15 @@ bool instance_t::general_directive(char * line) } break; + case 'b': + if (std::strcmp(p, "bucket") == 0) { + default_account_directive(next_element(line)); + return true; + } + break; + case 'd': - if (std::strcmp(p, "def") == 0) { + if (std::strcmp(p, "def") == 0 || std::strcmp(p, "define") == 0) { define_directive(next_element(line)); return true; } @@ -983,8 +990,8 @@ post_t * instance_t::parse_post(char * line, << "POST assign: parsed amt = " << *post->assigned_amount); amount_t& amt(*post->assigned_amount); - value_t account_total(post->account->amount(false) - .strip_annotations(keep_details_t())); + value_t account_total + (post->account->amount(false).strip_annotations(keep_details_t())); DEBUG("post.assign", "line " << linenum << ": " "account balance = " << account_total); |