Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more complete support for $ in C/C++ identifiers #1971

Merged
merged 1 commit into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 == '$') )))
pskocik marked this conversation as resolved.
Show resolved Hide resolved
{
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