]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/Parser.cpp
Remove 3rdparty/boost/Makefile.am
[lyx.git] / src / tex2lyx / Parser.cpp
index a538c760efe2ac8f83002cd2a581544bf5c8cfe4..67e0323c961463a2ca76f6e313ede1a1c9b1c51d 100644 (file)
@@ -10,8 +10,9 @@
 
 #include <config.h>
 
-#include "Encoding.h"
 #include "Parser.h"
+
+#include "Encoding.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
@@ -129,7 +130,7 @@ void iparserdocstream::putback(char_type c)
 }
 
 
-void iparserdocstream::putback(docstring s)
+void iparserdocstream::putback(docstring const & s)
 {
        s_ = s + s_;
 }
@@ -154,7 +155,7 @@ iparserdocstream & iparserdocstream::get(char_type &c)
 
 
 Parser::Parser(idocstream & is, std::string const & fixedenc)
-       : lineno_(0), pos_(0), iss_(0), is_(is),
+       : lineno_(0), pos_(0), iss_(nullptr), is_(is),
          encoding_iconv_(fixedenc.empty() ? "UTF-8" : fixedenc),
          theCatcodesType_(NORMAL_CATCODES), curr_cat_(UNDECIDED_CATCODES),
          fixed_enc_(!fixedenc.empty())
@@ -196,7 +197,7 @@ void Parser::deparse()
 }
 
 
-bool Parser::setEncoding(std::string const & e, int const & p)
+bool Parser::setEncoding(std::string const & e, int p)
 {
        // We may (and need to) use unsafe encodings here: Since the text is
        // converted to unicode while reading from is_, we never see text in
@@ -347,7 +348,7 @@ Token const Parser::get_token()
 
 bool Parser::isParagraph()
 {
-       // A new paragraph in TeX ist started
+       // A new paragraph in TeX is started
        // - either by a newline, following any amount of whitespace
        //   characters (including zero), and another newline
        // - or the token \par
@@ -443,7 +444,7 @@ void Parser::dropPosition()
 }
 
 
-bool Parser::good()
+bool Parser::good() const
 {
        if (pos_ < tokens_.size())
                return true;
@@ -453,7 +454,7 @@ bool Parser::good()
 }
 
 
-bool Parser::hasOpt(string const l)
+bool Parser::hasOpt(string const l)
 {
        // An optional argument can occur in any of the following forms:
        // - \foo[bar]
@@ -577,7 +578,7 @@ string Parser::getFullParentheseArg()
 }
 
 
-bool Parser::hasListPreamble(string const itemcmd)
+bool Parser::hasListPreamble(string const itemcmd)
 {
        // remember current position
        unsigned int oldpos = pos_;
@@ -876,7 +877,7 @@ void Parser::dump() const
 }
 
 
-void Parser::error(string const & msg)
+void Parser::error(string const & msg) const
 {
        cerr << "Line ~" << lineno_ << ":  parse error: " << msg << endl;
        dump();