Skip to content

Commit

Permalink
parse turbofish patterns (#254)
Browse files Browse the repository at this point in the history
* parse turbofishes in patterns

* chore: generate
  • Loading branch information
m4rch3n1ng authored Feb 27, 2025
1 parent 2eaf126 commit 509e251
Show file tree
Hide file tree
Showing 7 changed files with 101,960 additions and 101,062 deletions.
10 changes: 10 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ module.exports = grammar({
alias(choice(...primitiveTypes), $.identifier),
$.identifier,
$.scoped_identifier,
$.generic_pattern,
$.tuple_pattern,
$.tuple_struct_pattern,
$.struct_pattern,
Expand All @@ -1358,6 +1359,15 @@ module.exports = grammar({
'_',
),

generic_pattern: $ => seq(
choice(
$.identifier,
$.scoped_identifier,
),
'::',
field('type_arguments', $.type_arguments),
),

tuple_pattern: $ => seq(
'(',
sepBy(',', choice($._pattern, $.closure_expression)),
Expand Down
39 changes: 37 additions & 2 deletions src/grammar.json

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

34 changes: 34 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 509e251

Please sign in to comment.