authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-08 11:59:55-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-08 11:59:55-04:00
log03a6b33a73612500038635633d4c8326c2b5cf5f
treeb51835111802abbcd11f673499355d69b8653944
parent6814d6b3321a8921ac714a4baf8952cc1864ed74
signaturelock-open Commit is signed but in an unrecognized format.

generated docs: bool type and fix error for some fns


2 files changed, 14 insertions(+), 1 deletions(-)

lib/std/special/docs/main.js+13-1
......@@ -32,6 +32,7 @@
3232 var typeKindPtrId;
3333 var typeKindFloatId;
3434 var typeKindIntId;
35 var typeKindBoolId;
3536 findTypeKinds();
3637
3738 // for each package, is an array with packages to get to this one
......@@ -214,7 +215,7 @@
214215 }
215216
216217 var protoSrcNode = zigAnalysis.astNodes[protoSrcIndex];
217 if (docsSource == null && protoSrcNode.docs != null) {
218 if (docsSource == null && protoSrcNode != null && protoSrcNode.docs != null) {
218219 docsSource = protoSrcNode.docs;
219220 }
220221 if (docsSource != null) {
......@@ -422,6 +423,12 @@
422423 } else {
423424 return "type";
424425 }
426 case typeKindBoolId:
427 if (wantHtml) {
428 return '<span class="tok-type">bool</span>';
429 } else {
430 return "bool";
431 }
425432 default:
426433 if (wantHtml) {
427434 return escapeHtml(typeObj.name);
......@@ -534,6 +541,8 @@
534541 typeKindFloatId = i;
535542 } else if (zigAnalysis.typeKinds[i] === "Int") {
536543 typeKindIntId = i;
544 } else if (zigAnalysis.typeKinds[i] === "Bool") {
545 typeKindBoolId = i;
537546 }
538547 }
539548 if (typeKindTypeId == null) {
......@@ -551,6 +560,9 @@
551560 if (typeKindIntId == null) {
552561 throw new Error("No type kind 'Int' found");
553562 }
563 if (typeKindBoolId == null) {
564 throw new Error("No type kind 'Bool' found");
565 }
554566 }
555567
556568 function findTypeTypeId() {
src/dump_analysis.cpp+1
......@@ -723,6 +723,7 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
723723
724724 switch (ty->id) {
725725 case ZigTypeIdMetaType:
726 case ZigTypeIdBool:
726727 break;
727728 case ZigTypeIdStruct: {
728729 if (ty->data.structure.is_slice) {