File tree 2 files changed +3
-14
lines changed
Sources/SwiftParser/Lexer 2 files changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -1772,6 +1772,8 @@ extension Lexer.Cursor {
1772
1772
}
1773
1773
1774
1774
mutating func lexInStringLiteral( stringLiteralKind: StringLiteralKind , delimiterLength: Int ) -> Lexer . Result {
1775
+ if self . isAtEndOfFile { return . init( . eof) }
1776
+
1775
1777
var error : LexingDiagnostic ? = nil
1776
1778
1777
1779
while true {
Original file line number Diff line number Diff line change @@ -43,20 +43,7 @@ extension Lexer {
43
43
44
44
mutating func advance( ) -> Lexer . Lexeme {
45
45
defer {
46
- if self . cursor. isAtEndOfFile {
47
- self . nextToken = Lexeme (
48
- tokenKind: . eof,
49
- flags: [ ] ,
50
- diagnostic: nil ,
51
- start: self . cursor. pointer,
52
- leadingTriviaLength: 0 ,
53
- textLength: 0 ,
54
- trailingTriviaLength: 0 ,
55
- cursor: self . cursor
56
- )
57
- } else {
58
- self . nextToken = self . cursor. nextToken ( sourceBufferStart: self . sourceBufferStart, stateAllocator: lexerStateAllocator)
59
- }
46
+ self . nextToken = self . cursor. nextToken ( sourceBufferStart: self . sourceBufferStart, stateAllocator: lexerStateAllocator)
60
47
}
61
48
return self . nextToken
62
49
}
You can’t perform that action at this time.
0 commit comments