Zig 0.17.0-dev (Split by item)

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 library itself.

isEmptyBlock

Walk.isEmptyBlock
fn isEmptyBlock(ast: *const Ast, node: Ast.Node.Index) bool

File

Code

fn isEmptyBlock(ast: *const Ast, node: Ast.Node.Index) bool {
    switch (ast.nodeTag(node)) {
        .block_two => {
            const opt_lhs, const opt_rhs = ast.nodeData(node).opt_node_and_opt_node;
            return opt_lhs == .none and opt_rhs == .none;
        },
        else => return false,
    }
}