aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/cplusplus/Lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Lexer.cpp')
-rw-r--r--src/libs/3rdparty/cplusplus/Lexer.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libs/3rdparty/cplusplus/Lexer.cpp b/src/libs/3rdparty/cplusplus/Lexer.cpp
index dc24f5e96c..e0fee4feac 100644
--- a/src/libs/3rdparty/cplusplus/Lexer.cpp
+++ b/src/libs/3rdparty/cplusplus/Lexer.cpp
@@ -939,7 +939,7 @@ bool Lexer::scanOptionalIntegerSuffix(bool allowU)
void Lexer::scanOptionalUserDefinedLiteral(Token *tok)
{
- if (_languageFeatures.cxx11Enabled && _yychar == '_') {
+ if (_languageFeatures.cxx11Enabled && (_yychar == '_' || std::isalpha(_yychar))) {
tok->f.userDefinedLiteral = true;
while (std::isalnum(_yychar) || _yychar == '_' || isByteOfMultiByteCodePoint(_yychar))
yyinp();
@@ -1052,10 +1052,17 @@ void Lexer::scanIdentifier(Token *tok, unsigned extraProcessedChars)
yyinp();
}
int yylen = _currentChar - yytext;
- if (f._scanKeywords)
+ if (f._scanKeywords) {
tok->f.kind = classify(yytext, yylen, _languageFeatures);
- else
+
+ if (tok->f.kind == T_FALSE || tok->f.kind == T_TRUE) {
+ if (control()) {
+ tok->number = control()->numericLiteral(yytext, yylen);
+ }
+ }
+ } else {
tok->f.kind = T_IDENTIFIER;
+ }
if (tok->f.kind == T_IDENTIFIER) {
tok->f.kind = classifyOperator(yytext, yylen);