feature. See also
. The project being documented here (as the example) is the Zig library itself.
main.addErrorsFromExpr
fn addErrorsFromExpr(
decl_index: Decl.Index,
out: *std.array_hash_map.String(ErrorIdentifier),
node: Ast.Node.Index,
) Oom!void
File
Code
fn addErrorsFromExpr(
decl_index: Decl.Index,
out: *std.array_hash_map.String(ErrorIdentifier),
node: Ast.Node.Index,
) Oom!void {
const decl = decl_index.get();
const ast = decl.file.get_ast();
switch (decl.file.categorize_expr(node)) {
.error_set => |n| switch (ast.nodeTag(n)) {
.error_set_decl => {
try addErrorsFromNode(decl_index, out, node);
},
.merge_error_sets => {
const lhs, const rhs = ast.nodeData(n).node_and_node;
try addErrorsFromExpr(decl_index, out, lhs);
try addErrorsFromExpr(decl_index, out, rhs);
},
else => unreachable,
},
.alias => |aliasee| {
try addErrorsFromDecl(aliasee, out);
},
else => return,
}
}