Function skipUntilStackHeight [src]
Skip tokens until an .object_end or .array_end token results in a stackHeight() equal the given stack height.
Unlike skipValue(), this function is available in streaming mode.
Prototype
pub fn skipUntilStackHeight(self: *@This(), terminal_stack_height: usize) NextError!void
Parameters
self: *@This()
terminal_stack_height: usize
Possible Errors
Source
pub fn skipUntilStackHeight(self: *@This(), terminal_stack_height: usize) NextError!void {
while (true) {
switch (try self.next()) {
.object_end, .array_end => {
if (self.stackHeight() == terminal_stack_height) break;
},
.end_of_document => unreachable,
else => continue,
}
}
}