diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-01 03:31:28 -0600 |
commit | 944e580825f0d9ce060b6dcdffe8990b6c2cca20 (patch) | |
tree | e2651b0df622d9b8d3831f35743e7dbd31c16897 /src/precmd.cc | |
parent | e2afc783db0dff1927b00dc506390353d9e3bbd2 (diff) | |
download | fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.gz fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.tar.bz2 fork-ledger-944e580825f0d9ce060b6dcdffe8990b6c2cca20.zip |
Refactored the notion of "the current parsing context"
Diffstat (limited to 'src/precmd.cc')
-rw-r--r-- | src/precmd.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/precmd.cc b/src/precmd.cc index 6f8becb6..6b106a8b 100644 --- a/src/precmd.cc +++ b/src/precmd.cc @@ -83,8 +83,14 @@ namespace { out << _("--- Context is first posting of the following transaction ---") << std::endl << str << std::endl; { - std::istringstream in(str); - report.session.journal->parse(in, report.session); + shared_ptr<std::istringstream> in(new std::istringstream(str)); + + parse_context_stack_t parsing_context; + parsing_context.push(in); + parsing_context.get_current().journal = report.session.journal.get(); + parsing_context.get_current().scope = &report.session; + + report.session.journal->read(parsing_context); report.session.journal->clear_xdata(); } } |