From da28379d6cc7322eefb65b8ec93995e212e42e6e Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Thu, 7 Sep 2023 14:48:23 +0200 Subject: [PATCH] autodoc: Remove unnecessary Expr tag --- lib/docs/main.js | 7 +------ src/Autodoc.zig | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/docs/main.js b/lib/docs/main.js index c842684ee7..812350833f 100644 --- a/lib/docs/main.js +++ b/lib/docs/main.js @@ -1348,6 +1348,7 @@ Happy writing! yield { src: "false", tag: Tag.identifier }; return; } + case "&": { yield { src: "&", tag: Tag.ampersand }; yield* ex(zigAnalysis.exprs[expr["&"]], opts); @@ -1361,12 +1362,6 @@ Happy writing! return; } - case "ref": { - yield { src: "&", tag: Tag.ampersand }; - yield* ex(zigAnalysis.exprs[expr.ref], opts); - return; - } - case "call": { let call = zigAnalysis.calls[expr.call]; diff --git a/src/Autodoc.zig b/src/Autodoc.zig index a1552c3cd2..e4c42a1a83 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -797,7 +797,6 @@ const DocData = struct { binOp: BinOp, binOpIndex: usize, load: usize, // index in `exprs` - ref: usize, // index in `exprs` const BinOp = struct { lhs: usize, // index in `exprs` rhs: usize, // index in `exprs` @@ -1536,7 +1535,7 @@ fn walkInstruction( try self.exprs.append(self.arena, operand.expr); return DocData.WalkResult{ - .expr = .{ .ref = ref_idx }, + .expr = .{ .@"&" = ref_idx }, }; },