Skip to content

Commit 7fa6c4e

Browse files
committed
Unified: Update test output after rebasing on grammar changes
The branch was rebased on the grammar changes, but rewriting the history was too difficult, so I'm just updating the test output here.
1 parent 600a496 commit 7fa6c4e

8 files changed

Lines changed: 253 additions & 223 deletions

File tree

unified/extractor/tests/corpus/swift/closures.txt

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ source_file
1515
lambda_literal
1616
type:
1717
lambda_function_type
18-
name:
19-
user_type
20-
type_identifier "Int"
21-
lambda_function_type_parameters
22-
lambda_parameter
18+
return_type:
19+
type
2320
name:
24-
simple_identifier "x"
2521
user_type
2622
type_identifier "Int"
23+
lambda_function_type_parameters
24+
lambda_parameter
25+
name: simple_identifier "x"
26+
type:
27+
type
28+
name:
29+
user_type
30+
type_identifier "Int"
2731
statements
2832
multiplicative_expression
2933
lhs: simple_identifier "x"
@@ -168,8 +172,8 @@ source_file
168172
navigation_suffix
169173
suffix: simple_identifier "doThing"
170174
target:
171-
self_expression
172-
?
175+
optional_chain_marker
176+
self_expression
173177
call_suffix
174178
value_arguments
175179
value_binding_pattern
@@ -189,7 +193,7 @@ top_level
189193
argument:
190194
function:
191195
member_access_expr
192-
target: unsupported_node "self"
196+
target: unsupported_node "self?"
193197
member: identifier "doThing"
194198
pattern:
195199
var_pattern
@@ -215,15 +219,19 @@ source_file
215219
lambda_literal
216220
type:
217221
lambda_function_type
218-
name:
219-
user_type
220-
type_identifier "Int"
221-
lambda_function_type_parameters
222-
lambda_parameter
222+
return_type:
223+
type
223224
name:
224-
simple_identifier "x"
225225
user_type
226226
type_identifier "Int"
227+
lambda_function_type_parameters
228+
lambda_parameter
229+
name: simple_identifier "x"
230+
type:
231+
type
232+
name:
233+
user_type
234+
type_identifier "Int"
227235
statements
228236
property_declaration
229237
name:

unified/extractor/tests/corpus/swift/collections.txt

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ source_file
5050
value_binding_pattern
5151
mutability: let
5252
type_annotation
53-
name:
54-
array_type
53+
type:
54+
type
5555
name:
56-
user_type
57-
type_identifier "Int"
56+
array_type
57+
element:
58+
type
59+
name:
60+
user_type
61+
type_identifier "Int"
5862

5963
---
6064

@@ -128,13 +132,16 @@ source_file
128132
value_binding_pattern
129133
mutability: let
130134
type_annotation
131-
name:
132-
user_type
133-
type_identifier "Set"
134-
type_arguments
135-
name:
136-
user_type
137-
type_identifier "Int"
135+
type:
136+
type
137+
name:
138+
user_type
139+
type_identifier "Set"
140+
type_arguments
141+
type
142+
name:
143+
user_type
144+
type_identifier "Int"
138145

139146
---
140147

unified/extractor/tests/corpus/swift/control-flow.txt

