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.

walkLocalVarDecl

Walk.walkLocalVarDecl
fn walkLocalVarDecl(w: *Walk, var_decl: Ast.full.VarDecl) Error!void

File

Code

fn walkLocalVarDecl(w: *Walk, var_decl: Ast.full.VarDecl) Error!void {
    try walkIdentifierNew(w, var_decl.ast.mut_token + 1); // name

    if (var_decl.ast.type_node.unwrap()) |type_node| {
        try walkExpression(w, type_node);
    }

    if (var_decl.ast.align_node.unwrap()) |align_node| {
        try walkExpression(w, align_node);
    }

    if (var_decl.ast.addrspace_node.unwrap()) |addrspace_node| {
        try walkExpression(w, addrspace_node);
    }

    if (var_decl.ast.section_node.unwrap()) |section_node| {
        try walkExpression(w, section_node);
    }

    if (var_decl.ast.init_node.unwrap()) |init_node| {
        if (!isUndefinedIdent(w.ast, init_node)) {
            try w.transformations.append(.{ .replace_with_undef = init_node });
        }
        try walkExpression(w, init_node);
    }
}