Skip to content

Commit

Permalink
use capture both mut and immutable is_expressions, be more specific a…
Browse files Browse the repository at this point in the history
…bout expression kind
  • Loading branch information
ttytm committed Mar 31, 2024
1 parent 9bdaeb9 commit 5459a25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tree_sitter_v/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,11 +1190,12 @@ module.exports = grammar({
for_statement: ($) =>
seq(
'for',
optional(choice($.range_clause, $.for_clause, $.mut_is_clause, $._expression)),
optional(choice($.range_clause, $.for_clause, $.is_clause, $._expression)),
field('body', $.block),
),

mut_is_clause: ($) => prec.left(PREC.primary, seq('mut', $.is_expression)),
is_clause: ($) =>
prec(PREC.primary, seq(optional(alias('mut', $.mutability_modifiers)), $.is_expression)),

range_clause: ($) =>
prec.left(
Expand Down

0 comments on commit 5459a25

Please sign in to comment.