Skip to content

Commit c1ebe0e

Browse files
committed
Move repeat handling from canParseTypeScalar to canParseType
This is handled in `parseType`, not `parseTypeScalar`. `canParseType` is currently the only client of `canParseTypeScalar` though, so this is NFC.
1 parent f015485 commit c1ebe0e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftParser/Types.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ extension Parser {
626626

627627
extension Parser.Lookahead {
628628
mutating func canParseType() -> Bool {
629+
// 'repeat' starts a pack expansion type
630+
self.consume(if: .keyword(.repeat))
631+
629632
guard self.canParseTypeScalar() else {
630633
return false
631634
}
@@ -656,9 +659,6 @@ extension Parser.Lookahead {
656659
}
657660

658661
mutating func canParseTypeScalar() -> Bool {
659-
// 'repeat' starts a pack expansion type
660-
self.consume(if: .keyword(.repeat))
661-
662662
self.skipTypeAttributeList()
663663

664664
guard self.canParseSimpleOrCompositionType() else {

0 commit comments

Comments
 (0)