Skip to content

Commit 6a2fa62

Browse files
authored
Merge pull request #1405 from WowbaggersLiquidLunch/isMissing
[NFC] Rename `TokenConsumptionHandle.missing` to `.tokenIsMissing`
2 parents cb8981a + b360cf8 commit 6a2fa62

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Sources/SwiftParser/Declarations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ extension Parser {
16671667

16681668
/// Parse an accessor.
16691669
mutating func parseAccessorDecl() -> RawAccessorDeclSyntax {
1670-
let forcedHandle = TokenConsumptionHandle(spec: .keyword(.get), missing: true)
1670+
let forcedHandle = TokenConsumptionHandle(spec: .keyword(.get), tokenIsMissing: true)
16711671
let introducer = parseAccessorIntroducer(forcedKind: (.get, forcedHandle))!
16721672
return parseAccessorDecl(introducer: introducer)
16731673
}

Sources/SwiftParser/Recovery.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public struct RecoveryConsumptionHandle {
3434
static func missing(_ spec: TokenSpec) -> RecoveryConsumptionHandle {
3535
return RecoveryConsumptionHandle(
3636
unexpectedTokens: 0,
37-
tokenConsumptionHandle: TokenConsumptionHandle(spec: spec, missing: true)
37+
tokenConsumptionHandle: TokenConsumptionHandle(spec: spec, tokenIsMissing: true)
3838
)
3939
}
4040
}

Sources/SwiftParser/TokenConsumer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct TokenConsumptionHandle {
4444
var spec: TokenSpec
4545
/// If `true`, the token we should consume should be synthesized as a missing token
4646
/// and no tokens should be consumed.
47-
var missing: Bool = false
47+
var tokenIsMissing: Bool = false
4848
}
4949

5050
extension TokenConsumer {
@@ -106,7 +106,7 @@ extension TokenConsumer {
106106
/// Eat a token that we know we are currently positioned at, based on `at(anyIn:)`.
107107
@inline(__always)
108108
mutating func eat(_ handle: TokenConsumptionHandle) -> Token {
109-
if handle.missing {
109+
if handle.tokenIsMissing {
110110
return missingToken(handle.spec)
111111
} else {
112112
return eat(handle.spec)

0 commit comments

Comments
 (0)