mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 08:33:06 +00:00
autodoc: fix autodoc analysis for @typeInfo
We were previously erroneously saving it as a `@TypeOf`.
This commit is contained in:
parent
622714b76b
commit
c5afefec42
@ -1403,6 +1403,11 @@ var zigAnalysis;
|
||||
let payloadHtml = "@TypeOf(" + exprName(typeRefArg, {wantHtml: true, wantLink:true}) + ")";
|
||||
return payloadHtml;
|
||||
}
|
||||
case "typeInfo": {
|
||||
const typeRefArg = zigAnalysis.exprs[expr.typeInfo];
|
||||
let payloadHtml = "@typeInfo(" + exprName(typeRefArg, {wantHtml: true, wantLink:true}) + ")";
|
||||
return payloadHtml;
|
||||
}
|
||||
case "null": {
|
||||
return "null";
|
||||
}
|
||||
|
@ -580,6 +580,7 @@ const DocData = struct {
|
||||
enumLiteral: []const u8, // direct value
|
||||
alignOf: usize, // index in `exprs`
|
||||
typeOf: usize, // index in `exprs`
|
||||
typeInfo: usize, // index in `exprs`
|
||||
typeOf_peer: []usize,
|
||||
errorUnion: usize, // index in `exprs`
|
||||
as: As,
|
||||
@ -1788,7 +1789,7 @@ fn walkInstruction(
|
||||
|
||||
return DocData.WalkResult{
|
||||
.typeRef = operand.typeRef,
|
||||
.expr = .{ .typeOf = operand_index },
|
||||
.expr = .{ .typeInfo = operand_index },
|
||||
};
|
||||
},
|
||||
.as_node => {
|
||||
|
Loading…
Reference in New Issue
Block a user