Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9dddd93
unified: add field declarations for statements and members
tausbn May 8, 2026
75c0799
unified: regenerate files
tausbn May 8, 2026
c75d819
unified: Add `effect` field
tausbn May 12, 2026
d6ef467
unified: Add more fields
tausbn May 12, 2026
853a988
unified: Regenerate files
tausbn May 12, 2026
732cc7b
unified: Add fields to inheritance specifiers and calls
tausbn May 12, 2026
0499932
unified: Fix fields in await_expression
tausbn May 12, 2026
15d84b3
unified: More $children fixes
tausbn May 12, 2026
bc96ae6
unified: Add `lambda` and `arguments` fields
tausbn May 12, 2026
5784ef2
unified: Unify more fields
tausbn May 12, 2026
e6eac37
unified: Consolidate fields in `if_let_binding`
tausbn May 12, 2026
9902bed
unified: add proper fields for availability_condition
tausbn May 12, 2026
6ff404a
unified: More miscellaneous field additions
tausbn May 12, 2026
5e14a75
unified: make compilation_condition named and add fields
tausbn May 12, 2026
e1a0e20
unified: Promote enum_type_parameter to named and add fields
tausbn May 12, 2026
eba9f35
unified: Get rid of $children* on key_path_expression
tausbn May 12, 2026
6e5e650
unified: Add fields for macro_declaration
tausbn May 12, 2026
406a02f
unified: Add fields to switch_entry
tausbn May 12, 2026
2010844
unified: Add fields to property_declaration
tausbn May 12, 2026
2eee2e5
unified: clean up patterns
tausbn May 12, 2026
eb480d1
unified: Make parenthesized_type named
tausbn May 12, 2026
52d7283
unified: Fix multiline_comment issue
tausbn May 12, 2026
bfe5aa8
unified: Regenerate files
tausbn May 12, 2026
5d6dc5c
unified: Clean up statements/block mess
tausbn May 13, 2026
ea6f3a9
unified: Encapsulate function parameters
tausbn May 13, 2026
c8f7c3d
unified: Group more paired items
tausbn May 13, 2026
9787a8b
unified: Group enum entries
tausbn May 13, 2026
caef72b
unified: Introduced named `property_binding` node
tausbn May 13, 2026
f4f85b5
unified: Remove some pointless fields
tausbn May 13, 2026
dd9c066
unified: Regenerate files
tausbn May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
unified: Add fields to property_declaration
Not entirely sure about the `binding?` field on `pattern`, but it looks
like that might actually be useful.
  • Loading branch information
tausbn committed May 12, 2026
commit 2010844b1eb531e44fcc9c474a4c498f03bf1a17
10 changes: 5 additions & 5 deletions unified/extractor/tree-sitter-swift/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1405,13 +1405,13 @@ module.exports = grammar({
prec.left(
seq(
field("name", alias($._no_expr_pattern_already_bound, $.pattern)),
optional($.type_annotation),
optional($.type_constraints),
field("type", optional($.type_annotation)),
field("type_constraints", optional($.type_constraints)),
optional(
choice(
$._expression_with_willset_didset,
$._expression_without_willset_didset,
$.willset_didset_block,
field("observers", $.willset_didset_block),
field("computed_value", $.computed_property)
)
)
Expand All @@ -1423,7 +1423,7 @@ module.exports = grammar({
seq(
$._equal_sign,
field("value", $.expression),
$.willset_didset_block
field("observers", $.willset_didset_block)
)
),
_expression_without_willset_didset: ($) =>
Expand Down Expand Up @@ -1909,7 +1909,7 @@ module.exports = grammar({
),
value_binding_pattern: ($) => field("mutability", choice("var", "let")),
_possibly_async_binding_pattern_kind: ($) =>
seq(optional($._async_modifier), $.value_binding_pattern),
seq(optional($._async_modifier), field("binding", $.value_binding_pattern)),
_binding_kind_and_pattern: ($) =>
seq(
$._possibly_async_binding_pattern_kind,
Expand Down
6 changes: 5 additions & 1 deletion unified/extractor/tree-sitter-swift/node-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ named:
modifier+: parameter_modifier
pattern:
$children*: [expression, pattern, type, user_type, value_binding_pattern, wildcard_pattern]
binding?: value_binding_pattern
bound_identifier?: simple_identifier
playground_literal:
name+: simple_identifier
Expand All @@ -494,10 +495,13 @@ named:
target: expression
property_behavior_modifier:
property_declaration:
$children*: [type_annotation, type_constraints, value_binding_pattern, willset_didset_block]
binding: value_binding_pattern
computed_value*: computed_property
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:
Expand Down