Skip to content

Commit 8e48b28

Browse files
committed
Remove unused lexer state case
1 parent 07c08da commit 8e48b28

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

Sources/SwiftParser/Lexer/Cursor.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ extension Lexer.Cursor {
8282
/// `stringInterpolationStart` points to the first character inside the interpolation.
8383
case inStringInterpolation(stringLiteralKind: StringLiteralKind, parenCount: Int)
8484

85-
/// We have parsed a string interpolation segment and are now expecting the closing `)`.
86-
case afterStringInterpolation
87-
8885
/// The mode in which leading trivia should be lexed for this state or `nil`
8986
/// if no trivia should be lexed.
9087
func leadingTriviaLexingMode(cursor: Lexer.Cursor) -> TriviaLexingMode? {
@@ -102,7 +99,6 @@ extension Lexer.Cursor {
10299
case .singleLine, .singleQuote: return .noNewlines
103100
case .multiLine: return .normal
104101
}
105-
case .afterStringInterpolation: return .normal
106102
}
107103
}
108104

@@ -117,7 +113,6 @@ extension Lexer.Cursor {
117113
case .afterClosingStringQuote: return nil
118114
case .inStringInterpolationStart: return nil
119115
case .inStringInterpolation: return .noNewlines
120-
case .afterStringInterpolation: return .noNewlines
121116
}
122117
}
123118

@@ -134,7 +129,6 @@ extension Lexer.Cursor {
134129
case .afterClosingStringQuote: return false
135130
case .inStringInterpolationStart: return false
136131
case .inStringInterpolation: return false
137-
case .afterStringInterpolation: return false
138132
}
139133
}
140134
}
@@ -333,8 +327,6 @@ extension Lexer.Cursor {
333327
result = lexInStringInterpolationStart(stringLiteralKind: stringLiteralKind)
334328
case .inStringInterpolation(stringLiteralKind: let stringLiteralKind, parenCount: let parenCount):
335329
result = lexInStringInterpolation(stringLiteralKind: stringLiteralKind, parenCount: parenCount, sourceBufferStart: sourceBufferStart)
336-
case .afterStringInterpolation:
337-
result = lexAfterStringInterpolation()
338330
}
339331

340332
if let stateTransition = result.stateTransition {
@@ -973,18 +965,6 @@ extension Lexer.Cursor {
973965
return self.lexNormal(sourceBufferStart: sourceBufferStart)
974966
}
975967
}
976-
977-
private mutating func lexAfterStringInterpolation() -> Lexer.Result {
978-
switch self.peek() {
979-
case UInt8(ascii: ")"):
980-
_ = self.advance()
981-
return Lexer.Result(.rightParen, stateTransition: .pop)
982-
case nil:
983-
return Lexer.Result(.eof)
984-
default:
985-
preconditionFailure("state 'isAfterStringInterpolation' expects to be positoned at ')'")
986-
}
987-
}
988968
}
989969

990970
// MARK: - Trivia

0 commit comments

Comments
 (0)