autodoc: update array analysis to new Zir

This commit is contained in:
Loris Cro
2022-06-10 19:00:40 +02:00
committed by Andrew Kelley
parent 866bbb2e7a
commit 24a79426ec
2 changed files with 131 additions and 246 deletions

View File

@@ -816,6 +816,9 @@ var zigAnalysis;
function exprName(expr, opts) {
switch (Object.keys(expr)[0]) {
default: throw "oh no";
case "&": {
return "&" + exprName(zigAnalysis.exprs[expr["&"]]);
}
case "enumLiteral": {
let literal = expr.enumLiteral;
return literal;
@@ -1482,7 +1485,7 @@ var zigAnalysis;
}
case typeKinds.Array:
{
let arrayObj = (typeObj);
let arrayObj = typeObj;
let name = "[";
let lenName = exprName(arrayObj.len, opts);
let sentinel = arrayObj.sentinel ? ":"+exprName(arrayObj.sentinel, opts) : "";