Commit c95a0e40 authored by Leandro Melo's avatar Leandro Melo Committed by hjk
Browse files

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 23c637c4

.

Change-Id: I36609038ce22dc6389e9da5b078f7bf7f6c031be
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 81754b78
......@@ -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();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment