File tree Expand file tree Collapse file tree 4 files changed +288
-2
lines changed Expand file tree Collapse file tree 4 files changed +288
-2
lines changed Original file line number Diff line number Diff line change @@ -1021,6 +1021,7 @@ ParserResult<TupleTypeRepr> Parser::parseTypeTupleBody() {
1021
1021
1022
1022
// Parse optional '...'.
1023
1023
if (Tok.isEllipsis ()) {
1024
+ Tok.setKind (tok::ellipsis);
1024
1025
auto ElementEllipsisLoc = consumeToken ();
1025
1026
if (EllipsisLoc.isInvalid ()) {
1026
1027
EllipsisLoc = ElementEllipsisLoc;
Original file line number Diff line number Diff line change
1
+ // RUN: %swift-syntax-test -input-source-filename %s -serialize-raw-tree > %t.result
2
+ // RUN: diff %t.result %s.result
3
+
4
+ typealias x = ( _ b: Int , _: String )
Original file line number Diff line number Diff line change
1
+ {
2
+ "id": 24,
3
+ "kind": "SourceFile",
4
+ "layout": [
5
+ {
6
+ "id": 23,
7
+ "kind": "CodeBlockItemList",
8
+ "layout": [
9
+ {
10
+ "id": 21,
11
+ "kind": "CodeBlockItem",
12
+ "layout": [
13
+ {
14
+ "id": 20,
15
+ "kind": "TypealiasDecl",
16
+ "layout": [
17
+ null,
18
+ null,
19
+ {
20
+ "id": 1,
21
+ "tokenKind": {
22
+ "kind": "kw_typealias"
23
+ },
24
+ "leadingTrivia": [
25
+ {
26
+ "kind": "LineComment",
27
+ "value": "\/\/ RUN: %swift-syntax-test -input-source-filename %s -serialize-raw-tree > %t.result"
28
+ },
29
+ {
30
+ "kind": "Newline",
31
+ "value": 1
32
+ },
33
+ {
34
+ "kind": "LineComment",
35
+ "value": "\/\/ RUN: diff %t.result %s.result"
36
+ },
37
+ {
38
+ "kind": "Newline",
39
+ "value": 2
40
+ }
41
+ ],
42
+ "trailingTrivia": [
43
+ {
44
+ "kind": "Space",
45
+ "value": 1
46
+ }
47
+ ],
48
+ "presence": "Present"
49
+ },
50
+ {
51
+ "id": 2,
52
+ "tokenKind": {
53
+ "kind": "identifier",
54
+ "text": "x"
55
+ },
56
+ "leadingTrivia": [],
57
+ "trailingTrivia": [
58
+ {
59
+ "kind": "Space",
60
+ "value": 1
61
+ }
62
+ ],
63
+ "presence": "Present"
64
+ },
65
+ null,
66
+ {
67
+ "id": 19,
68
+ "kind": "TypeInitializerClause",
69
+ "layout": [
70
+ {
71
+ "id": 3,
72
+ "tokenKind": {
73
+ "kind": "equal"
74
+ },
75
+ "leadingTrivia": [],
76
+ "trailingTrivia": [
77
+ {
78
+ "kind": "Space",
79
+ "value": 1
80
+ }
81
+ ],
82
+ "presence": "Present"
83
+ },
84
+ {
85
+ "id": 18,
86
+ "kind": "TupleType",
87
+ "layout": [
88
+ {
89
+ "id": 4,
90
+ "tokenKind": {
91
+ "kind": "l_paren"
92
+ },
93
+ "leadingTrivia": [],
94
+ "trailingTrivia": [],
95
+ "presence": "Present"
96
+ },
97
+ {
98
+ "id": 16,
99
+ "kind": "TupleTypeElementList",
100
+ "layout": [
101
+ {
102
+ "id": 11,
103
+ "kind": "TupleTypeElement",
104
+ "layout": [
105
+ null,
106
+ {
107
+ "id": 5,
108
+ "tokenKind": {
109
+ "kind": "kw__"
110
+ },
111
+ "leadingTrivia": [],
112
+ "trailingTrivia": [
113
+ {
114
+ "kind": "Space",
115
+ "value": 1
116
+ }
117
+ ],
118
+ "presence": "Present"
119
+ },
120
+ {
121
+ "id": 6,
122
+ "tokenKind": {
123
+ "kind": "identifier",
124
+ "text": "b"
125
+ },
126
+ "leadingTrivia": [],
127
+ "trailingTrivia": [],
128
+ "presence": "Present"
129
+ },
130
+ {
131
+ "id": 7,
132
+ "tokenKind": {
133
+ "kind": "colon"
134
+ },
135
+ "leadingTrivia": [],
136
+ "trailingTrivia": [
137
+ {
138
+ "kind": "Space",
139
+ "value": 1
140
+ }
141
+ ],
142
+ "presence": "Present"
143
+ },
144
+ {
145
+ "id": 9,
146
+ "kind": "SimpleTypeIdentifier",
147
+ "layout": [
148
+ {
149
+ "id": 8,
150
+ "tokenKind": {
151
+ "kind": "identifier",
152
+ "text": "Int"
153
+ },
154
+ "leadingTrivia": [],
155
+ "trailingTrivia": [],
156
+ "presence": "Present"
157
+ },
158
+ null
159
+ ],
160
+ "presence": "Present"
161
+ },
162
+ null,
163
+ null,
164
+ {
165
+ "id": 10,
166
+ "tokenKind": {
167
+ "kind": "comma"
168
+ },
169
+ "leadingTrivia": [],
170
+ "trailingTrivia": [
171
+ {
172
+ "kind": "Space",
173
+ "value": 1
174
+ }
175
+ ],
176
+ "presence": "Present"
177
+ }
178
+ ],
179
+ "presence": "Present"
180
+ },
181
+ {
182
+ "id": 15,
183
+ "kind": "TupleTypeElement",
184
+ "layout": [
185
+ null,
186
+ {
187
+ "id": 12,
188
+ "tokenKind": {
189
+ "kind": "kw__"
190
+ },
191
+ "leadingTrivia": [],
192
+ "trailingTrivia": [],
193
+ "presence": "Present"
194
+ },
195
+ null,
196
+ {
197
+ "id": 7,
198
+ "tokenKind": {
199
+ "kind": "colon"
200
+ },
201
+ "leadingTrivia": [],
202
+ "trailingTrivia": [
203
+ {
204
+ "kind": "Space",
205
+ "value": 1
206
+ }
207
+ ],
208
+ "presence": "Present"
209
+ },
210
+ {
211
+ "id": 14,
212
+ "kind": "SimpleTypeIdentifier",
213
+ "layout": [
214
+ {
215
+ "id": 13,
216
+ "tokenKind": {
217
+ "kind": "identifier",
218
+ "text": "String"
219
+ },
220
+ "leadingTrivia": [],
221
+ "trailingTrivia": [],
222
+ "presence": "Present"
223
+ },
224
+ null
225
+ ],
226
+ "presence": "Present"
227
+ },
228
+ null,
229
+ null,
230
+ null
231
+ ],
232
+ "presence": "Present"
233
+ }
234
+ ],
235
+ "presence": "Present"
236
+ },
237
+ {
238
+ "id": 17,
239
+ "tokenKind": {
240
+ "kind": "r_paren"
241
+ },
242
+ "leadingTrivia": [],
243
+ "trailingTrivia": [],
244
+ "presence": "Present"
245
+ }
246
+ ],
247
+ "presence": "Present"
248
+ }
249
+ ],
250
+ "presence": "Present"
251
+ },
252
+ null
253
+ ],
254
+ "presence": "Present"
255
+ },
256
+ null,
257
+ null
258
+ ],
259
+ "presence": "Present"
260
+ }
261
+ ],
262
+ "presence": "Present"
263
+ },
264
+ {
265
+ "id": 22,
266
+ "tokenKind": {
267
+ "kind": "eof",
268
+ "text": ""
269
+ },
270
+ "leadingTrivia": [
271
+ {
272
+ "kind": "Newline",
273
+ "value": 1
274
+ }
275
+ ],
276
+ "trailingTrivia": [],
277
+ "presence": "Present"
278
+ }
279
+ ],
280
+ "presence": "Present"
281
+ }
Original file line number Diff line number Diff line change 118
118
Node ('TupleTypeElement' , kind = 'Syntax' ,
119
119
traits = ['WithTrailingComma' ],
120
120
children = [
121
- Child ('InOut' , kind = 'InOutToken ' ,
121
+ Child ('InOut' , kind = 'InoutToken ' ,
122
122
is_optional = True ),
123
123
Child ('Name' , kind = 'Token' ,
124
124
is_optional = True ,
135
135
Child ('Colon' , kind = 'ColonToken' ,
136
136
is_optional = True ),
137
137
Child ('Type' , kind = 'Type' ),
138
- Child ('Ellipsis' , kind = 'Token ' ,
138
+ Child ('Ellipsis' , kind = 'EllipsisToken ' ,
139
139
is_optional = True ),
140
140
Child ('Initializer' , kind = 'InitializerClause' ,
141
141
is_optional = True ),
You can’t perform that action at this time.
0 commit comments