]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlex.C
citation patch from Angus
[lyx.git] / src / lyxlex.C
index 6fe01651b427b9d89bf6fe14bbd205fbc9eab5ab..8fe4b94be4dbf6dd5459a35f1d32e643f6c3054d 100644 (file)
@@ -1,8 +1,15 @@
-//  Generalized simple lexical analizer.
-//  It can be used for simple syntax parsers, like lyxrc,
-//  texclass and others to come.   [asierra30/03/96]
-//
-//   Copyright 1996 Lyx Team.
+/* This file is part of
+ * ====================================================== 
+ * 
+ *           LyX, The Document Processor
+ *
+ *           Copyright 1996-2000 The LyX Team.
+ *
+ *   Generalized simple lexical analizer.
+ *   It can be used for simple syntax parsers, like lyxrc,
+ *   texclass and others to come.   [asierra30/03/96]
+ *
+ * ====================================================== */
 
 #include <config.h>
 
@@ -47,7 +54,8 @@ int LyXLex::GetLineNo() const
        return pimpl_->lineno;
 }
 
-char const * LyXLex::text() const
+
+char const * const LyXLex::text() const
 {
        return &pimpl_->buff[0];
 }
@@ -132,7 +140,7 @@ string const LyXLex::GetString() const
 // I would prefer to give a tag number instead of an explicit token
 // here, but it is not possible because Buffer::readLyXformat2 uses
 // explicit tokens (JMarc) 
-string LyXLex::getLongString(string const & endtoken)
+string const LyXLex::getLongString(string const & endtoken)
 {
        string str, prefix;
        bool firstline = true;
@@ -167,7 +175,7 @@ string LyXLex::getLongString(string const & endtoken)
                            && prefixIs(tmpstr, prefix.c_str())) {
                                tmpstr.erase(0, prefix.length() - 1);
                        }
-                       str += tmpstr + '\n';
+                       str += frontStrip(tmpstr, "\t") + '\n';
                 }
                else // token == endtoken
                        break;
@@ -207,6 +215,12 @@ bool LyXLex::nextToken()
 }
 
 
+void LyXLex::pushToken(string const & pt)
+{
+       pimpl_->pushToken(pt);
+}
+
+
 int LyXLex::FindToken(char const * str[])
 {  
    int i = -1;