Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

skipUntilStackHeight

Public Function
std.json.Scanner.skipUntilStackHeight
pub fn skipUntilStackHeight(self: *@This(), terminal_stack_height: usize) NextError!void

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.

Params

  • self: *@This()
  • terminal_stack_height: usize

File

json/Scanner.zig:297
297
298
299
300
301
302
303
304
305
306
307
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,
        }
    }
}