diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index af790d342ae2b9bfc1a98739c0f55c1771d24e1b..244fabad77d1e62d45d4451f5f7a0748060128e5 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -32,6 +32,7 @@ var typeKindPtrId; var typeKindFloatId; var typeKindIntId; + var typeKindBoolId; findTypeKinds(); // for each package, is an array with packages to get to this one @@ -214,7 +215,7 @@ } var protoSrcNode = zigAnalysis.astNodes[protoSrcIndex]; - if (docsSource == null && protoSrcNode.docs != null) { + if (docsSource == null && protoSrcNode != null && protoSrcNode.docs != null) { docsSource = protoSrcNode.docs; } if (docsSource != null) { @@ -422,6 +423,12 @@ } else { return "type"; } + case typeKindBoolId: + if (wantHtml) { + return 'bool'; + } else { + return "bool"; + } default: if (wantHtml) { return escapeHtml(typeObj.name); @@ -534,6 +541,8 @@ typeKindFloatId = i; } else if (zigAnalysis.typeKinds[i] === "Int") { typeKindIntId = i; + } else if (zigAnalysis.typeKinds[i] === "Bool") { + typeKindBoolId = i; } } if (typeKindTypeId == null) { @@ -551,6 +560,9 @@ if (typeKindIntId == null) { throw new Error("No type kind 'Int' found"); } + if (typeKindBoolId == null) { + throw new Error("No type kind 'Bool' found"); + } } function findTypeTypeId() { diff --git a/src/dump_analysis.cpp b/src/dump_analysis.cpp index 30d91b4d32423c4c34acd6135d778ee191f3f95a..7caba132d023cb6f2b6b5817d2f8ef0f664a271c 100644 --- a/src/dump_analysis.cpp +++ b/src/dump_analysis.cpp @@ -723,6 +723,7 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) { switch (ty->id) { case ZigTypeIdMetaType: + case ZigTypeIdBool: break; case ZigTypeIdStruct: { if (ty->data.structure.is_slice) {