diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 11:59:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-08 11:59:55 -0400 |
| commit | 03a6b33a73612500038635633d4c8326c2b5cf5f (patch) | |
| tree | b51835111802abbcd11f673499355d69b8653944 /lib/std | |
| parent | 6814d6b3321a8921ac714a4baf8952cc1864ed74 (diff) | |
| download | zig-03a6b33a73612500038635633d4c8326c2b5cf5f.tar.gz zig-03a6b33a73612500038635633d4c8326c2b5cf5f.zip | |
generated docs: bool type and fix error for some fns
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/special/docs/main.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index af790d342a..244fabad77 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 '<span class="tok-type">bool</span>'; + } 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() { |
