@@ -110,7 +110,7 @@ extension TokenConsumer {
110
110
declStartKeyword = subparser. at ( anyIn: DeclarationKeyword . self) ? . 0
111
111
}
112
112
switch declStartKeyword {
113
- case . lhs ( . actor ) :
113
+ case . group ( . actor ) :
114
114
// actor Foo {}
115
115
if subparser. peek ( ) . rawTokenKind == . identifier {
116
116
return true
@@ -123,16 +123,16 @@ extension TokenConsumer {
123
123
lookahead. consumeAnyToken ( )
124
124
} while lookahead. atStartOfDeclaration ( isAtTopLevel: isAtTopLevel, allowInitDecl: allowInitDecl)
125
125
return lookahead. at ( . identifier)
126
- case . lhs ( . case) :
126
+ case . simple ( . case) :
127
127
// When 'case' appears inside a function, it's probably a switch
128
128
// case, not an enum case declaration.
129
129
return false
130
- case . lhs ( . `init`) :
130
+ case . simple ( . `init`) :
131
131
return allowInitDecl
132
- case . lhs ( . macro) :
132
+ case . simple ( . macro) :
133
133
// macro Foo ...
134
134
return subparser. peek ( ) . rawTokenKind == . identifier
135
- case . lhs ( . pound) :
135
+ case . simple ( . pound) :
136
136
// Force parsing '#<identifier>' after attributes as a macro expansion decl.
137
137
if hasAttribute || hasModifier {
138
138
return true
@@ -215,7 +215,7 @@ extension Parser {
215
215
} else if atFunctionDeclarationWithoutFuncKeyword ( ) {
216
216
// We aren't at a declaration keyword and it looks like we are at a function
217
217
// declaration. Parse a function declaration.
218
- recoveryResult = ( . lhs ( . func) , . missing( . keyword( . func) ) )
218
+ recoveryResult = ( . simple ( . func) , . missing( . keyword( . func) ) )
219
219
} else {
220
220
// In all other cases, use standard token recovery to find the declaration
221
221
// to parse.
@@ -226,53 +226,53 @@ extension Parser {
226
226
}
227
227
228
228
switch recoveryResult {
229
- case ( . lhs ( . import) , let handle) ? :
229
+ case ( . simple ( . import) , let handle) ? :
230
230
return RawDeclSyntax ( self . parseImportDeclaration ( attrs, handle) )
231
- case ( . lhs ( . class) , let handle) ? :
231
+ case ( . group ( . class) , let handle) ? :
232
232
return RawDeclSyntax (
233
233
self . parseNominalTypeDeclaration ( for: RawClassDeclSyntax . self, attrs: attrs, introucerHandle: handle)
234
234
)
235
- case ( . lhs ( . enum) , let handle) ? :
235
+ case ( . group ( . enum) , let handle) ? :
236
236
return RawDeclSyntax (
237
237
self . parseNominalTypeDeclaration ( for: RawEnumDeclSyntax . self, attrs: attrs, introucerHandle: handle)
238
238
)
239
- case ( . lhs ( . case) , let handle) ? :
239
+ case ( . simple ( . case) , let handle) ? :
240
240
return RawDeclSyntax ( self . parseEnumCaseDeclaration ( attrs, handle) )
241
- case ( . lhs ( . struct) , let handle) ? :
241
+ case ( . group ( . struct) , let handle) ? :
242
242
return RawDeclSyntax (
243
243
self . parseNominalTypeDeclaration ( for: RawStructDeclSyntax . self, attrs: attrs, introucerHandle: handle)
244
244
)
245
- case ( . lhs ( . protocol) , let handle) ? :
245
+ case ( . group ( . protocol) , let handle) ? :
246
246
return RawDeclSyntax (
247
247
self . parseNominalTypeDeclaration ( for: RawProtocolDeclSyntax . self, attrs: attrs, introucerHandle: handle)
248
248
)
249
- case ( . lhs ( . associatedtype) , let handle) ? :
249
+ case ( . simple ( . associatedtype) , let handle) ? :
250
250
return RawDeclSyntax ( self . parseAssociatedTypeDeclaration ( attrs, handle) )
251
- case ( . lhs ( . typealias) , let handle) ? :
251
+ case ( . simple ( . typealias) , let handle) ? :
252
252
return RawDeclSyntax ( self . parseTypealiasDeclaration ( attrs, handle) )
253
- case ( . lhs ( . extension) , let handle) ? :
253
+ case ( . group ( . extension) , let handle) ? :
254
254
return RawDeclSyntax ( self . parseExtensionDeclaration ( attrs, handle) )
255
- case ( . lhs ( . func) , let handle) ? :
255
+ case ( . simple ( . func) , let handle) ? :
256
256
return RawDeclSyntax ( self . parseFuncDeclaration ( attrs, handle) )
257
- case ( . lhs ( . subscript) , let handle) ? :
257
+ case ( . simple ( . subscript) , let handle) ? :
258
258
return RawDeclSyntax ( self . parseSubscriptDeclaration ( attrs, handle) )
259
- case ( . lhs ( . `init`) , let handle) ? :
259
+ case ( . simple ( . `init`) , let handle) ? :
260
260
return RawDeclSyntax ( self . parseInitializerDeclaration ( attrs, handle) )
261
- case ( . lhs ( . deinit) , let handle) ? :
261
+ case ( . simple ( . deinit) , let handle) ? :
262
262
return RawDeclSyntax ( self . parseDeinitializerDeclaration ( attrs, handle) )
263
- case ( . lhs ( . operator) , let handle) ? :
263
+ case ( . simple ( . operator) , let handle) ? :
264
264
return RawDeclSyntax ( self . parseOperatorDeclaration ( attrs, handle) )
265
- case ( . lhs ( . precedencegroup) , let handle) ? :
265
+ case ( . simple ( . precedencegroup) , let handle) ? :
266
266
return RawDeclSyntax ( self . parsePrecedenceGroupDeclaration ( attrs, handle) )
267
- case ( . lhs ( . actor ) , let handle) ? :
267
+ case ( . group ( . actor ) , let handle) ? :
268
268
return RawDeclSyntax (
269
269
self . parseNominalTypeDeclaration ( for: RawActorDeclSyntax . self, attrs: attrs, introucerHandle: handle)
270
270
)
271
- case ( . lhs ( . macro) , let handle) ? :
271
+ case ( . simple ( . macro) , let handle) ? :
272
272
return RawDeclSyntax ( self . parseMacroDeclaration ( attrs: attrs, introducerHandle: handle) )
273
- case ( . lhs ( . pound) , let handle) ? :
273
+ case ( . simple ( . pound) , let handle) ? :
274
274
return RawDeclSyntax ( self . parseMacroExpansionDeclaration ( attrs, handle) )
275
- case ( . rhs , let handle) ? :
275
+ case ( . binding , let handle) ? :
276
276
return RawDeclSyntax ( self . parseBindingDeclaration ( attrs, handle, inMemberDeclList: inMemberDeclList) )
277
277
case nil :
278
278
break
0 commit comments