authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-10-30 17:16:24+01:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2022-10-30 17:17:34+01:00
logd4487b6a2e790ee3f479f451a4c0ee0eb39d159e
treee0fa641bf5231861b67cc13812019e618c82e7f2
parent2b25d3c33394edcf8760ed49495c162aac80f59b

autodoc: update to new func zir body structure

this is a hack meant to restore functionality for the upcoming release, a proper analysis of the new zir structure is required to make a robust change.

2 files changed, 9 insertions(+), 1 deletions(-)

lib/docs/main.js+2
......@@ -449,6 +449,8 @@ var zigAnalysis;
449449 currentType = childDecl;
450450 curNav.declObjs.push(currentType);
451451 }
452
453 window.x = currentType;
452454
453455 renderNav();
454456
src/Autodoc.zig+7-1
......@@ -950,6 +950,12 @@ fn walkInstruction(
950950 need_type,
951951 );
952952 },
953 .ret_type => {
954 return DocData.WalkResult{
955 .typeRef = .{ .type = @enumToInt(Ref.type_type) },
956 .expr = .{ .type = @enumToInt(Ref.type_type) },
957 };
958 },
953959 .ret_node => {
954960 const un_node = data[inst_index].un_node;
955961 return self.walkRef(file, parent_scope, parent_src, un_node.operand, false);
......@@ -3987,7 +3993,7 @@ fn getGenericReturnType(
39873993 body_end: usize,
39883994) !DocData.Expr {
39893995 // TODO: compute the correct line offset
3990 const wr = try self.walkInstruction(file, scope, parent_src, body_end, false);
3996 const wr = try self.walkInstruction(file, scope, parent_src, body_end - 3, false);
39913997 return wr.expr;
39923998}
39933999