X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLexer.h;h=79efa5841b1a1edbb23a80fe256691f9100009c8;hb=7c6ae4d7401639ac0dd2eb83b0c1b7c61b0b8c13;hp=85b8b74600a840a0481c5b87fac89939aa23889e;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/Lexer.h b/src/Lexer.h index 85b8b74600..79efa5841b 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -18,7 +18,7 @@ #define LEXER_H #include "support/strfwd.h" - +#include namespace lyx { @@ -110,16 +110,20 @@ public: /// returns a lex code int lex(); - /** Just read the next word. If esc is true remember that - some chars might be escaped: "\ at least - */ + /// Read the next string, as delimited by double quotes or + /// whitespace. If esc is true, then we remember that some chars + /// might be escaped: \" at least. bool next(bool esc = false); - /** Read next token. This one is almost the same as next, - but it will consider " as a regular character and always - split a word if it contains a backslash. - */ + /// Read next token. This one is almost the same as next(), + /// but it will consider " as a regular character and always + /// split a word if it contains a backslash. bool nextToken(); + + /// Puts the rest of the line in the buffer, where it will + /// be available via getString() or getDocString(). + bool eatLine(); + /// Push a token, that next token got from lyxlex. void pushToken(std::string const &); @@ -134,10 +138,8 @@ public: double getFloat() const; /// std::string const getString() const; - /// docstring const getDocString() const; - /** Get a long string, ended by the tag `endtag'. This string can span several lines. The first line serves as a template for how many spaces the lines @@ -147,9 +149,6 @@ public: */ std::string const getLongString(std::string const & endtag); - /// - bool eatLine(); - /// Pushes a token list on a stack and replaces it with a new one. template void pushTable(LexerKeyword (&table)[N]) { pushTable(table, N); } @@ -193,6 +192,9 @@ public: /// Quotes a string so that reading it again with Lexer::next(true) /// gets the original string static std::string quoteString(std::string const &); + /// Quotes a docstring so that reading it again with Lexer::next(true) + /// gets the original string + static docstring quoteString(docstring const &); private: /// noncopyable