diff options
Diffstat (limited to 'src/textual.cc')
-rw-r--r-- | src/textual.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc index ba720187..8fdd4db1 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -275,9 +275,9 @@ bool textual_parser_t::test(std::istream& in) const return true; } -void textual_parser_t::parse(std::istream& in, - const path& pathname, - builder_t& builder) +std::size_t textual_parser_t::parse(std::istream& in, + const path& pathname, + builder_t& builder) { TRACE_START(parsing_total, 1, "Total time spent parsing text:"); @@ -285,6 +285,8 @@ void textual_parser_t::parse(std::istream& in, builder.begin_node(JOURNAL_NODE); + std::size_t count = 0; + while (in.good() && ! in.eof()) { static char line[MAX_LINE + 1]; in.getline(line, MAX_LINE); @@ -460,6 +462,7 @@ void textual_parser_t::parse(std::istream& in, default: TRACE_START(entries, 1, "Time spent handling entries:"); parse_entry(in, builder, line, end_of_line); + count++; TRACE_STOP(entries, 1); break; } @@ -470,6 +473,8 @@ void textual_parser_t::parse(std::istream& in, builder.end_node(JOURNAL_NODE); TRACE_STOP(parsing_total, 1); + + return count; } } // namespace ledger |