Skip to content

Commit

Permalink
Simplify enum_arg rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuttner committed Jan 18, 2025
1 parent 4d21f28 commit 58dd318
Show file tree
Hide file tree
Showing 5 changed files with 92,306 additions and 92,775 deletions.
Binary file modified docs/playground/tree-sitter-c3.wasm
Binary file not shown.
6 changes: 1 addition & 5 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,7 @@ module.exports = grammar({

// Enum
// -------------------------
// Precedence over initializer list, but it's actually ambiguous and depends on the number of enum parameters
enum_arg: $ => prec(1, choice(
seq('=', $.arg),
seq('=', '{', commaSepTrailing1($.arg), '}'),
)),
enum_arg: $ => seq('=', $._expr),
enum_constant: $ => seq(
field('name', $.const_ident),
optional($.attributes),
Expand Down
105 changes: 27 additions & 78 deletions src/grammar.json

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

174 changes: 164 additions & 10 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 58dd318

Please sign in to comment.