Skip to content

Commit

Permalink
Merge pull request #6 from cloudlinux/add-macro-invocation-parameter-…
Browse files Browse the repository at this point in the history
…list

add `macro_invocation_parameter_list`
  • Loading branch information
telepenin authored Sep 17, 2024
2 parents 3f92258 + 97c10aa commit 99d0b10
Show file tree
Hide file tree
Showing 4 changed files with 104,040 additions and 102,151 deletions.
16 changes: 15 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ module.exports = grammar({
[$.enum_specifier],
[$.type_specifier, $._old_style_parameter_list],
[$.parameter_list, $._old_style_parameter_list],
[$.parameter_list, $.macro_invocation_parameter_list],
[$.type_qualifier, $.macro_invocation_parameter_list],
[$.function_declarator, $._function_declaration_declarator],
[$._block_item, $.statement],
[$._top_level_item, $._top_level_statement],
Expand Down Expand Up @@ -791,7 +793,19 @@ module.exports = grammar({

macro_invocation: $ => seq(
field('declarator', $._declarator),
field('parameters', $.parameter_list),
field('parameters', $.macro_invocation_parameter_list),
),

macro_invocation_parameter_list: $ => seq(
'(',
commaSep(
choice(
$.parameter_declaration,
$.variadic_parameter,
seq(optional('__extension__'), $.expression),
)
),
')',
),

field_declaration: $ => seq(
Expand Down
116 changes: 115 additions & 1 deletion src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 99d0b10

Please sign in to comment.