From 0a8b36de3f32f360ffdfc7c6d2e07b11345c7a1d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 16 Feb 2006 01:01:38 +0000 Subject: Made several changes to the parsing infrastructure to allow passing the "config_t" object around. This is needed for parsing option settings in the initialization file. --- textual.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index 7bfce642..0a317070 100644 --- a/textual.cc +++ b/textual.cc @@ -487,6 +487,7 @@ static void clock_out_from_timelog(const std::time_t when, } unsigned int textual_parser_t::parse(std::istream& in, + config_t& config, journal_t * journal, account_t * master, const std::string * original_file) @@ -607,6 +608,8 @@ unsigned int textual_parser_t::parse(std::istream& in, date_buffer[std::strlen(date_field)] = ' '; std::strcpy(&date_buffer[std::strlen(date_field) + 1], time_field); + std::cerr << "date_buffer = " << date_buffer << std::endl; + struct std::tm when; if (strptime(date_buffer, "%Y/%m/%d %H:%M:%S", &when)) { date = std::mktime(&when); @@ -653,7 +656,7 @@ unsigned int textual_parser_t::parse(std::istream& in, if (p) *p++ = '\0'; } - process_option(config_options, line + 2, p); + config.process_option(line + 2, p); break; } @@ -721,7 +724,8 @@ unsigned int textual_parser_t::parse(std::istream& in, DEBUG_PRINT("ledger.textual.include", "Including path '" << path << "'"); - count += parse_journal_file(path, journal, account_stack.front()); + count += parse_journal_file(path, config, journal, + account_stack.front()); } else if (word == "account") { account_t * acct; -- cgit v1.2.3