Lines changed: 39 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ if x > 0 {
1111
source_file
1212
if_statement
1313
condition:
14-
comparison_expression
15-
lhs: simple_identifier "x"
16-
op: >
17-
rhs: integer_literal "0"
14+
if_condition
15+
comparison_expression
16+
lhs: simple_identifier "x"
17+
op: >
18+
rhs: integer_literal "0"
1819
statements
1920
call_expression
2021
simple_identifier "print"
@@ -30,13 +31,7 @@ top_level
3031
if_stmt
3132
condition:
3233
expr_condition
33-
expr:
34-
binary_expr
35-
operator: operator ">"
36-
left:
37-
name_expr
38-
identifier: identifier "x"
39-
right: int_literal "0"
34+
expr: unsupported_node "x > 0"
4035
then:
4136
block_stmt
4237
body:
@@ -65,10 +60,11 @@ if x > 0 {
6560
source_file
6661
if_statement
6762
condition:
68-
comparison_expression
69-
lhs: simple_identifier "x"
70-
op: >
71-
rhs: integer_literal "0"
63+
if_condition
64+
comparison_expression
65+
lhs: simple_identifier "x"
66+
op: >
67+
rhs: integer_literal "0"
7268
statements
7369
call_expression
7470
simple_identifier "print"
@@ -95,13 +91,7 @@ top_level
9591
if_stmt
9692
condition:
9793
expr_condition
98-
expr:
99-
binary_expr
100-
operator: operator ">"
101-
left:
102-
name_expr
103-
identifier: identifier "x"
104-
right: int_literal "0"
94+
expr: unsupported_node "x > 0"
10595
else:
10696
block_stmt
10797
body:
@@ -147,10 +137,11 @@ if x > 0 {
147137
source_file
148138
if_statement
149139
condition:
150-
comparison_expression
151-
lhs: simple_identifier "x"
152-
op: >
153-
rhs: integer_literal "0"
140+
if_condition
141+
comparison_expression
142+
lhs: simple_identifier "x"
143+
op: >
144+
rhs: integer_literal "0"
154145
statements
155146
call_expression
156147
simple_identifier "print"
@@ -161,10 +152,11 @@ source_file
161152
else "else"
162153
if_statement
163154
condition:
164-
comparison_expression
165-
lhs: simple_identifier "x"
166-
op: <
167-
rhs: integer_literal "0"
155+
if_condition
156+
comparison_expression
157+
lhs: simple_identifier "x"
158+
op: <
159+
rhs: integer_literal "0"
168160
statements
169161
call_expression
170162
simple_identifier "print"
@@ -188,24 +180,12 @@ top_level
188180
if_stmt
189181
condition:
190182
expr_condition
191-
expr:
192-
binary_expr
193-
operator: operator ">"
194-
left:
195-
name_expr
196-
identifier: identifier "x"
197-
right: int_literal "0"
183+
expr: unsupported_node "x > 0"
198184
else:
199185
if_stmt
200186
condition:
201187
expr_condition
202-
expr:
203-
binary_expr
204-
operator: operator "<"
205-
left:
206-
name_expr
207-
identifier: identifier "x"
208-
right: int_literal "0"
188+
expr: unsupported_node "x < 0"
209189
else:
210190
block_stmt
211191
body:
@@ -249,12 +229,13 @@ if let value = optional {
249229

250230
source_file
251231
if_statement
252-
bound_identifier: simple_identifier "value"
253232
condition:
254-
value_binding_pattern
255-
mutability: let
256-
=
257-
simple_identifier "optional"
233+
if_condition
234+
if_let_binding
235+
bound_identifier: simple_identifier "value"
236+
value_binding_pattern
237+
mutability: let
238+
simple_identifier "optional"
258239
statements
259240
call_expression
260241
simple_identifier "print"
@@ -269,13 +250,8 @@ top_level
269250
body:
270251
if_stmt
271252
condition:
272-
let_pattern_condition
273-
value:
274-
name_expr
275-
identifier: identifier "optional"
276-
pattern:
277-
var_pattern
278-
identifier: identifier "value"
253+
expr_condition
254+
expr: unsupported_node "let value = optional"
279255
then:
280256
block_stmt
281257
body:
@@ -299,32 +275,21 @@ guard let value = optional else { return }
299275

300276
source_file
301277
guard_statement
302-
bound_identifier: simple_identifier "value"
303278
condition:
304-
value_binding_pattern
305-
mutability: let
306-
=
307-
simple_identifier "optional"
279+
if_condition
280+
if_let_binding
281+
bound_identifier: simple_identifier "value"
282+
value_binding_pattern
283+
mutability: let
284+
simple_identifier "optional"
308285
else "else"
309286
statements
310287
control_transfer_statement
311288

312289
---
313290

314291
top_level
315-
body:
316-
guard_if_stmt
317-
condition:
318-
let_pattern_condition
319-
value:
320-
name_expr
321-
identifier: identifier "optional"
322-
pattern:
323-
var_pattern
324-
identifier: identifier "value"
325-
else:
326-
block_stmt
327-
body: unsupported_node "return"
292+
body: unsupported_node "guard let value = optional else { return }"
328293

329294
===
330295
Ternary expression

0 commit comments

Comments
 (0)