From c95a0e40f33ce8863cb4c3a6d4f5c4038b3d7a04 Mon Sep 17 00:00:00 2001 From: Leandro Melo Date: Fri, 8 Jun 2012 16:52:16 +0200 Subject: [PATCH] C++: Break on newline when lexing char/string literals Actually this behavior was already in the Lexer for regular string literals (although erroneously not for wide ones) and was lost in the recent commit 23c637c4f677ab2f19793f409297b0131b21dcaa. Change-Id: I36609038ce22dc6389e9da5b078f7bf7f6c031be Reviewed-by: hjk --- src/libs/3rdparty/cplusplus/Lexer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index 04f9a821632..3b52059a36a 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -649,12 +649,13 @@ void Lexer::scanUntilQuote(Token *tok, unsigned char quote) assert(quote == '"' || quote == '\''); const char *yytext = _currentChar; - while (_yychar && _yychar != quote) { + while (_yychar + && _yychar != quote + && _yychar != '\n') { if (_yychar != '\\') yyinp(); else { yyinp(); // skip `\\' - if (_yychar) yyinp(); }