forked from qt-creator/qt-creator
Fix that raw string literals that close on same line were not terminated
With the built-in model, which affects basic highlighting. Task-number: QTCREATORBUG-17720 Change-Id: I7369d7288d9c2c8e5ef36fc27549121014527e58 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
4
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
4
src/libs/3rdparty/cplusplus/Lexer.cpp
vendored
@@ -748,6 +748,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
|
||||
|
||||
int delimLength = -1;
|
||||
const char *closingDelimCandidate = 0;
|
||||
bool closed = false;
|
||||
while (_yychar) {
|
||||
if (_yychar == '(' && delimLength == -1) {
|
||||
delimLength = _currentChar - yytext;
|
||||
@@ -769,6 +770,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
|
||||
if (_yychar == '"') {
|
||||
if (delimLength == _currentChar - closingDelimCandidate) {
|
||||
// Got a matching closing delimiter.
|
||||
closed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -802,7 +804,7 @@ void Lexer::scanRawStringLiteral(Token *tok, unsigned char hint)
|
||||
else
|
||||
tok->f.kind = T_RAW_STRING_LITERAL;
|
||||
|
||||
if (!_yychar)
|
||||
if (!closed)
|
||||
s._tokenKind = tok->f.kind;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user