]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Parser.cpp
Update tex2lyx test reference after 754cb3d1
[lyx.git] / src / tex2lyx / Parser.cpp
index 23a1bf1a013e104088b33d01ec7f1f64f6cbbe08..41ab92063c031a50b2a496d67dd75de963f039a6 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "Encoding.h"
 #include "Parser.h"
-#include "support/foreach.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
@@ -162,6 +161,7 @@ Parser::Parser(idocstream & is, std::string const & fixedenc)
 {
        if (fixed_enc_)
                is_.setEncoding(fixedenc);
+       catInit();
 }
 
 
@@ -173,6 +173,7 @@ Parser::Parser(string const & s)
          // An idocstringstream can not change the encoding
          fixed_enc_(true)
 {
+       catInit();
 }
 
 
@@ -319,11 +320,10 @@ Token const Parser::next_next_token()
                return dummy;
        // If tokenize_one() has not been called after the last get_token() we
        // need to tokenize two more tokens.
-       if (pos_ >= tokens_.size()) {
+       if (pos_ >= tokens_.size())
+               tokenize_one();
+       if (pos_ + 1 >= tokens_.size())
                tokenize_one();
-               if (pos_ + 1 >= tokens_.size())
-                       tokenize_one();
-       }
        return pos_ + 1 < tokens_.size() ? tokens_[pos_ + 1] : dummy;
 }
 
@@ -705,7 +705,7 @@ string Parser::verbatimOption()
                                putback();
                                res += '{' + verbatim_item() + '}';
                        } else
-                               res += t.cs();
+                               res += t.asInput();
                }
        }
        return res;