Skip to content

Commit 1714793

Browse files
committed
Unified: Include source skeletons in corpus output
Regenerates all of the existing corpus output files to include source skeletons. Note that this already reveals some issues with our current locations: - arguments with trailing commas have a location that includes said comma, - switch_case nodes contain a `block` that encompasses the `case` statement itself. These will be fixed in due course.
1 parent 192e153 commit 1714793

139 files changed

Lines changed: 1947 additions & 1943 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎unified/extractor/tests/corpus/swift/closures/closure-with-capture-list.output‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ sourceFile
6060

6161
---
6262

63-
top_level
63+
top_level source="⟨body⟩"
6464
body:
65-
block
65+
block source="⟨stmt⟩"
6666
stmt:
67-
variable_declaration
68-
modifier: modifier "let"
69-
pattern: identifier "f"
67+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
68+
modifier: modifier "let" source="let"
69+
pattern: identifier "f" source="f"
7070
value:
71-
function_expr
71+
function_expr source="⟨body⟩⟨capture_declaration⟩"
7272
capture_declaration:
73-
variable_declaration
74-
modifier: modifier "weak"
75-
pattern: identifier "self"
73+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩"
74+
modifier: modifier "weak" source="weak"
75+
pattern: identifier "self" source="self"
7676
body:
77-
block
77+
block source="{ [weak self] in ⟨stmt⟩ }"
7878
stmt:
79-
call_expr
79+
call_expr source="⟨callee⟩()"
8080
callee:
81-
member_access_expr
82-
base: identifier "self"
83-
member_name_node: identifier "doThing"
81+
member_access_expr source="⟨base⟩?.⟨member_name_node⟩"
82+
base: identifier "self" source="self"
83+
member_name_node: identifier "doThing" source="doThing"

‎unified/extractor/tests/corpus/swift/closures/closure-with-explicit-parameters.output‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,24 @@ sourceFile
6262

6363
---
6464

65-
top_level
65+
top_level source="⟨body⟩"
6666
body:
67-
block
67+
block source="⟨stmt⟩"
6868
stmt:
69-
variable_declaration
70-
modifier: modifier "let"
71-
pattern: identifier "f"
69+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
70+
modifier: modifier "let" source="let"
71+
pattern: identifier "f" source="f"
7272
value:
73-
function_expr
73+
function_expr source="⟨body⟩⟨parameter⟩⟨return_type⟩"
7474
parameter:
75-
parameter
76-
type: identifier "Int"
77-
pattern: identifier "x"
78-
return_type: identifier "Int"
75+
parameter source="⟨pattern⟩: ⟨type⟩"
76+
type: identifier "Int" source="Int"
77+
pattern: identifier "x" source="x"
78+
return_type: identifier "Int" source="Int"
7979
body:
80-
block
80+
block source="{ (x: Int) -> Int in ⟨stmt⟩ }"
8181
stmt:
82-
binary_expr
83-
left: identifier "x"
84-
operator: infix_operator "*"
85-
right: int_literal "2"
82+
binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩"
83+
left: identifier "x" source="x"
84+
operator: infix_operator "*" source="*"
85+
right: int_literal "2" source="2"

‎unified/extractor/tests/corpus/swift/closures/closure-with-shorthand-parameters.output‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ sourceFile
3939

4040
---
4141

42-
top_level
42+
top_level source="⟨body⟩"
4343
body:
44-
block
44+
block source="⟨stmt⟩"
4545
stmt:
46-
variable_declaration
47-
modifier: modifier "let"
48-
pattern: identifier "f"
46+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
47+
modifier: modifier "let" source="let"
48+
pattern: identifier "f" source="f"
4949
value:
50-
function_expr
50+
function_expr source="⟨body⟩"
5151
body:
52-
block
52+
block source="{ ⟨stmt⟩ }"
5353
stmt:
54-
binary_expr
55-
left: identifier "$0"
56-
operator: infix_operator "+"
57-
right: identifier "$1"
54+
binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩"
55+
left: identifier "$0" source="$0"
56+
operator: infix_operator "+" source="+"
57+
right: identifier "$1" source="$1"

