Skip to content

Commit 8fbe908

Browse files
tausbnCopilot
andcommitted
unified: Regenerate the enhanced getter/setter property corpus case
Regenerate `types/property-with-getter-and-setter`, whose mapped AST now differs from the tree-sitter output: the backing `private var _v` retains its `private` modifier (`modifier "var"` + `modifier "private"`), whereas the tree-sitter path dropped it (its `visibility_modifier` node carried no text). The swift-syntax front-end preserves the modifier, so the mapped AST is strictly richer here. The raw (second) section is regenerated to the swift-syntax AST like the other cases; the mapped (third) section gains the retained `private` modifier. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b30fb20 commit 8fbe908

1 file changed

Lines changed: 94 additions & 65 deletions

File tree

‎unified/extractor/tests/corpus/swift/types/property-with-getter-and-setter.output‎

Lines changed: 94 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,70 +8,97 @@ class Box {
88

99
---
1010

11-
source_file
12-
statement:
13-
class_declaration
14-
body:
15-
class_body
16-
member:
17-
property_declaration
18-
binding:
19-
value_binding_pattern
20-
mutability: var
21-
declarator:
22-
property_binding
23-
name:
24-
pattern
25-
bound_identifier: simple_identifier "_v"
26-
value: integer_literal "0"
27-
modifiers:
28-
modifiers
29-
modifier:
30-
visibility_modifier
31-
property_declaration
32-
binding:
33-
value_binding_pattern
34-
mutability: var
35-
declarator:
36-
property_binding
37-
computed_value:
38-
computed_property
39-
accessor:
40-
computed_getter
41-
body:
42-
block
43-
statement:
44-
control_transfer_statement
45-
kind: return
46-
result: simple_identifier "_v"
47-
specifier:
48-
getter_specifier
49-
computed_setter
50-
body:
51-
block
52-
statement:
53-
assignment
54-
operator: =
55-
result: simple_identifier "newValue"
56-
target:
57-
directly_assignable_expression
58-
expr: simple_identifier "_v"
59-
specifier:
60-
setter_specifier
61-
name:
62-
pattern
63-
bound_identifier: simple_identifier "v"
64-
type:
65-
type_annotation
66-
type:
67-
type
68-
name:
69-
user_type
70-
part:
71-
simple_user_type
72-
name: type_identifier "Int"
73-
declaration_kind: class
74-
name: type_identifier "Box"
11+
sourceFile
12+
endOfFileToken: endOfFile
13+
statements:
14+
codeBlockItem
15+
item:
16+
classDecl
17+
attributes:
18+
name: identifier "Box"
19+
memberBlock:
20+
memberBlock
21+
leftBrace: {
22+
rightBrace: }
23+
members:
24+
memberBlockItem
25+
decl:
26+
variableDecl
27+
attributes:
28+
modifiers:
29+
declModifier
30+
name: private
31+
bindingSpecifier: var
32+
bindings:
33+
patternBinding
34+
initializer:
35+
initializerClause
36+
equal: =
37+
value:
38+
integerLiteralExpr
39+
literal: integerLiteral "0"
40+
pattern:
41+
identifierPattern
42+
identifier: identifier "_v"
43+
memberBlockItem
44+
decl:
45+
variableDecl
46+
attributes:
47+
modifiers:
48+
bindingSpecifier: var
49+
bindings:
50+
patternBinding
51+
pattern:
52+
identifierPattern
53+
identifier: identifier "v"
54+
typeAnnotation:
55+
typeAnnotation
56+
colon: :
57+
type:
58+
identifierType
59+
name: identifier "Int"
60+
accessorBlock:
61+
accessorBlock
62+
accessors:
63+
accessorDecl
64+
accessorSpecifier: get
65+
attributes:
66+
body:
67+
codeBlock
68+
leftBrace: {
69+
rightBrace: }
70+
statements:
71+
codeBlockItem
72+
item:
73+
returnStmt
74+
expression:
75+
declReferenceExpr
76+
baseName: identifier "_v"
77+
returnKeyword: return
78+
accessorDecl
79+
accessorSpecifier: set
80+
attributes:
81+
body:
82+
codeBlock
83+
leftBrace: {
84+
rightBrace: }
85+
statements:
86+
codeBlockItem
87+
item:
88+
infixOperatorExpr
89+
operator:
90+
assignmentExpr
91+
equal: =
92+
leftOperand:
93+
declReferenceExpr
94+
baseName: identifier "_v"
95+
rightOperand:
96+
declReferenceExpr
97+
baseName: identifier "newValue"
98+
leftBrace: {
99+
rightBrace: }
100+
modifiers:
101+
classKeyword: class
75102

76103
---
77104

@@ -84,7 +111,9 @@ top_level
84111
name: identifier "Box"
85112
member:
86113
variable_declaration
87-
modifier: modifier "var"
114+
modifier:
115+
modifier "var"
116+
modifier "private"
88117
pattern:
89118
name_pattern
90119
identifier: identifier "_v"

0 commit comments

Comments
 (0)