pub fn skipUntilStackHeight(self: *@This(), terminal_stack_height: usize) NextError!void self: *@This()terminal_stack_height: usize297
298
299
300
301
302
303
304
305
306
307pub 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,
}
}
}
Skip tokens until an
.object_endor.array_endtoken results in astackHeight()equal the given stack height. UnlikeskipValue(), this function is available in streaming mode.