Skip to content

Commit

Permalink
Add support for declarations of variables of "function pointer" type
Browse files Browse the repository at this point in the history
  • Loading branch information
chrhansk committed Nov 10, 2024
1 parent ce931be commit 54a59f9
Show file tree
Hide file tree
Showing 5 changed files with 132,389 additions and 132,079 deletions.
5 changes: 4 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ module.exports = grammar(Python, {
optional("complex"),
repeat($.type_qualifier),
)),
field("name", optional(choice($.identifier, $.operator_name))),
field("name", optional(choice($.identifier, $.operator_name, $.c_function_pointer_name))),
repeat($.type_qualifier),
),
seq(
Expand All @@ -406,6 +406,9 @@ module.exports = grammar(Python, {
),
),

c_function_pointer_name: $ =>
seq("(", "*", field("name", $.identifier), ")"),

// type_qualifier: '*' | '**' | '&' | type_index ('.' NAME [type_index])*
type_qualifier: $ =>
choice(
Expand Down
29 changes: 29 additions & 0 deletions src/grammar.json

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

20 changes: 20 additions & 0 deletions 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 54a59f9

Please sign in to comment.