unified: Introduced named property_binding node

This groups together a bunch of related values that would otherwise be
impossible to match up correctly.
This commit is contained in:
Taus
2026-05-13 13:54:21 +00:00
parent 9787a8b072
commit caef72b047
2 changed files with 10 additions and 8 deletions

View File

@@ -1400,10 +1400,10 @@ module.exports = grammar({
prec.right(
seq(
$._possibly_async_binding_pattern_kind,
sep1($._single_modifierless_property_declaration, ",")
sep1(field("declarator", $.property_binding), ",")
)
),
_single_modifierless_property_declaration: ($) =>
property_binding: ($) =>
prec.left(
seq(
field("name", alias($._no_expr_pattern_already_bound, $.pattern)),

View File

@@ -507,15 +507,17 @@ named:
operation: ["&", "+", "++", "-", "--", ".", bang, custom_operator, "~"]
target: expression
property_behavior_modifier:
property_binding:
computed_value?: computed_property
name: pattern
observers?: willset_didset_block
type?: type_annotation
type_constraints?: type_constraints
value?: expression
property_declaration:
binding: value_binding_pattern
computed_value*: computed_property
declarator+: property_binding
modifiers*: [attribute, inheritance_modifier, modifiers, ownership_modifier, property_behavior_modifier]
name+: pattern
observers*: willset_didset_block
type*: type_annotation
type_constraints*: type_constraints
value*: expression
property_modifier:
protocol_body:
member*: protocol_member_declaration