aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKrzysztof Wolicki Der Teufel <der.teufel.mail@gmail.com>2023-03-07 00:22:48 +0100
committerKrzysztof Wolicki Der Teufel <der.teufel.mail@gmail.com>2023-03-07 00:32:26 +0100
commit27d2848e0096d31cb42cb258a89ed276ec26434e (patch)
treee338146e8097edfeecff5f2a42ccbdd5c16e9ae8 /src
parent6218e4004608000ba2e42e07ed1bd56745626820 (diff)
downloadzig-27d2848e0096d31cb42cb258a89ed276ec26434e.tar.gz
zig-27d2848e0096d31cb42cb258a89ed276ec26434e.zip
autodoc: Add struct to tryResolveRefPath
fix rendering of fieldRef in exprName
Diffstat (limited to 'src')
-rw-r--r--src/Autodoc.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Autodoc.zig b/src/Autodoc.zig
index 15d90b104b..47b0c8d3c2 100644
--- a/src/Autodoc.zig
+++ b/src/Autodoc.zig
@@ -3616,6 +3616,25 @@ fn tryResolveRefPath(
continue :outer;
},
},
+ .@"struct" => |st| {
+ for (st) |field| {
+ if (std.mem.eql(u8, field.name, child_string)) {
+ path[i + 1] = field.val.expr;
+ continue :outer;
+ }
+ }
+
+ // if we got here, our search failed
+ printWithContext(
+ file,
+ inst_index,
+ "failed to match `{s}` in struct",
+ .{child_string},
+ );
+
+ path[i + 1] = (try self.cteTodo("match failure")).expr;
+ continue :outer;
+ },
}
}