unified: Prevent field bleed-through from _if_let_binding

Same procedure as before -- we change the anonymous node to a named
node, and the problem magically goes away.
This commit is contained in:
Taus
2026-05-08 21:10:58 +00:00
parent f9e7f90896
commit 2608db9fd9
2 changed files with 5 additions and 3 deletions

View File

@@ -1041,8 +1041,8 @@ module.exports = grammar({
)
),
if_condition: ($) =>
choice($._if_let_binding, $.expression, $.availability_condition),
_if_let_binding: ($) =>
choice($.if_let_binding, $.expression, $.availability_condition),
if_let_binding: ($) =>
seq(
$._direct_or_indirect_binding,
optional(seq($._equal_sign, $.expression)),

View File

@@ -235,7 +235,9 @@ named:
identifier:
$children+: simple_identifier
if_condition:
$children*: [availability_condition, expression, pattern, type, type_annotation, user_type, value_binding_pattern, where_clause, wildcard_pattern]
$children: [availability_condition, expression, if_let_binding]
if_let_binding:
$children*: [expression, pattern, type, type_annotation, user_type, value_binding_pattern, where_clause, wildcard_pattern]
bound_identifier?: simple_identifier
if_statement:
$children*: [else, if_statement, statements]