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.

addErrorsFromDecl

main.addErrorsFromDecl
fn addErrorsFromDecl(
    decl_index: Decl.Index,
    out: *std.array_hash_map.String(ErrorIdentifier),
) Oom!void

File

lib/docs/wasm/main.zig:306

Code

fn addErrorsFromDecl(
    decl_index: Decl.Index,
    out: *std.array_hash_map.String(ErrorIdentifier),
) Oom!void {
    switch (decl_index.get().categorize()) {
        .error_set => |node| try addErrorsFromExpr(decl_index, out, node),
        .alias => |aliasee| try addErrorsFromDecl(aliasee, out),
        else => |cat| log.debug("unable to addErrorsFromDecl: {any}", .{cat}),
    }
}