Skip to content

Commit 62c38c7

Browse files
committed
Add all keyword in TypeAttribute as .exprKeyword
1 parent 6d3a615 commit 62c38c7

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

Sources/SwiftParser/TokenPrecedence.swift

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

241+
case // `TypeAttribute`
242+
._noMetadata,
243+
._opaqueReturnTypeOf,
244+
.autoclosure,
245+
.convention,
246+
.differentiable,
247+
.escaping,
248+
.noDerivative,
249+
.noescape,
250+
.Sendable,
251+
.unchecked:
252+
self = .exprKeyword
253+
241254
case // Treat all other keywords as expression keywords in the absence of any better information.
242255
.__owned,
243256
.__shared,
@@ -257,11 +270,9 @@ enum TokenPrecedence: Comparable {
257270
._move,
258271
._NativeClass,
259272
._NativeRefCountedObject,
260-
._noMetadata,
261273
._nonSendable,
262274
._objcImplementation,
263275
._objcRuntimeName,
264-
._opaqueReturnTypeOf,
265276
._optimize,
266277
._originallyDefinedIn,
267278
._PackageDescription,
@@ -285,20 +296,16 @@ enum TokenPrecedence: Comparable {
285296
.assignment,
286297
.associativity,
287298
.attached,
288-
.autoclosure,
289299
.availability,
290300
.available,
291301
.backDeployed,
292302
.before,
293303
.block,
294304
.canImport,
295305
.compiler,
296-
.convention,
297306
.cType,
298307
.deprecated,
299308
.derivative,
300-
.differentiable,
301-
.escaping,
302309
.exclusivity,
303310
.exported,
304311
.file,
@@ -317,8 +324,6 @@ enum TokenPrecedence: Comparable {
317324
.metadata,
318325
.module,
319326
.noasync,
320-
.noDerivative,
321-
.noescape,
322327
.none,
323328
.objc,
324329
.obsoleted,
@@ -328,7 +333,6 @@ enum TokenPrecedence: Comparable {
328333
.reverse,
329334
.right,
330335
.safe,
331-
.Sendable,
332336
.sourceFile,
333337
.spi,
334338
.spiModule,
@@ -337,7 +341,6 @@ enum TokenPrecedence: Comparable {
337341
.transpose,
338342
.Type,
339343
.unavailable,
340-
.unchecked,
341344
.unowned,
342345
.visibility,
343346
.weak,

0 commit comments

Comments
 (0)