authorgravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-01-29 14:42:18+01:00
committergravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-01-29 14:42:18+01:00
log76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0
tree71a3389e67bc5c805492781068ca37284044c21b
parentf68d3c63df0486c7039732ef442c87fcd7c6fc57

autodoc: Implemented struct_init_empty for walkInstruction, fixed variable type with has_init but no type before =


1 files changed, 5 insertions(+), 11 deletions(-)

src/Autodoc.zig+5-11
...@@ -2200,17 +2200,10 @@ fn walkInstruction(...@@ -2200,17 +2200,10 @@ fn walkInstruction(
2200 false,2200 false,
2201 );2201 );
22022202
2203 _ = operand;2203 return DocData.WalkResult{
22042204 .typeRef = operand.expr,
2205 // WIP2205 .expr = .{ .@"struct" = &.{} },
22062206 };
2207 printWithContext(
2208 file,
2209 inst_index,
2210 "TODO: implement `{s}` for walkInstruction\n\n",
2211 .{@tagName(tags[inst_index])},
2212 );
2213 return self.cteTodo(@tagName(tags[inst_index]));
2214 },2207 },
2215 .struct_init_anon => {2208 .struct_init_anon => {
2216 const pl_node = data[inst_index].pl_node;2209 const pl_node = data[inst_index].pl_node;
...@@ -2537,6 +2530,7 @@ fn walkInstruction(...@@ -2537,6 +2530,7 @@ fn walkInstruction(
2537 const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]);2530 const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]);
2538 const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type);2531 const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type);
2539 value.expr = var_init.expr;2532 value.expr = var_init.expr;
2533 value.typeRef = var_init.typeRef;
2540 }2534 }
25412535
2542 return value;2536 return value;