diff --git a/unified/extractor/tree-sitter-swift/grammar.js b/unified/extractor/tree-sitter-swift/grammar.js index 8b6bf33b62e..f92ff68e5e5 100644 --- a/unified/extractor/tree-sitter-swift/grammar.js +++ b/unified/extractor/tree-sitter-swift/grammar.js @@ -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)), diff --git a/unified/extractor/tree-sitter-swift/node-types.yml b/unified/extractor/tree-sitter-swift/node-types.yml index 8f136ead220..b6271b38a8c 100644 --- a/unified/extractor/tree-sitter-swift/node-types.yml +++ b/unified/extractor/tree-sitter-swift/node-types.yml @@ -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