diff options
author | 2016-07-09 00:13:18 +0200 | |
---|---|---|
committer | 2016-07-09 00:13:18 +0200 | |
commit | 011dbbe713a3faa07538c9c2130befdf7871e389 (patch) | |
tree | 4dd7150d527d6b6d6c2c7dd42e4b449953c305ec /src/lib/netlist/plib/pparser.cpp | |
parent | 3f58aa4548327df4a6223ed7bf84e614c2cb12e7 (diff) |
Moved two macros, added more RAII and improved exceptions. Fixed some
bugs in parser code. (nw)
Diffstat (limited to 'src/lib/netlist/plib/pparser.cpp')
-rw-r--r-- | src/lib/netlist/plib/pparser.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 468fb90a1f6..cfa30669801 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -41,9 +41,11 @@ pstring::code_t ptokenizer::getc() { if (m_px >= m_cur_line.len()) { + m_lineno++; if (m_strm.readline(m_cur_line)) { - m_cur_line += "\n"; + if (m_cur_line.right(1) != "\n") + m_cur_line += "\n"; m_px = 0; } else @@ -245,7 +247,7 @@ ptokenizer::token_t ptokenizer::get_token_internal() void ptokenizer::error(const pstring &errs) { - verror("Error: " + errs, currentline_no(), currentline_str()); + verror(errs, currentline_no(), currentline_str()); //throw error; } @@ -459,7 +461,6 @@ pstring ppreprocessor::process_line(const pstring &line) if (m_ifflag == 0) { ret.cat(lt); - ret.cat("\n"); } } return ret; |