We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5250447 commit 27fc293Copy full SHA for 27fc293
Sources/SwiftCompilerPluginMessageHandling/JSON/JSONDecoding.swift
@@ -208,9 +208,13 @@ private struct JSONScanner {
208
209
@inline(__always)
210
mutating func expect(_ char: UnicodeScalar) throws {
211
- guard advance(if: char) else {
+ guard hasData else {
212
+ throw JSONError.unexpectedEndOfFile
213
+ }
214
+ guard ptr.pointee == UInt8(ascii: char) else {
215
throw JSONError.unexpectedCharacter(ptr.pointee, context: "expected \(char)")
216
}
217
+ ptr += 1
218
219
220
mutating func scanNull() throws {
0 commit comments