summaryrefslogtreecommitdiff
path: root/src/precmd.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-04-26 16:39:25 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-04-26 16:39:25 -0500
commit64a9b42381c26baf24e58b40f50f0b253e551811 (patch)
tree5447a29dff64c3a8b7be8100a01bcb4a2d73b0bb /src/precmd.cc
parent7cc550fc22357e2ded194d3e65287c6b3317f5ae (diff)
parentb4407c10c0071365322b2963747bf42a57fd7304 (diff)
downloadfork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.gz
fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.bz2
fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.zip
Merge branch 'release/v3.0.0-20120426'
Diffstat (limited to 'src/precmd.cc')
-rw-r--r--src/precmd.cc28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/precmd.cc b/src/precmd.cc
index 663b638d..fe0836bc 100644
--- a/src/precmd.cc
+++ b/src/precmd.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2010, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2012, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -43,22 +43,6 @@
namespace ledger {
namespace {
- string join_args(call_scope_t& args)
- {
- std::ostringstream buf;
- bool first = true;
-
- for (std::size_t i = 0; i < args.size(); i++) {
- if (first)
- first = false;
- else
- buf << ' ';
- buf << args[i];
- }
-
- return buf.str();
- }
-
post_t * get_sample_xact(report_t& report)
{
{
@@ -83,8 +67,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();
}
}