pub fn annotate(gpa: Allocator, arena: Allocator, tree: Ast) Allocator.Error!RlNeededSet 64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83pub 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();
}