]> git.lyx.org Git - lyx.git/blobdiff - src/tex2lyx/texparser.C
Add a Buffer::fully_loaded member function, returning true only when
[lyx.git] / src / tex2lyx / texparser.C
index 0e4f79df702459f1463b87b8c1c3ecf758e7b9de..e5612667d2ce3a2a8f1283c349ba545f6c5baf16 100644 (file)
@@ -1,3 +1,12 @@
+/**
+ * \file texparser.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
 using std::cerr;
 using std::endl;
 using std::fill;
-using std::ios;
 using std::istream;
 using std::istringstream;
 using std::ostream;
 using std::string;
-using std::vector;
 
 
 namespace {
@@ -38,30 +45,30 @@ void catInit()
        fill(theCatcode + 'a', theCatcode + 'z' + 1, catLetter);
        fill(theCatcode + 'A', theCatcode + 'Z' + 1, catLetter);
 
-       theCatcode['\\'] = catEscape;
-       theCatcode['{']  = catBegin;
-       theCatcode['}']  = catEnd;
-       theCatcode['$']  = catMath;
-       theCatcode['&']  = catAlign;
+       theCatcode[int('\\')] = catEscape;
+       theCatcode[int('{')]  = catBegin;
+       theCatcode[int('}')]  = catEnd;
+       theCatcode[int('$')]  = catMath;
+       theCatcode[int('&')]  = catAlign;
        theCatcode[10]   = catNewline;
-       theCatcode['#']  = catParameter;
-       theCatcode['^']  = catSuper;
-       theCatcode['_']  = catSub;
-       theCatcode['\7f'] = catIgnore;
-       theCatcode[' ']  = catSpace;
-       theCatcode['\t'] = catSpace;
+       theCatcode[int('#')]  = catParameter;
+       theCatcode[int('^')]  = catSuper;
+       theCatcode[int('_')]  = catSub;
+       theCatcode[0x7f] = catIgnore;
+       theCatcode[int(' ')]  = catSpace;
+       theCatcode[int('\t')] = catSpace;
        theCatcode[13]   = catIgnore;
-       theCatcode['~']  = catActive;
-       theCatcode['%']  = catComment;
+       theCatcode[int('~')]  = catActive;
+       theCatcode[int('%')]  = catComment;
 
        // This is wrong!
-       theCatcode['@']  = catLetter;
+       theCatcode[int('@')]  = catLetter;
 }
 
 }
 
 
-// 
+//
 // catcodes
 //
 
@@ -171,7 +178,7 @@ void Parser::skip_spaces()
        while (1) {
                if (next_token().cat() == catSpace || next_token().cat() == catNewline)
                        get_token();
-               else if (next_token().cat() == catComment) 
+               else if (next_token().cat() == catComment)
                        while (next_token().cat() != catNewline)
                                get_token();
                else
@@ -368,11 +375,11 @@ string Parser::verbatim_item()
 
 void Parser::setCatCode(char c, CatCode cat)
 {
-       theCatcode[c] = cat;    
+       theCatcode[(unsigned char)c] = cat;
 }
 
 
 CatCode Parser::getCatCode(char c) const
 {
-       return theCatcode[c];
+       return theCatcode[(unsigned char)c];
 }