X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLexer.cpp;h=108d26ba2caacd77194429203808638eeb6e6bcf;hb=fb12b282f1300123c7f4c7f10525c29cb598e1fe;hp=5136c672073d6dc451360a22f6b088915c1a66f3;hpb=e7645f24391648fb08cf6b6d808fcabec76be744;p=lyx.git diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 5136c67207..108d26ba2c 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -173,7 +173,9 @@ void Lexer::Pimpl::printError(string const & message) const { string const tmpmsg = subst(message, "$$Token", getString()); lyxerr << "LyX: " << tmpmsg << " [around line " << lineno - << " of file " << to_utf8(makeDisplayPath(name)) << ']' << endl; + << " of file " << to_utf8(makeDisplayPath(name)) + << " current token: '" << getString() << "'" + << " context: '" << context << "']" << endl; } @@ -311,11 +313,6 @@ bool Lexer::Pimpl::next(bool esc /* = false */) is.get(cc); c = cc; - // skip ','s - if (esc && c == ',') - continue; - - if (c == commentChar) { // Read rest of line (fast :-) #if 1 @@ -380,13 +377,13 @@ bool Lexer::Pimpl::next(bool esc /* = false */) break; } - if (!esc && c == ',') + if (c == ',') continue; /* Skip ','s */ - // using relational operators with chars other - // than == and != is not safe. And if it is done - // the type _have_ to be unsigned. It usually a - // lot better to use the functions from cctype + // using relational operators with chars other + // than == and != is not safe. And if it is done + // the type _have_ to be unsigned. It usually a + // lot better to use the functions from cctype if (c > ' ' && is) { buff.clear(); @@ -404,7 +401,7 @@ bool Lexer::Pimpl::next(bool esc /* = false */) status = LEX_TOKEN; } - if (!esc && c == '\r' && is) { + if (c == '\r' && is) { // The Windows support has lead to the // possibility of "\r\n" at the end of // a line. This will stop LyX choking @@ -639,6 +636,7 @@ void Lexer::setCommentChar(char c) pimpl_->setCommentChar(c); } + int Lexer::lex() { return pimpl_->lex(); @@ -765,6 +763,7 @@ bool Lexer::getBool() const pimpl_->printError("Bad boolean `$$Token'. " "Use \"false\" or \"true\""); lastReadOk_ = false; + return false; }