@@ -36,6 +36,7 @@ enum TokenPrecedence: Comparable {
36
36
case weakBracketClose
37
37
/// Keywords that start a new statement.
38
38
case stmtKeyword
39
+ case declarationAttributeWithSpecialSyntax
39
40
/// The '{' token because it typically marks the body of a declaration.
40
41
/// `closingDelimiter` must have type `strongPunctuator`
41
42
case openingBrace( closingDelimiter: RawTokenKind )
@@ -82,18 +83,20 @@ enum TokenPrecedence: Comparable {
82
83
return 6
83
84
case . stmtKeyword:
84
85
return 7
85
- case . strongPunctuator :
86
+ case . declarationAttributeWithSpecialSyntax :
86
87
return 8
87
- case . openingBrace :
88
+ case . strongPunctuator :
88
89
return 9
89
- case . closingBrace :
90
+ case . openingBrace :
90
91
return 10
91
- case . declKeyword :
92
+ case . closingBrace :
92
93
return 11
93
- case . openingPoundIf :
94
+ case . declKeyword :
94
95
return 12
95
- case . closingPoundIf :
96
+ case . openingPoundIf :
96
97
return 13
98
+ case . closingPoundIf:
99
+ return 14
97
100
}
98
101
}
99
102
@@ -232,81 +235,86 @@ enum TokenPrecedence: Comparable {
232
235
. __setter_access, . indirect, . isolated, . nonisolated, . distributed, . _local,
233
236
. inout, . _mutating, . _borrow, . _borrowing, . borrowing, . _consuming, . consuming, . consume,
234
237
// Accessors
235
- . get, . set, . didSet, . willSet, . unsafeAddress, . addressWithOwner, . addressWithNativeOwner, . unsafeMutableAddress,
238
+ . get, . set, . didSet, . willSet, . unsafeAddress, . addressWithOwner, . addressWithNativeOwner, . unsafeMutableAddress,
236
239
. mutableAddressWithOwner, . mutableAddressWithNativeOwner, . _read, . _modify,
237
240
// Misc
238
241
. import:
239
242
self = . declKeyword
240
243
241
- case // Treat all other keywords as expression keywords in the absence of any better information.
242
- . __owned,
243
- . __shared,
244
- . _alignment,
244
+ case // `DeclarationAttributeWithSpecialSyntax`
245
+ . _alignment,
245
246
. _backDeploy,
246
247
. _cdecl,
247
- . _Class,
248
- . _compilerInitialized,
249
- . _const,
250
248
. _documentation,
251
249
. _dynamicReplacement,
252
250
. _effects,
253
251
. _expose,
254
- . _forward,
255
252
. _implements,
256
- . _linear,
257
- . _move,
258
- . _NativeClass,
259
- . _NativeRefCountedObject,
260
- . _noMetadata,
261
253
. _nonSendable,
262
254
. _objcImplementation,
263
255
. _objcRuntimeName,
264
- . _opaqueReturnTypeOf,
265
256
. _optimize,
266
257
. _originallyDefinedIn,
267
- . _PackageDescription,
268
258
. _private,
269
259
. _projectedValueProperty,
270
- . _RefCountedObject,
271
260
. _semantics,
272
261
. _specialize,
273
262
. _spi,
274
263
. _spi_available,
275
264
. _swift_native_objc_runtime_base,
276
- . _Trivial,
277
- . _TrivialAtMost,
278
265
. _typeEraser,
279
266
. _unavailableFromAsync,
267
+ . `rethrows`,
268
+ . attached,
269
+ . available,
270
+ . backDeployed,
271
+ . derivative,
272
+ . differentiable,
273
+ . exclusivity,
274
+ . inline,
275
+ . objc,
276
+ . transpose:
277
+ self = . declarationAttributeWithSpecialSyntax
278
+ case // Treat all other keywords as expression keywords in the absence of any better information.
279
+ . __owned,
280
+ . __shared,
281
+ . _Class,
282
+ . _compilerInitialized,
283
+ . _const,
284
+ . _forward,
285
+ . _linear,
286
+ . _move,
287
+ . _NativeClass,
288
+ . _NativeRefCountedObject,
289
+ . _noMetadata,
290
+ . _opaqueReturnTypeOf,
291
+ . _PackageDescription,
292
+ . _RefCountedObject,
293
+ . _Trivial,
294
+ . _TrivialAtMost,
280
295
. _underlyingVersion,
281
296
. _UnknownLayout,
282
297
. _version,
283
298
. accesses,
284
299
. any,
285
300
. assignment,
286
301
. associativity,
287
- . attached,
288
302
. autoclosure,
289
303
. availability,
290
- . available,
291
- . backDeployed,
292
304
. before,
293
305
. block,
294
306
. canImport,
295
307
. compiler,
296
308
. convention,
297
309
. cType,
298
310
. deprecated,
299
- . derivative,
300
- . differentiable,
301
311
. escaping,
302
- . exclusivity,
303
312
. exported,
304
313
. file,
305
314
. discard,
306
315
. forward,
307
316
. higherThan,
308
317
. initializes,
309
- . inline,
310
318
. introduced,
311
319
. kind,
312
320
. left,
@@ -320,7 +328,6 @@ enum TokenPrecedence: Comparable {
320
328
. noDerivative,
321
329
. noescape,
322
330
. none,
323
- . objc,
324
331
. obsoleted,
325
332
. of,
326
333
. Protocol,
@@ -334,7 +341,6 @@ enum TokenPrecedence: Comparable {
334
341
. spiModule,
335
342
. swift,
336
343
. target,
337
- . transpose,
338
344
. Type,
339
345
. unavailable,
340
346
. unchecked,
0 commit comments