| ... | ... | @@ -32,6 +32,7 @@ |
| 32 | 32 | var typeKindPtrId; |
| 33 | 33 | var typeKindFloatId; |
| 34 | 34 | var typeKindIntId; |
| 35 | var typeKindBoolId; |
| 35 | 36 | findTypeKinds(); |
| 36 | 37 | |
| 37 | 38 | // for each package, is an array with packages to get to this one |
| ... | ... | @@ -214,7 +215,7 @@ |
| 214 | 215 | } |
| 215 | 216 | |
| 216 | 217 | var protoSrcNode = zigAnalysis.astNodes[protoSrcIndex]; |
| 217 | | if (docsSource == null && protoSrcNode.docs != null) { |
| 218 | if (docsSource == null && protoSrcNode != null && protoSrcNode.docs != null) { |
| 218 | 219 | docsSource = protoSrcNode.docs; |
| 219 | 220 | } |
| 220 | 221 | if (docsSource != null) { |
| ... | ... | @@ -422,6 +423,12 @@ |
| 422 | 423 | } else { |
| 423 | 424 | return "type"; |
| 424 | 425 | } |
| 426 | case typeKindBoolId: |
| 427 | if (wantHtml) { |
| 428 | return '<span class="tok-type">bool</span>'; |
| 429 | } else { |
| 430 | return "bool"; |
| 431 | } |
| 425 | 432 | default: |
| 426 | 433 | if (wantHtml) { |
| 427 | 434 | return escapeHtml(typeObj.name); |
| ... | ... | @@ -534,6 +541,8 @@ |
| 534 | 541 | typeKindFloatId = i; |
| 535 | 542 | } else if (zigAnalysis.typeKinds[i] === "Int") { |
| 536 | 543 | typeKindIntId = i; |
| 544 | } else if (zigAnalysis.typeKinds[i] === "Bool") { |
| 545 | typeKindBoolId = i; |
| 537 | 546 | } |
| 538 | 547 | } |
| 539 | 548 | if (typeKindTypeId == null) { |
| ... | ... | @@ -551,6 +560,9 @@ |
| 551 | 560 | if (typeKindIntId == null) { |
| 552 | 561 | throw new Error("No type kind 'Int' found"); |
| 553 | 562 | } |
| 563 | if (typeKindBoolId == null) { |
| 564 | throw new Error("No type kind 'Bool' found"); |
| 565 | } |
| 554 | 566 | } |
| 555 | 567 | |
| 556 | 568 | function findTypeTypeId() { |