Skip to content

Commit

Permalink
more complete support for $ in C/C++ identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
pskocik committed Jan 10, 2019
1 parent b60a7b9 commit 8228c5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions parsers/cpreprocessor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,15 +1565,15 @@ 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
}

const char * identifierBegin = c;

while(*c && (isalnum(*c) || (*c == '_')))
while(*c && (isalnum(*c) || (*c == '_') || (*c == '$') ))
c++;

const char * identifierEnd = c;
Expand Down
2 changes: 1 addition & 1 deletion parsers/cxx/cxx_parser_tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static CXXCharTypeData g_aCharTable[128] =
},
// 036 (0x24) '$'
{
0,
CXXCharTypeStartOfIdentifier | CXXCharTypePartOfIdentifier,
0,
0
},
Expand Down

0 comments on commit 8228c5f

Please sign in to comment.