From 683050d4f9a2e9476ccf2313f8f72eb99fcf4a87 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 22 Feb 2013 15:32:13 +0100 Subject: [PATCH] Some fixes to parsing in tex2lyx * put_almost_back and putback are actually the same thing * add Parser::dropPosition * deparse on Parser::popPosition --- src/tex2lyx/Parser.cpp | 14 +++++++++++--- src/tex2lyx/Parser.h | 6 ++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/tex2lyx/Parser.cpp b/src/tex2lyx/Parser.cpp index 11ecfe12ec..d87ff29546 100644 --- a/src/tex2lyx/Parser.cpp +++ b/src/tex2lyx/Parser.cpp @@ -131,11 +131,11 @@ bool iparserdocstream::setEncoding(std::string const & e) void iparserdocstream::putback(char_type c) { - s_ += c; + s_ = c + s_; } -void iparserdocstream::put_almost_back(docstring s) +void iparserdocstream::putback(docstring s) { s_ = s + s_; } @@ -146,6 +146,7 @@ iparserdocstream & iparserdocstream::get(char_type &c) if (s_.empty()) is_.get(c); else { + //cerr << "unparsed: " << to_utf8(s_) <