Skip to content

Commit d0a0af7

Browse files
committed
Add all keyword in DeclarationAttributeWithSpecialSyntax as .declKeyword
1 parent ea2a9f3 commit d0a0af7

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

Sources/SwiftParser/TokenPrecedence.swift

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -253,69 +253,76 @@ enum TokenPrecedence: Comparable {
253253
.unchecked:
254254
self = .declKeyword
255255

256-
case // Treat all other keywords as expression keywords in the absence of any better information.
257-
.__owned,
258-
.__shared,
259-
._alignment,
256+
case // `DeclarationAttributeWithSpecialSyntax`
257+
._alignment,
260258
._backDeploy,
261259
._cdecl,
262-
._Class,
263-
._compilerInitialized,
264-
._const,
265260
._documentation,
266261
._dynamicReplacement,
267262
._effects,
268263
._expose,
269-
._forward,
270264
._implements,
271-
._linear,
272-
._move,
273-
._NativeClass,
274-
._NativeRefCountedObject,
275265
._nonSendable,
276266
._objcImplementation,
277267
._objcRuntimeName,
278268
._optimize,
279269
._originallyDefinedIn,
280-
._PackageDescription,
281270
._private,
282271
._projectedValueProperty,
283-
._RefCountedObject,
284272
._semantics,
285273
._specialize,
286274
._spi,
287275
._spi_available,
288276
._swift_native_objc_runtime_base,
289-
._Trivial,
290-
._TrivialAtMost,
291277
._typeEraser,
292278
._unavailableFromAsync,
279+
.`rethrows`,
280+
.attached,
281+
.available,
282+
.backDeployed,
283+
.derivative,
284+
.differentiable,
285+
.exclusivity,
286+
.inline,
287+
.objc,
288+
.transpose:
289+
self = .declKeyword
290+
291+
case // Treat all other keywords as expression keywords in the absence of any better information.
292+
.__owned,
293+
.__shared,
294+
._Class,
295+
._compilerInitialized,
296+
._const,
297+
._forward,
298+
._linear,
299+
._move,
300+
._NativeClass,
301+
._NativeRefCountedObject,
302+
._PackageDescription,
303+
._RefCountedObject,
304+
._Trivial,
305+
._TrivialAtMost,
293306
._underlyingVersion,
294307
._UnknownLayout,
295308
._version,
296309
.accesses,
297310
.any,
298311
.assignment,
299312
.associativity,
300-
.attached,
301313
.availability,
302-
.available,
303-
.backDeployed,
304314
.before,
305315
.block,
306316
.canImport,
307317
.compiler,
308318
.cType,
309319
.deprecated,
310-
.derivative,
311-
.exclusivity,
312320
.exported,
313321
.file,
314322
.discard,
315323
.forward,
316324
.higherThan,
317325
.initializes,
318-
.inline,
319326
.introduced,
320327
.kind,
321328
.left,
@@ -327,7 +334,6 @@ enum TokenPrecedence: Comparable {
327334
.module,
328335
.noasync,
329336
.none,
330-
.objc,
331337
.obsoleted,
332338
.of,
333339
.Protocol,
@@ -340,7 +346,6 @@ enum TokenPrecedence: Comparable {
340346
.spiModule,
341347
.swift,
342348
.target,
343-
.transpose,
344349
.Type,
345350
.unavailable,
346351
.unowned,

0 commit comments

Comments
 (0)