Skip to content

Commit ea2a9f3

Browse files
committed
Add all keyword in TypeAttribute as .declKeyword
1 parent 6d3a615 commit ea2a9f3

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

Sources/SwiftParser/TokenPrecedence.swift

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,21 @@ enum TokenPrecedence: Comparable {
238238
.import:
239239
self = .declKeyword
240240

241+
case // `TypeAttribute`
242+
._local,
243+
._noMetadata,
244+
._opaqueReturnTypeOf,
245+
.async,
246+
.autoclosure,
247+
.convention,
248+
.differentiable,
249+
.escaping,
250+
.noDerivative,
251+
.noescape,
252+
.Sendable,
253+
.unchecked:
254+
self = .declKeyword
255+
241256
case // Treat all other keywords as expression keywords in the absence of any better information.
242257
.__owned,
243258
.__shared,
@@ -257,11 +272,9 @@ enum TokenPrecedence: Comparable {
257272
._move,
258273
._NativeClass,
259274
._NativeRefCountedObject,
260-
._noMetadata,
261275
._nonSendable,
262276
._objcImplementation,
263277
._objcRuntimeName,
264-
._opaqueReturnTypeOf,
265278
._optimize,
266279
._originallyDefinedIn,
267280
._PackageDescription,
@@ -285,20 +298,16 @@ enum TokenPrecedence: Comparable {
285298
.assignment,
286299
.associativity,
287300
.attached,
288-
.autoclosure,
289301
.availability,
290302
.available,
291303
.backDeployed,
292304
.before,
293305
.block,
294306
.canImport,
295307
.compiler,
296-
.convention,
297308
.cType,
298309
.deprecated,
299310
.derivative,
300-
.differentiable,
301-
.escaping,
302311
.exclusivity,
303312
.exported,
304313
.file,
@@ -317,8 +326,6 @@ enum TokenPrecedence: Comparable {
317326
.metadata,
318327
.module,
319328
.noasync,
320-
.noDerivative,
321-
.noescape,
322329
.none,
323330
.objc,
324331
.obsoleted,
@@ -328,7 +335,6 @@ enum TokenPrecedence: Comparable {
328335
.reverse,
329336
.right,
330337
.safe,
331-
.Sendable,
332338
.sourceFile,
333339
.spi,
334340
.spiModule,
@@ -337,7 +343,6 @@ enum TokenPrecedence: Comparable {
337343
.transpose,
338344
.Type,
339345
.unavailable,
340-
.unchecked,
341346
.unowned,
342347
.visibility,
343348
.weak,

0 commit comments

Comments
 (0)