diff options
author | John Wiegley <johnw@newartisans.com> | 2013-05-19 04:16:12 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2013-05-19 04:16:12 -0500 |
commit | 6b52a1684f6f828b1d0ba5f212523b0086c4eb31 (patch) | |
tree | bb2a9bbbbaf66409599efac6bd23d9465677952c /src/textual.cc | |
parent | 82345899f76ad35cb979bf8750740d6b9ac8382b (diff) | |
download | fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.tar.gz fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.tar.bz2 fork-ledger-6b52a1684f6f828b1d0ba5f212523b0086c4eb31.zip |
Fixed parsing of the "fixed" directive
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/textual.cc b/src/textual.cc index 932bde84..9e19ee37 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -848,7 +848,8 @@ void instance_t::apply_tag_directive(char * line) void instance_t::apply_rate_directive(char * line) { if (optional<std::pair<commodity_t *, price_point_t> > price_point = - commodity_pool_t::current_pool->parse_price_directive(trim_ws(line), true)) { + commodity_pool_t::current_pool->parse_price_directive + (trim_ws(line), true, true)) { apply_stack.push_front (application_t("fixed", fixed_rate_t(price_point->first, price_point->second.price))); @@ -1445,6 +1446,9 @@ post_t * instance_t::parse_post(char * line, PARSE_NO_REDUCE | PARSE_SINGLE | PARSE_NO_ASSIGN, defer_expr, &post->amount_expr); + DEBUG("textual.parse", "line " << context.linenum << ": " + << "post amount = " << post->amount); + if (! post->amount.is_null() && post->amount.has_commodity()) { context.journal->register_commodity(post->amount.commodity(), post.get()); @@ -1456,15 +1460,14 @@ post_t * instance_t::parse_post(char * line, annotation_t details(rate.second); details.add_flags(ANNOTATION_PRICE_FIXATED); post->amount.annotate(details); + DEBUG("textual.parse", "line " << context.linenum << ": " + << "applied rate = " << post->amount); break; } } } } - DEBUG("textual.parse", "line " << context.linenum << ": " - << "post amount = " << post->amount); - if (stream.eof()) { next = NULL; } else { |