autodoc: implement typeof support in new rendering system

This commit is contained in:
Loris Cro
2023-07-29 19:06:39 +02:00
parent dc8a80a191
commit f5239677e2

View File

@@ -1203,6 +1203,20 @@ Happy writing!
yield Tok.r_paren;
return;
}
case "typeOf_peer": {
yield { src: "@TypeOf", tag: Tag.builtin };
yield { src: "(", tag: Tag.l_paren };
for (let i = 0; i < expr.typeOf_peer.length; i+=1) {
const elem = zigAnalysis.exprs[expr.typeOf_peer[i]];
yield* ex(elem, opts);
if (i != expr.typeOf_peer.length - 1) {
yield Tok.comma;
yield Tok.space;
}
}
yield { src: ")", tag: Tag.r_paren };
return;
}
case "sizeOf": {
const sizeOf = zigAnalysis.exprs[expr.sizeOf];
yield { src: "@sizeOf", tag: Tag.builtin };