From 4a87d875f04239595e9fe3904f0461ebbfdf227f Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Wed, 4 Nov 2009 13:45:49 +0100 Subject: 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(-) (limited to 'src/shared/cplusplus/Lexer.cpp') diff --git a/src/shared/cplusplus/Lexer.cpp b/src/shared/cplusplus/Lexer.cpp index a0cc9495d8..f8f1b6f133 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) -- cgit v1.2.1