Skip to content

Commit 8562e7b

Browse files
committed
[NFC] eatParse -> consume
1 parent 7bd84c0 commit 8562e7b

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Sources/SwiftParser/Declarations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extension TokenConsumer {
2424
var attributeProgress = LoopProgressCondition()
2525
while attributeProgress.evaluate(subparser.currentToken) && subparser.at(.atSign) {
2626
hasAttribute = true
27-
_ = subparser.eatParseAttributeList()
27+
_ = subparser.consumeAttributeList()
2828
}
2929

3030
var modifierProgress = LoopProgressCondition()

Sources/SwiftParser/Lookahead.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ extension Parser.Lookahead {
171171
public mutating func eat(_ kind: RawTokenKind) -> Token {
172172
return self.consume(if: kind)!
173173
}
174+
}
174175

175-
mutating func eatParseAttributeList() -> Bool {
176+
extension Parser.Lookahead {
177+
mutating func consumeAttributeList() -> Bool {
176178
guard self.at(.atSign) else {
177179
return false
178180
}

Sources/SwiftParser/Types.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ extension Parser.Lookahead {
712712
self.consumeAnyToken()
713713

714714
// Parse an optional generic argument list.
715-
if self.currentToken.starts(with: "<") && !self.canParseGenericArguments() {
715+
if self.currentToken.starts(with: "<") && !self.consumeGenericArguments() {
716716
return false
717717
}
718718

@@ -725,13 +725,13 @@ extension Parser.Lookahead {
725725
}
726726

727727
var lookahead = self.lookahead()
728-
guard lookahead.canParseGenericArguments() else {
728+
guard lookahead.consumeGenericArguments() else {
729729
return false
730730
}
731731
return lookahead.currentToken.isGenericTypeDisambiguatingToken
732732
}
733733

734-
mutating func canParseGenericArguments() -> Bool {
734+
mutating func consumeGenericArguments() -> Bool {
735735
// Parse the opening '<'.
736736
guard self.currentToken.starts(with: "<") else {
737737
return false

0 commit comments

Comments
 (0)