forked from qt-creator/qt-creator
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 23c637c4f6
.
Change-Id: I36609038ce22dc6389e9da5b078f7bf7f6c031be
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
5
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
5
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user