unified: Consolidate fields in if_let_binding

This commit is contained in:
Taus
2026-05-12 14:43:13 +00:00
parent 5784ef22f6
commit e6eac3784a
2 changed files with 5 additions and 5 deletions

View File

@@ -1907,10 +1907,10 @@ module.exports = grammar({
_direct_or_indirect_binding: ($) =>
seq(
choice(
$._binding_kind_and_pattern,
seq("case", $._binding_pattern_no_expr)
field("pattern", alias($._binding_kind_and_pattern, $.pattern)),
seq("case", field("pattern", alias($._binding_pattern_no_expr, $.pattern)))
),
optional($.type_annotation)
field("type", optional($.type_annotation))
),
value_binding_pattern: ($) => field("mutability", choice("var", "let")),
_possibly_async_binding_pattern_kind: ($) =>

View File

@@ -314,8 +314,8 @@ named:
if_condition:
kind: [availability_condition, expression, if_let_binding]
if_let_binding:
$children*: [pattern, simple_identifier, type, type_annotation, user_type, value_binding_pattern, wildcard_pattern]
bound_identifier?: simple_identifier
pattern: pattern
type?: type_annotation
value?: expression
where?: where_clause
if_statement: