Skip to content

Commit e7e8b0d

Browse files
committed
Simplify a call of consume(ifAny:where:) to consume(ifAny:contextualKeywords:)
1 parent 16977f9 commit e7e8b0d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Sources/SwiftParser/Types.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -784,13 +784,7 @@ extension Parser {
784784
public mutating func parseTypeAttributeListPresent() -> RawAttributeListSyntax {
785785
var elements = [RawSyntax]()
786786
var modifiersProgress = LoopProgressCondition()
787-
while let token = self.consume(ifAny: [.inoutKeyword, .identifier], where: {
788-
if $0.tokenKind == .identifier {
789-
return $0.isContextualKeyword(["__shared", "__owned", "isolated", "_const"])
790-
} else {
791-
return true
792-
}
793-
}), modifiersProgress.evaluate(currentToken) {
787+
while let token = self.consume(ifAny: [.inoutKeyword], contextualKeywords: ["__shared", "__owned", "isolated", "_const"]), modifiersProgress.evaluate(currentToken) {
794788
elements.append(RawSyntax(token))
795789
}
796790

0 commit comments

Comments
 (0)