Function skipValue [src]
Like std.json.Scanner.skipValue, but handles error.BufferUnderrun.
Prototype
pub fn skipValue(self: *@This()) Reader.SkipError!void
Parameters
self: *@This()
Possible Errors
Source
pub fn skipValue(self: *@This()) Reader.SkipError!void {
switch (try self.peekNextTokenType()) {
.object_begin, .array_begin => {
try self.skipUntilStackHeight(self.stackHeight());
},
.number, .string => {
while (true) {
switch (try self.next()) {
.partial_number,
.partial_string,
.partial_string_escaped_1,
.partial_string_escaped_2,
.partial_string_escaped_3,
.partial_string_escaped_4,
=> continue,
.number, .string => break,
else => unreachable,
}
}
},
.true, .false, .null => {
_ = try self.next();
},
.object_end, .array_end, .end_of_document => unreachable, // Attempt to skip a non-value token.
}
}