From 8228c5fb9ac372cbed3b21d83337b47c6e7d82d9 Mon Sep 17 00:00:00 2001 From: Petr Skocik Date: Thu, 10 Jan 2019 18:51:54 +0100 Subject: [PATCH] more complete support for $ in C/C++ identifiers --- parsers/cpreprocessor.c | 4 ++-- parsers/cxx/cxx_parser_tokenizer.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parsers/cpreprocessor.c b/parsers/cpreprocessor.c index 744aad280d..1bebb16763 100644 --- a/parsers/cpreprocessor.c +++ b/parsers/cpreprocessor.c @@ -1565,7 +1565,7 @@ static void saveMacro(const char * macro) return; } - if(!(isalpha(*c) || (*c == '_'))) + if(!(isalpha(*c) || (*c == '_' || (*c == '$') ))) { CXX_DEBUG_LEAVE_TEXT("Macro does not start with an alphanumeric character"); return; // must be a sequence of letters and digits @@ -1573,7 +1573,7 @@ static void saveMacro(const char * macro) const char * identifierBegin = c; - while(*c && (isalnum(*c) || (*c == '_'))) + while(*c && (isalnum(*c) || (*c == '_') || (*c == '$') )) c++; const char * identifierEnd = c; diff --git a/parsers/cxx/cxx_parser_tokenizer.c b/parsers/cxx/cxx_parser_tokenizer.c index d5991929f8..7cbc56d850 100644 --- a/parsers/cxx/cxx_parser_tokenizer.c +++ b/parsers/cxx/cxx_parser_tokenizer.c @@ -286,7 +286,7 @@ static CXXCharTypeData g_aCharTable[128] = }, // 036 (0x24) '$' { - 0, + CXXCharTypeStartOfIdentifier | CXXCharTypePartOfIdentifier, 0, 0 },