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:
Leandro Melo
2012-06-08 16:52:16 +02:00
committed by hjk
parent 81754b7857
commit c95a0e40f3

View File

@@ -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();
}