Skip to content

Commit

Permalink
autodoc: fix analysis of closure_get instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoff-it committed Feb 14, 2024
1 parent 3f55932 commit a23ab33
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Autodoc.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1153,14 +1153,15 @@ fn walkInstruction(
},
.closure_get => {
const inst_node = data[@intFromEnum(inst)].inst_node;
return try self.walkInstruction(
file,
parent_scope,
parent_src,
inst_node.inst,
need_type,
call_ctx,
);

const code = try self.getBlockSource(file, parent_src, inst_node.src_node);
const idx = self.comptime_exprs.items.len;
try self.exprs.append(self.arena, .{ .comptimeExpr = idx });
try self.comptime_exprs.append(self.arena, .{ .code = code });

return DocData.WalkResult{
.expr = .{ .comptimeExpr = idx },
};
},
.closure_capture => {
const un_tok = data[@intFromEnum(inst)].un_tok;
Expand Down

0 comments on commit a23ab33

Please sign in to comment.