‎unified/extractor/tests/corpus/swift/closures/multi-statement-closure.output‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,34 @@ sourceFile
9393

9494
---
9595

96-
top_level
96+
top_level source="⟨body⟩"
9797
body:
98-
block
98+
block source="⟨stmt⟩"
9999
stmt:
100-
variable_declaration
101-
modifier: modifier "let"
102-
pattern: identifier "f"
100+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
101+
modifier: modifier "let" source="let"
102+
pattern: identifier "f" source="f"
103103
value:
104-
function_expr
104+
function_expr source="⟨body⟩⟨parameter⟩⟨return_type⟩"
105105
parameter:
106-
parameter
107-
type: identifier "Int"
108-
pattern: identifier "x"
109-
return_type: identifier "Int"
106+
parameter source="⟨pattern⟩: ⟨type⟩"
107+
type: identifier "Int" source="Int"
108+
pattern: identifier "x" source="x"
109+
return_type: identifier "Int" source="Int"
110110
body:
111-
block
111+
block source="{ (x: Int) -> Int in\n ⟨stmt⟩\n ⟨stmt⟩\n}"
112112
stmt:
113-
variable_declaration
114-
modifier: modifier "let"
115-
pattern: identifier "y"
113+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
114+
modifier: modifier "let" source="let"
115+
pattern: identifier "y" source="y"
116116
value:
117-
binary_expr
118-
left: identifier "x"
119-
operator: infix_operator "+"
120-
right: int_literal "1"
121-
return_expr
117+
binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩"
118+
left: identifier "x" source="x"
119+
operator: infix_operator "+" source="+"
120+
right: int_literal "1" source="1"
121+
return_expr source="return ⟨value⟩"
122122
value:
123-
binary_expr
124-
left: identifier "y"
125-
operator: infix_operator "*"
126-
right: int_literal "2"
123+
binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩"
124+
left: identifier "y" source="y"
125+
operator: infix_operator "*" source="*"
126+
right: int_literal "2" source="2"

‎unified/extractor/tests/corpus/swift/closures/trailing-closure.output‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ sourceFile
3939

4040
---
4141

42-
top_level
42+
top_level source="⟨body⟩"
4343
body:
44-
block
44+
block source="⟨stmt⟩"
4545
stmt:
46-
call_expr
46+
call_expr source="⟨callee⟩⟨argument⟩"
4747
callee:
48-
member_access_expr
49-
base: identifier "xs"
50-
member_name_node: identifier "map"
48+
member_access_expr source="⟨base⟩.⟨member_name_node⟩"
49+
base: identifier "xs" source="xs"
50+
member_name_node: identifier "map" source="map"
5151
argument:
52-
argument
52+
argument source="xs.map ⟨value⟩"
5353
value:
54-
function_expr
54+
function_expr source="⟨body⟩"
5555
body:
56-
block
56+
block source="{ ⟨stmt⟩ }"
5757
stmt:
58-
binary_expr
59-
left: identifier "$0"
60-
operator: infix_operator "*"
61-
right: int_literal "2"
58+
binary_expr source="⟨left⟩ ⟨operator⟩ ⟨right⟩"
59+
left: identifier "$0" source="$0"
60+
operator: infix_operator "*" source="*"
61+
right: int_literal "2" source="2"

‎unified/extractor/tests/corpus/swift/collections/array-literal.output‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ sourceFile
4141

4242
---
4343

44-
top_level
44+
top_level source="⟨body⟩"
4545
body:
46-
block
46+
block source="⟨stmt⟩"
4747
stmt:
48-
variable_declaration
49-
modifier: modifier "let"
50-
pattern: identifier "xs"
48+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
49+
modifier: modifier "let" source="let"
50+
pattern: identifier "xs" source="xs"
5151
value:
52-
array_literal
52+
array_literal source="[⟨element⟩, ⟨element⟩, ⟨element⟩]"
5353
element:
54-
int_literal "1"
55-
int_literal "2"
56-
int_literal "3"
54+
int_literal "1" source="1"
55+
int_literal "2" source="2"
56+
int_literal "3" source="3"

