zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0 (tree)
parent f68d3c63df0486c7039732ef442c87fcd7c6fc57
Author: Krzysztof Wolicki Der Teufel <der.teufel.mail@gmail.com>
Date:   Sun, 29 Jan 2023 14:42:18 +0100

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

Diffstat:
Msrc/Autodoc.zig | 16+++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/Autodoc.zig b/src/Autodoc.zig @@ -2200,17 +2200,10 @@ fn walkInstruction( false, ); - _ = operand; - - // WIP - - printWithContext( - file, - inst_index, - "TODO: implement `{s}` for walkInstruction\n\n", - .{@tagName(tags[inst_index])}, - ); - return self.cteTodo(@tagName(tags[inst_index])); + return DocData.WalkResult{ + .typeRef = operand.expr, + .expr = .{ .@"struct" = &.{} }, + }; }, .struct_init_anon => { const pl_node = data[inst_index].pl_node; @@ -2537,6 +2530,7 @@ fn walkInstruction( const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]); const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type); value.expr = var_init.expr; + value.typeRef = var_init.typeRef; } return value;