diff options
author | John Wiegley <johnw@newartisans.com> | 2012-03-01 22:09:17 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-03-01 22:09:17 -0600 |
commit | 7a141edb49fc91aee09d09a0eab22aa475b6c37b (patch) | |
tree | 876883f0aef5aa7b46aac98fb3ad5243350e522d /src/textual.cc | |
parent | 4cfa4bca08932ff0cbe0f1ed97d989dbf55a449b (diff) | |
download | fork-ledger-7a141edb49fc91aee09d09a0eab22aa475b6c37b.tar.gz fork-ledger-7a141edb49fc91aee09d09a0eab22aa475b6c37b.tar.bz2 fork-ledger-7a141edb49fc91aee09d09a0eab22aa475b6c37b.zip |
Propagate out parsing context counts
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc index dc07efa0..2ec58898 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -741,9 +741,12 @@ void instance_t::include_directive(char * line) string base = (*iter).leaf(); #endif // BOOST_VERSION >= 103700 if (glob.match(base)) { - journal_t * journal = context.journal; - account_t * master = context.master; - scope_t * scope = context.scope; + journal_t * journal = context.journal; + account_t * master = context.master; + scope_t * scope = context.scope; + std::size_t& errors = context.errors; + std::size_t& count = context.count; + std::size_t& sequence = context.sequence; context_stack.push(*iter); @@ -757,9 +760,18 @@ void instance_t::include_directive(char * line) instance.parse(); } catch (...) { + errors += context_stack.get_current().errors; + count += context_stack.get_current().count; + sequence += context_stack.get_current().sequence; + context_stack.pop(); throw; } + + errors += context_stack.get_current().errors; + count += context_stack.get_current().count; + sequence += context_stack.get_current().sequence; + context_stack.pop(); files_found = true; |