Commit ae4b5c29b2

Loris Cro <kappaloris@gmail.com>
2022-04-18 17:36:36
autodoc: fix final js type error
1 parent cc71003
Changed files (1)
lib
docs
lib/docs/main.js
@@ -268,7 +268,7 @@ var zigAnalysis;
     let domTableFnErrors =/** @type HTMLElement */(document.getElementById("tableFnErrors"));
     let domFnErrorsAnyError = /** @type HTMLElement */(document.getElementById("fnErrorsAnyError"));
     let domFnExamples = /** @type HTMLElement */(document.getElementById("fnExamples"));
-    let domListFnExamples = /** @type HTMLElement */(document.getElementById("listFnExamples"));
+    // let domListFnExamples = /** @type HTMLElement */(document.getElementById("listFnExamples"));
     let domFnNoExamples = /** @type HTMLElement */(document.getElementById("fnNoExamples"));
     let domDeclNoRef = /** @type HTMLElement */(document.getElementById("declNoRef"));
     let domSearch = /** @type HTMLInputElement */(document.getElementById("search"));
@@ -277,7 +277,7 @@ var zigAnalysis;
     let domListSearchResults = /** @type HTMLElement */(document.getElementById("listSearchResults"));
     let domSectSearchNoResults = /** @type HTMLElement */(document.getElementById("sectSearchNoResults"));
     let domSectInfo = /** @type HTMLElement */(document.getElementById("sectInfo"));
-    let domTdTarget = /** @type HTMLElement */(document.getElementById("tdTarget"));
+    // let domTdTarget = /** @type HTMLElement */(document.getElementById("tdTarget"));
     let domPrivDeclsBox = /** @type HTMLInputElement */(document.getElementById("privDeclsBox"));
     let domTdZigVer = /** @type HTMLElement */(document.getElementById("tdZigVer"));
     let domHdrName = /** @type HTMLElement */(document.getElementById("hdrName"));
@@ -447,21 +447,21 @@ var zigAnalysis;
         return typeKind === typeKinds.ErrorSet || typeKindIsContainer(typeKind);
     }
 
-    /**
-        * @param {WalkResult[]} path
-        * @return {WalkResult | null}
-    */
-    function findCteInRefPath(path) {
-        for (let i = path.length - 1; i >= 0; i -= 1) {
-            const ref = path[i];
-            if ("string" in ref) continue;
-            if ("comptimeExpr" in ref) return ref;
-            if ("refPath" in ref) return findCteInRefPath(ref.refPath);
-            return null;
-        }
+    // /**
+    //     * @param {WalkResult[]} path
+    //     * @return {WalkResult | null}
+    // */
+    // function findCteInRefPath(path) {
+    //     for (let i = path.length - 1; i >= 0; i -= 1) {
+    //         const ref = path[i];
+    //         if ("string" in ref) continue;
+    //         if ("comptimeExpr" in ref) return ref;
+    //         if ("refPath" in ref) return findCteInRefPath(ref.refPath);
+    //         return null;
+    //     }
 
-        return null;
-    }
+    //     return null;
+    // }
 
     /**
         * @param {WalkResult} value
@@ -960,22 +960,22 @@ var zigAnalysis;
         return navLink(curNav.pkgNames, curNav.declNames.concat([childName]));
     }
 
-    /** @param {Call} callObj */
-    function navLinkCall(callObj) {
-        let declNamesCopy = curNav.declNames.concat([]);
-        let callName = /** @type {string} */(declNamesCopy.pop());
+   //  /** @param {Call} callObj */
+   //  function navLinkCall(callObj) {
+   //      let declNamesCopy = curNav.declNames.concat([]);
+   //      let callName = /** @type {string} */(declNamesCopy.pop());
 
-        callName += '(';
-            for (let arg_i = 0; arg_i < callObj.args.length; arg_i += 1) {
-                if (arg_i !== 0) callName += ',';
-                let argObj = callObj.args[arg_i];
-                callName += getValueText(argObj, argObj, false, false);
-            }
-            callName += ')';
+   //      callName += '(';
+   //          for (let arg_i = 0; arg_i < callObj.args.length; arg_i += 1) {
+   //              if (arg_i !== 0) callName += ',';
+   //              let argObj = callObj.args[arg_i];
+   //              callName += getValueText(argObj, argObj, false, false);
+   //          }
+   //          callName += ')';
 
-        declNamesCopy.push(callName);
-        return navLink(curNav.pkgNames, declNamesCopy);
-    }
+   //      declNamesCopy.push(callName);
+   //      return navLink(curNav.pkgNames, declNamesCopy);
+   //  }
 
     /**
     * @param {any} dlDom
@@ -1135,35 +1135,35 @@ var zigAnalysis;
     //         return html;
     //     }
 
-    /**
-    * @param {WalkResult} typeRef
-    * @param {any} value
-    * @param {boolean} wantHtml
-    * @param {boolean} wantLink
-    */
-    function getValueText(typeRef, value, wantHtml, wantLink) {
-        let resolvedTypeRef = resolveValue(typeRef);
-        if ("comptimeExpr" in resolvedTypeRef) {
-            return "[ComptimeExpr]";
-        }
-        console.assert("type" in resolvedTypeRef);
-        let typeObj = zigAnalysis.types[typeRef.type];
-        switch (typeObj.kind) {
-            case typeKinds.Type:
-                return typeValueName(value, wantHtml, wantLink);
-            case typeKinds.Fn:
-                let fnObj = zigAnalysis.fns[value];
-                return typeName(fnObj, wantHtml, wantLink);
-            case typeKinds.Int:
-                if (wantHtml) {
-                    return '<span class="tok-number">' + value + '</span>';
-                } else {
-                    return value + "";
-                }
-            default:
-                console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]);
-        }
-    }
+   //  /**
+   //  * @param {WalkResult} typeRef
+   //  * @param {any} value
+   //  * @param {boolean} wantHtml
+   //  * @param {boolean} wantLink
+   //  */
+   //  function getValueText(typeRef, value, wantHtml, wantLink) {
+   //      let resolvedTypeRef = resolveValue(typeRef);
+   //      if ("comptimeExpr" in resolvedTypeRef) {
+   //          return "[ComptimeExpr]";
+   //      }
+   //      console.assert("type" in resolvedTypeRef);
+   //      let typeObj = zigAnalysis.types[typeRef.type];
+   //      switch (typeObj.kind) {
+   //          case typeKinds.Type:
+   //              return typeValueName(value, wantHtml, wantLink);
+   //          case typeKinds.Fn:
+   //              let fnObj = zigAnalysis.fns[value];
+   //              return typeName(fnObj, wantHtml, wantLink);
+   //          case typeKinds.Int:
+   //              if (wantHtml) {
+   //                  return '<span class="tok-number">' + value + '</span>';
+   //              } else {
+   //                  return value + "";
+   //              }
+   //          default:
+   //              console.trace("TODO implement getValueText for this type:", zigAnalysis.typeKinds[typeObj.kind]);
+   //      }
+   //  }
 
     /**
     * @param {Type} typeObj,