diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp index 5179d83b54741751bd4f1e56e61c9a70b44fd76a..5214a345f706e5a1a57ee30496346d38ddf6834a 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.cpp +++ b/src/libs/3rdparty/cplusplus/Lexer.cpp @@ -580,19 +580,15 @@ void Lexer::scan_helper(Token *tok) yyinp(); scanCharLiteral(tok, ch); } else if (ch == 'u' && _yychar == '8') { - unsigned char la = 0; - if (_currentChar + 1 != _lastChar) - la = *(_currentChar + 1); - if (la == '"') { - yyinp(); + yyinp(); + if (_yychar == '"') { yyinp(); scanStringLiteral(tok, '8'); - } else if (la == '\'') { - yyinp(); + } else if (_yychar == '\'') { yyinp(); scanCharLiteral(tok, '8'); } else { - scanIdentifier(tok); + scanIdentifier(tok, 1); } } else { scanIdentifier(tok); @@ -691,9 +687,9 @@ void Lexer::scanNumericLiteral(Token *tok) tok->number = control()->numericLiteral(yytext, yylen); } -void Lexer::scanIdentifier(Token *tok) +void Lexer::scanIdentifier(Token *tok, unsigned extraProcessedChars) { - const char *yytext = _currentChar - 1; + const char *yytext = _currentChar - 1 - extraProcessedChars; while (std::isalnum(_yychar) || _yychar == '_' || _yychar == '$') yyinp(); int yylen = _currentChar - yytext; diff --git a/src/libs/3rdparty/cplusplus/Lexer.h b/src/libs/3rdparty/cplusplus/Lexer.h index 8e4eab9797b668d42c5c6309c1c7ecbc71e791fd..c61b53c31f070d3a7eb246af1de1382d673af7df 100644 --- a/src/libs/3rdparty/cplusplus/Lexer.h +++ b/src/libs/3rdparty/cplusplus/Lexer.h @@ -94,7 +94,7 @@ private: void scanCharLiteral(Token *tok, unsigned char hint = 0); void scanUntilQuote(Token *tok, unsigned char quote); void scanNumericLiteral(Token *tok); - void scanIdentifier(Token *tok); + void scanIdentifier(Token *tok, unsigned extraProcessedChars = 0); inline void yyinp() {