Function annotate [src]
Prototype
pub fn annotate(gpa: Allocator, arena: Allocator, tree: Ast) Allocator.Error!RlNeededSet
Parameters
gpa: Allocator
arena: Allocator
tree: Ast
Source
pub fn annotate(gpa: Allocator, arena: Allocator, tree: Ast) Allocator.Error!RlNeededSet {
var astrl: AstRlAnnotate = .{
.gpa = gpa,
.arena = arena,
.tree = &tree,
};
defer astrl.deinit(gpa);
if (tree.errors.len != 0) {
// We can't perform analysis on a broken AST. AstGen will not run in
// this case.
return .{};
}
for (tree.containerDeclRoot().ast.members) |member_node| {
_ = try astrl.expr(member_node, null, ResultInfo.none);
}
return astrl.nodes_need_rl.move();
}