Skip to content

Commit

Permalink
refactor(chapi-ast-c): modify singleLineMacroDeclaration
Browse files Browse the repository at this point in the history
Refactor singleLineMacroDeclaration in C.g4 to improve readability and maintainability. Removed unnecessary code and added optional parameters for better flexibility.
  • Loading branch information
phodal committed Jan 31, 2024
1 parent 7a07305 commit 16e7574
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chapi-ast-c/src/main/antlr/C.g4
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ macroStatement

singleLineMacroDeclaration
: include (StringLiteral | Identifier | ('<' includeIdentifier '>' )) #includeDeclaration
| macroKeywords Identifier? expression* '#' macroKeywords identifierList? #ifdefDeclaration
// #define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; }
| macroKeywords #defineDeclaration
| 'define' Identifier structOrUnionSpecifier #macroFunctionDeclaration
| macroKeywords Identifier? (structOrUnionSpecifier | expression)*
('#' macroKeywords)? identifierList? #ifdefDeclaration
// | macroKeywords #defineDeclaration
| '#'? Identifier #macroCastDeclaration
// | 'define' expression* '#' 'undef' identifierList? #macroExpansionDeclaration
// | macroKeywords expression* '#' macroKeywords identifierList? #macroExpansionDeclaration2
Expand Down

0 comments on commit 16e7574

Please sign in to comment.