Skip to content

Commit cdea2a8

Browse files
committed
Lookahead uses at* notation, Cursor uses isAt* notation.
1 parent 5368d3e commit cdea2a8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SwiftParser/Expressions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ extension Parser {
874874
}
875875
} while lookahead.at(.poundIf) && lookahead.hasProgressed(&loopProgress)
876876

877-
guard lookahead.isAtStartOfPostfixExprSuffix() else {
877+
guard lookahead.atStartOfPostfixExprSuffix() else {
878878
break
879879
}
880880
}
@@ -2487,7 +2487,7 @@ extension Parser.Lookahead {
24872487
extension Parser.Lookahead {
24882488
// Helper function to see if we can parse member reference like suffixes
24892489
// inside '#if'.
2490-
fileprivate mutating func isAtStartOfPostfixExprSuffix() -> Bool {
2490+
fileprivate mutating func atStartOfPostfixExprSuffix() -> Bool {
24912491
guard self.at(.period) else {
24922492
return false
24932493
}

Sources/SwiftParser/Lexer/Cursor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ extension Lexer.Cursor {
18561856

18571857
/// Returns `true` if the cursor is positioned at `\##(` with `delimiterLength`
18581858
/// pound characters.
1859-
private func atStringInterpolationAnchor(delimiterLength: Int) -> Bool {
1859+
private func isAtStringInterpolationAnchor(delimiterLength: Int) -> Bool {
18601860
guard self.is(at: "\\") else {
18611861
return false
18621862
}
@@ -1868,7 +1868,7 @@ extension Lexer.Cursor {
18681868

18691869
/// Returns `true` if we are positioned at a backslash that escapes the newline
18701870
/// character in a multi-line string literal.
1871-
private func atEscapedNewline(delimiterLength: Int) -> Bool {
1871+
private func isAtEscapedNewline(delimiterLength: Int) -> Bool {
18721872
guard self.is(at: "\\") else {
18731873
return false
18741874
}
@@ -1891,13 +1891,13 @@ extension Lexer.Cursor {
18911891
while true {
18921892
switch self.peek() {
18931893
case UInt8(ascii: "\\"):
1894-
if self.atStringInterpolationAnchor(delimiterLength: delimiterLength) {
1894+
if self.isAtStringInterpolationAnchor(delimiterLength: delimiterLength) {
18951895
return Lexer.Result(
18961896
.stringSegment,
18971897
error: error,
18981898
stateTransition: .push(newState: .inStringInterpolationStart(stringLiteralKind: stringLiteralKind))
18991899
)
1900-
} else if stringLiteralKind == .multiLine && self.atEscapedNewline(delimiterLength: delimiterLength) {
1900+
} else if stringLiteralKind == .multiLine && self.isAtEscapedNewline(delimiterLength: delimiterLength) {
19011901
return Lexer.Result(
19021902
.stringSegment,
19031903
trailingTriviaLexingMode: .escapedNewlineInMultiLineStringLiteral

0 commit comments

Comments
 (0)