From 4a87d875f04239595e9fe3904f0461ebbfdf227f Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Wed, 4 Nov 2009 13:45:49 +0100 Subject: [PATCH] Accepts `$' as valid character when recognizing identifiers. Added support for yet another gcc extension that is using in OSX 10.6 system headers. --- src/shared/cplusplus/Lexer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shared/cplusplus/Lexer.cpp b/src/shared/cplusplus/Lexer.cpp index a0cc9495d83..f8f1b6f1339 100644 --- a/src/shared/cplusplus/Lexer.cpp +++ b/src/shared/cplusplus/Lexer.cpp @@ -603,7 +603,7 @@ void Lexer::scan_helper(Token *tok) do { yyinp(); - if (! (isalnum(_yychar) || _yychar == '_')) + if (! (isalnum(_yychar) || _yychar == '_' || _yychar == '$')) break; } while (_yychar); @@ -674,9 +674,9 @@ void Lexer::scan_helper(Token *tok) if (control()) tok->string = control()->findOrInsertStringLiteral(yytext, yylen); - } else if (std::isalpha(ch) || ch == '_') { + } else if (std::isalpha(ch) || ch == '_' || ch == '$') { const char *yytext = _currentChar - 1; - while (std::isalnum(_yychar) || _yychar == '_') + while (std::isalnum(_yychar) || _yychar == '_' || _yychar == '$') yyinp(); int yylen = _currentChar - yytext; if (f._scanKeywords) -- GitLab