| ... | ... | @@ -268,7 +268,7 @@ var zigAnalysis; |
| 268 | 268 | let domTableFnErrors =/** @type HTMLElement */(document.getElementById("tableFnErrors")); |
| 269 | 269 | let domFnErrorsAnyError = /** @type HTMLElement */(document.getElementById("fnErrorsAnyError")); |
| 270 | 270 | let domFnExamples = /** @type HTMLElement */(document.getElementById("fnExamples")); |
| 271 | | let domListFnExamples = /** @type HTMLElement */(document.getElementById("listFnExamples")); |
| 271 | // let domListFnExamples = /** @type HTMLElement */(document.getElementById("listFnExamples")); |
| 272 | 272 | let domFnNoExamples = /** @type HTMLElement */(document.getElementById("fnNoExamples")); |
| 273 | 273 | let domDeclNoRef = /** @type HTMLElement */(document.getElementById("declNoRef")); |
| 274 | 274 | let domSearch = /** @type HTMLInputElement */(document.getElementById("search")); |
| ... | ... | @@ -277,7 +277,7 @@ var zigAnalysis; |
| 277 | 277 | let domListSearchResults = /** @type HTMLElement */(document.getElementById("listSearchResults")); |
| 278 | 278 | let domSectSearchNoResults = /** @type HTMLElement */(document.getElementById("sectSearchNoResults")); |
| 279 | 279 | let domSectInfo = /** @type HTMLElement */(document.getElementById("sectInfo")); |
| 280 | | let domTdTarget = /** @type HTMLElement */(document.getElementById("tdTarget")); |
| 280 | // let domTdTarget = /** @type HTMLElement */(document.getElementById("tdTarget")); |
| 281 | 281 | let domPrivDeclsBox = /** @type HTMLInputElement */(document.getElementById("privDeclsBox")); |
| 282 | 282 | let domTdZigVer = /** @type HTMLElement */(document.getElementById("tdZigVer")); |
| 283 | 283 | let domHdrName = /** @type HTMLElement */(document.getElementById("hdrName")); |
| ... | ... | @@ -447,21 +447,21 @@ var zigAnalysis; |
| 447 | 447 | return typeKind === typeKinds.ErrorSet || typeKindIsContainer(typeKind); |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | | /** |
| 451 | | * @param {WalkResult[]} path |
| 452 | | * @return {WalkResult | null} |
| 453 | | */ |
| 454 | | function findCteInRefPath(path) { |
| 455 | | for (let i = path.length - 1; i >= 0; i -= 1) { |
| 456 | | const ref = path[i]; |
| 457 | | if ("string" in ref) continue; |
| 458 | | if ("comptimeExpr" in ref) return ref; |
| 459 | | if ("refPath" in ref) return findCteInRefPath(ref.refPath); |
| 460 | | return null; |
| 461 | | } |
| 450 | // /** |
| 451 | // * @param {WalkResult[]} path |
| 452 | // * @return {WalkResult | null} |
| 453 | // */ |
| 454 | // function findCteInRefPath(path) { |
| 455 | // for (let i = path.length - 1; i >= 0; i -= 1) { |
| 456 | // const ref = path[i]; |
| 457 | // if ("string" in ref) continue; |
| 458 | // if ("comptimeExpr" in ref) return ref; |
| 459 | // if ("refPath" in ref) return findCteInRefPath(ref.refPath); |
| 460 | // return null; |
| 461 | // } |
| 462 | 462 | |
| 463 | | return null; |
| 464 | | } |
| 463 | // return null; |
| 464 | // } |
| 465 | 465 | |
| 466 | 466 | /** |
| 467 | 467 | * @param {WalkResult} value |
| ... | ... | @@ -960,22 +960,22 @@ var zigAnalysis; |
| 960 | 960 | return navLink(curNav.pkgNames, curNav.declNames.concat([childName])); |
| 961 | 961 | } |
| 962 | 962 | |
| 963 | | /** @param {Call} callObj */ |
| 964 | | function navLinkCall(callObj) { |
| 965 | | let declNamesCopy = curNav.declNames.concat([]); |
| 966 | | let callName = /** @type {string} */(declNamesCopy.pop()); |
| 963 | // /** @param {Call} callObj */ |
| 964 | // function navLinkCall(callObj) { |
| 965 | // let declNamesCopy = curNav.declNames.concat([]); |
| 966 | // let callName = /** @type {string} */(declNamesCopy.pop()); |
| 967 | 967 | |
| 968 | | callName += '('; |
| 969 | | for (let arg_i = 0; arg_i < callObj.args.length; arg_i += 1) { |
| 970 | | if (arg_i !== 0) callName += ','; |
| 971 | | let argObj = callObj.args[arg_i]; |
| 972 | | callName += getValueText(argObj, argObj, false, false); |
| 973 | | } |
| 974 | | callName += ')'; |
| 968 | // callName += '('; |
| 969 | // for (let arg_i = 0; arg_i < callObj.args.length; arg_i += 1) { |
| 970 | // if (arg_i !== 0) callName += ','; |
| 971 | // let argObj = callObj.args[arg_i]; |
| 972 | // callName += getValueText(argObj, argObj, false, false); |
| 973 | // } |
| 974 | // callName += ')'; |
| 975 | 975 | |
| 976 | | declNamesCopy.push(callName); |
| 977 | | return navLink(curNav.pkgNames, declNamesCopy); |
| 978 | | } |
| 976 | // declNamesCopy.push(callName); |
| 977 | // return navLink(curNav.pkgNames, declNamesCopy); |
| 978 | // } |
| 979 | 979 | |
| 980 | 980 | /** |
| 981 | 981 | * @param {any} dlDom |
| ... | ... | @@ -1135,35 +1135,35 @@ var zigAnalysis; |
| 1135 | 1135 | // return html; |
| 1136 | 1136 | // } |
| 1137 | 1137 | |
| 1138 | | /** |
| 1139 | | * @param {WalkResult} typeRef |
| 1140 | | * @param {any} value |
| 1141 | | * @param {boolean} wantHtml |
| 1142 | | * @param {boolean} wantLink |
| 1143 | | */ |
| 1144 | | function getValueText(typeRef, value, wantHtml, wantLink) { |
| 1145 | | let resolvedTypeRef = resolveValue(typeRef); |
| 1146 | | if ("comptimeExpr" in resolvedTypeRef) { |
| 1147 | | return "[ComptimeExpr]"; |
| 1148 | | } |
| 1149 | | console.assert("type" in resolvedTypeRef); |
| 1150 | | let typeObj = zigAnalysis.types[typeRef.type]; |
| 1151 | | switch (typeObj.kind) { |
| 1152 | | case typeKinds.Type: |
| 1153 | | return typeValueName(value, wantHtml, wantLink); |
| 1154 | | case typeKinds.Fn: |
| 1155 | | let fnObj = zigAnalysis.fns[value]; |
| 1156 | | return typeName(fnObj, wantHtml, wantLink); |
| 1157 | | case typeKinds.Int: |
| 1158 | | if (wantHtml) { |
| 1159 | | return '<span class="tok-number">' + value + '</span>'; |
| 1160 | | } else { |
| 1161 | | return value + ""; |
| 1162 | | } |
| 1163 | | default: |
| 1164 | | console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]); |
| 1165 | | } |
| 1166 | | } |
| 1138 | // /** |
| 1139 | // * @param {WalkResult} typeRef |
| 1140 | // * @param {any} value |
| 1141 | // * @param {boolean} wantHtml |
| 1142 | // * @param {boolean} wantLink |
| 1143 | // */ |
| 1144 | // function getValueText(typeRef, value, wantHtml, wantLink) { |
| 1145 | // let resolvedTypeRef = resolveValue(typeRef); |
| 1146 | // if ("comptimeExpr" in resolvedTypeRef) { |
| 1147 | // return "[ComptimeExpr]"; |
| 1148 | // } |
| 1149 | // console.assert("type" in resolvedTypeRef); |
| 1150 | // let typeObj = zigAnalysis.types[typeRef.type]; |
| 1151 | // switch (typeObj.kind) { |
| 1152 | // case typeKinds.Type: |
| 1153 | // return typeValueName(value, wantHtml, wantLink); |
| 1154 | // case typeKinds.Fn: |
| 1155 | // let fnObj = zigAnalysis.fns[value]; |
| 1156 | // return typeName(fnObj, wantHtml, wantLink); |
| 1157 | // case typeKinds.Int: |
| 1158 | // if (wantHtml) { |
| 1159 | // return '<span class="tok-number">' + value + '</span>'; |
| 1160 | // } else { |
| 1161 | // return value + ""; |
| 1162 | // } |
| 1163 | // default: |
| 1164 | // console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]); |
| 1165 | // } |
| 1166 | // } |
| 1167 | 1167 | |
| 1168 | 1168 | /** |
| 1169 | 1169 | * @param {Type} typeObj, |