‎unified/extractor/tests/corpus/swift/collections/dictionary-literal.output‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ sourceFile
5252

5353
---
5454

55-
top_level
55+
top_level source="⟨body⟩"
5656
body:
57-
block
57+
block source="⟨stmt⟩"
5858
stmt:
59-
variable_declaration
60-
modifier: modifier "let"
61-
pattern: identifier "d"
62-
value: map_literal "[\"a\": 1, \"b\": 2]"
59+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
60+
modifier: modifier "let" source="let"
61+
pattern: identifier "d" source="d"
62+
value: map_literal "[\"a\": 1, \"b\": 2]" source="[\"a\": 1, \"b\": 2]"

‎unified/extractor/tests/corpus/swift/collections/dictionary-subscript.output‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ sourceFile
4141

4242
---
4343

44-
top_level
44+
top_level source="⟨body⟩"
4545
body:
46-
block
46+
block source="⟨stmt⟩"
4747
stmt:
48-
variable_declaration
49-
modifier: modifier "let"
50-
pattern: identifier "v"
48+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩ = ⟨value⟩"
49+
modifier: modifier "let" source="let"
50+
pattern: identifier "v" source="v"
5151
value:
52-
call_expr
53-
callee: identifier "d"
52+
call_expr source="⟨callee⟩[⟨argument⟩]"
53+
callee: identifier "d" source="d"
5454
argument:
55-
argument
56-
value: string_literal "\"key\""
55+
argument source="⟨value⟩"
56+
value: string_literal "\"key\"" source="\"key\""

‎unified/extractor/tests/corpus/swift/collections/empty-array-literal-with-type.output‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ sourceFile
3737

3838
---
3939

40-
top_level
40+
top_level source="⟨body⟩"
4141
body:
42-
block
42+
block source="⟨stmt⟩"
4343
stmt:
44-
variable_declaration
45-
modifier: modifier "let"
46-
pattern: identifier "xs"
44+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩: ⟨type⟩ = ⟨value⟩"
45+
modifier: modifier "let" source="let"
46+
pattern: identifier "xs" source="xs"
4747
type:
48-
generic_type_expr
49-
base: identifier "Array"
50-
type_argument: identifier "Int"
51-
value: array_literal "[]"
48+
generic_type_expr source="⟨base⟩⟨type_argument⟩"
49+
base: identifier "Array" source="[Int]"
50+
type_argument: identifier "Int" source="Int"
51+
value: array_literal "[]" source="[]"

‎unified/extractor/tests/corpus/swift/collections/set-literal.output‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ sourceFile
5656

5757
---
5858

59-
top_level
59+
top_level source="⟨body⟩"
6060
body:
61-
block
61+
block source="⟨stmt⟩"
6262
stmt:
63-
variable_declaration
64-
modifier: modifier "let"
65-
pattern: identifier "s"
63+
variable_declaration source="⟨modifier⟩ ⟨pattern⟩: ⟨type⟩ = ⟨value⟩"
64+
modifier: modifier "let" source="let"
65+
pattern: identifier "s" source="s"
6666
type:
67-
generic_type_expr
68-
base: identifier "Set"
69-
type_argument: identifier "Int"
67+
generic_type_expr source="⟨base⟩<⟨type_argument⟩>"
68+
base: identifier "Set" source="Set"
69+
type_argument: identifier "Int" source="Int"
7070
value:
71-
array_literal
71+
array_literal source="[⟨element⟩, ⟨element⟩, ⟨element⟩]"
7272
element:
73-
int_literal "1"
74-
int_literal "2"
75-
int_literal "3"
73+
int_literal "1" source="1"
74+
int_literal "2" source="2"
75+
int_literal "3" source="3"

0 commit comments

Comments
 (0)