summaryrefslogtreecommitdiff
path: root/src/generate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/generate.cc')
-rw-r--r--src/generate.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/generate.cc b/src/generate.cc
index bf9a8036..edd58632 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -360,9 +360,15 @@ void generate_posts_iterator::increment()
DEBUG("generate.post", "The post we intend to parse:\n" << buf.str());
- std::istringstream in(buf.str());
try {
- if (session.journal->parse(in, session) != 0) {
+ shared_ptr<std::istringstream> in(new std::istringstream(buf.str()));
+
+ parse_context_stack_t parsing_context;
+ parsing_context.push(in);
+ parsing_context.get_current().journal = session.journal.get();
+ parsing_context.get_current().scope = &session;
+
+ if (session.journal->read(parsing_context) != 0) {
VERIFY(session.journal->xacts.back()->valid());
posts.reset(*session.journal->xacts.back());
post = *posts++;