@@ -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,87 @@ 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
+
279
+ case // Treat all other keywords as expression keywords in the absence of any better information.
280
+ . __owned,
281
+ . __shared,
282
+ . _Class,
283
+ . _compilerInitialized,
284
+ . _const,
285
+ . _forward,
286
+ . _linear,
287
+ . _move,
288
+ . _NativeClass,
289
+ . _NativeRefCountedObject,
290
+ . _noMetadata,
291
+ . _opaqueReturnTypeOf,
292
+ . _PackageDescription,
293
+ . _RefCountedObject,
294
+ . _Trivial,
295
+ . _TrivialAtMost,
280
296
. _underlyingVersion,
281
297
. _UnknownLayout,
282
298
. _version,
283
299
. accesses,
284
300
. any,
285
301
. assignment,
286
302
. associativity,
287
- . attached,
288
303
. autoclosure,
289
304
. availability,
290
- . available,
291
- . backDeployed,
292
305
. before,
293
306
. block,
294
307
. canImport,
295
308
. compiler,
296
309
. convention,
297
310
. cType,
298
311
. deprecated,
299
- . derivative,
300
- . differentiable,
301
312
. escaping,
302
- . exclusivity,
303
313
. exported,
304
314
. file,
305
315
. discard,
306
316
. forward,
307
317
. higherThan,
308
318
. initializes,
309
- . inline,
310
319
. introduced,
311
320
. kind,
312
321
. left,
@@ -320,7 +329,6 @@ enum TokenPrecedence: Comparable {
320
329
. noDerivative,
321
330
. noescape,
322
331
. none,
323
- . objc,
324
332
. obsoleted,
325
333
. of,
326
334
. Protocol,
@@ -334,7 +342,6 @@ enum TokenPrecedence: Comparable {
334
342
. spiModule,
335
343
. swift,
336
344
. target,
337
- . transpose,
338
345
. Type,
339
346
. unavailable,
340
347
. unchecked,
0 commit comments