mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
1729 lines
54 KiB
JavaScript
1729 lines
54 KiB
JavaScript
/* Generated by the Nim Compiler v2.3.1 */
|
|
var framePtr = null;
|
|
var excHandler = 0;
|
|
var lastJSError = null;
|
|
var NTI33554466 = {size: 0,kind: 1,base: null,node: null,finalizer: null};
|
|
var NTI721420302 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
|
|
var NTI33554435 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
|
|
var NTI956301392 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
|
|
var NTI956301399 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
|
|
var NTI251658263 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI251658253 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI251658255 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI251658257 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555157 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555165 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
|
|
var NTI33554450 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
|
|
var NTI33555164 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
|
|
var NTI33555161 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555162 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI251658261 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33554449 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
|
|
var NNI251658261 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI251658261.node = NNI251658261;
|
|
var NNI33555162 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI33555162.node = NNI33555162;
|
|
NTI33555164.base = NTI33555161;
|
|
NTI33555165.base = NTI33555161;
|
|
var NNI33555161 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI33555164, name: "parent", sons: null},
|
|
{kind: 1, offset: "name", len: 0, typ: NTI33554450, name: "name", sons: null},
|
|
{kind: 1, offset: "message", len: 0, typ: NTI33554449, name: "msg", sons: null},
|
|
{kind: 1, offset: "trace", len: 0, typ: NTI33554449, name: "trace", sons: null},
|
|
{kind: 1, offset: "up", len: 0, typ: NTI33555165, name: "up", sons: null}]};
|
|
NTI33555161.node = NNI33555161;
|
|
var NNI33555157 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI33555157.node = NNI33555157;
|
|
NTI33555161.base = NTI33555157;
|
|
NTI33555162.base = NTI33555161;
|
|
NTI251658261.base = NTI33555162;
|
|
var NNI251658257 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI251658257.node = NNI251658257;
|
|
NTI251658257.base = NTI33555162;
|
|
var NNI251658255 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI251658255.node = NNI251658255;
|
|
var NNI251658253 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI251658253.node = NNI251658253;
|
|
NTI251658253.base = NTI33555162;
|
|
NTI251658255.base = NTI251658253;
|
|
var NNI251658263 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI251658263.node = NNI251658263;
|
|
NTI251658263.base = NTI33555162;
|
|
var NNI956301399 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "a", len: 0, typ: NTI956301392, name: "a", sons: null},
|
|
{kind: 1, offset: "b", len: 0, typ: NTI33554435, name: "b", sons: null}]};
|
|
NTI956301399.node = NNI956301399;
|
|
var NNI721420302 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI33554435, name: "Field0", sons: null},
|
|
{kind: 1, offset: "Field1", len: 0, typ: NTI33554466, name: "Field1", sons: null}]};
|
|
NTI721420302.node = NNI721420302;
|
|
|
|
function setConstr() {
|
|
var result = {};
|
|
for (var i = 0; i < arguments.length; ++i) {
|
|
var x = arguments[i];
|
|
if (typeof(x) == "object") {
|
|
for (var j = x[0]; j <= x[1]; ++j) {
|
|
result[j] = true;
|
|
}
|
|
} else {
|
|
result[x] = true;
|
|
}
|
|
}
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21);
|
|
|
|
function nimCopy(dest_p0, src_p1, ti_p2) {
|
|
var result_33557339 = null;
|
|
|
|
switch (ti_p2.kind) {
|
|
case 21:
|
|
case 22:
|
|
case 23:
|
|
case 5:
|
|
if (!(isFatPointer__system_u2887(ti_p2))) {
|
|
result_33557339 = src_p1;
|
|
}
|
|
else {
|
|
result_33557339 = [src_p1[0], src_p1[1]];
|
|
}
|
|
|
|
break;
|
|
case 19:
|
|
if (dest_p0 === null || dest_p0 === undefined) {
|
|
dest_p0 = {};
|
|
}
|
|
else {
|
|
for (var key in dest_p0) { delete dest_p0[key]; }
|
|
}
|
|
for (var key in src_p1) { dest_p0[key] = src_p1[key]; }
|
|
result_33557339 = dest_p0;
|
|
|
|
break;
|
|
case 18:
|
|
case 17:
|
|
if (!((ti_p2.base == null))) {
|
|
result_33557339 = nimCopy(dest_p0, src_p1, ti_p2.base);
|
|
}
|
|
else {
|
|
if ((ti_p2.kind == 17)) {
|
|
result_33557339 = (dest_p0 === null || dest_p0 === undefined) ? {m_type: ti_p2} : dest_p0;
|
|
}
|
|
else {
|
|
result_33557339 = (dest_p0 === null || dest_p0 === undefined) ? {} : dest_p0;
|
|
}
|
|
}
|
|
nimCopyAux(result_33557339, src_p1, ti_p2.node);
|
|
break;
|
|
case 4:
|
|
case 16:
|
|
if(ArrayBuffer.isView(src_p1)) {
|
|
if(dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
|
|
dest_p0 = new src_p1.constructor(src_p1);
|
|
} else {
|
|
dest_p0.set(src_p1, 0);
|
|
}
|
|
result_33557339 = dest_p0;
|
|
} else {
|
|
if (src_p1 === null) {
|
|
result_33557339 = null;
|
|
}
|
|
else {
|
|
if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
|
|
dest_p0 = new Array(src_p1.length);
|
|
}
|
|
result_33557339 = dest_p0;
|
|
for (var i = 0; i < src_p1.length; ++i) {
|
|
result_33557339[i] = nimCopy(result_33557339[i], src_p1[i], ti_p2.base);
|
|
}
|
|
}
|
|
}
|
|
|
|
break;
|
|
case 24:
|
|
case 27:
|
|
if (src_p1 === null) {
|
|
result_33557339 = null;
|
|
}
|
|
else {
|
|
if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
|
|
dest_p0 = new Array(src_p1.length);
|
|
}
|
|
result_33557339 = dest_p0;
|
|
for (var i = 0; i < src_p1.length; ++i) {
|
|
result_33557339[i] = nimCopy(result_33557339[i], src_p1[i], ti_p2.base);
|
|
}
|
|
}
|
|
|
|
break;
|
|
case 28:
|
|
if (src_p1 !== null) {
|
|
result_33557339 = src_p1.slice(0);
|
|
}
|
|
|
|
break;
|
|
default:
|
|
result_33557339 = src_p1;
|
|
break;
|
|
}
|
|
|
|
return result_33557339;
|
|
|
|
}
|
|
|
|
function mnewString(len_p0) {
|
|
var result = new Array(len_p0);
|
|
for (var i = 0; i < len_p0; i++) {result[i] = 0;}
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function nimAddStrStr(x_p0, y_p1) {
|
|
var L = y_p1.length;
|
|
for (var i = 0; i < L; ++i) {
|
|
x_p0.push(y_p1[i]);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function isObj(obj_p0, subclass_p1) {
|
|
var result_33557452 = false;
|
|
|
|
BeforeRet: {
|
|
var x_33557453 = obj_p0;
|
|
if ((x_33557453 == subclass_p1)) {
|
|
result_33557452 = true;
|
|
break BeforeRet;
|
|
}
|
|
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!!((x_33557453 == subclass_p1))) break Label2;
|
|
if ((x_33557453 == null)) {
|
|
result_33557452 = false;
|
|
break BeforeRet;
|
|
}
|
|
|
|
x_33557453 = x_33557453.base;
|
|
}
|
|
};
|
|
result_33557452 = true;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557452;
|
|
|
|
}
|
|
|
|
function toJSStr(s_p0) {
|
|
var result_33556928 = null;
|
|
|
|
var res_33556982 = newSeq__system_u2525((s_p0).length);
|
|
var i_33556983 = 0;
|
|
var j_33556984 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!(i_33556983 < (s_p0).length)) break Label2;
|
|
var c_33556985 = s_p0[i_33556983];
|
|
if ((c_33556985 < 128)) {
|
|
res_33556982[j_33556984] = String.fromCharCode(c_33556985);
|
|
i_33556983 += 1;
|
|
}
|
|
else {
|
|
var helper_33557011 = newSeq__system_u2525(0);
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!true) break Label4;
|
|
var code_33557012 = c_33556985.toString(16);
|
|
if ((((code_33557012) == null ? 0 : (code_33557012).length) == 1)) {
|
|
helper_33557011.push("%0");;
|
|
}
|
|
else {
|
|
helper_33557011.push("%");;
|
|
}
|
|
|
|
helper_33557011.push(code_33557012);;
|
|
i_33556983 += 1;
|
|
if ((((s_p0).length <= i_33556983) || (s_p0[i_33556983] < 128))) {
|
|
break Label3;
|
|
}
|
|
|
|
c_33556985 = s_p0[i_33556983];
|
|
}
|
|
};
|
|
++excHandler;
|
|
try {
|
|
res_33556982[j_33556984] = decodeURIComponent(helper_33557011.join(""));
|
|
--excHandler;
|
|
} catch (EXCEPTION) {
|
|
var prevJSError = lastJSError;
|
|
lastJSError = EXCEPTION;
|
|
--excHandler;
|
|
raiseDefect();
|
|
res_33556982[j_33556984] = helper_33557011.join("");
|
|
lastJSError = prevJSError;
|
|
} finally {
|
|
}
|
|
}
|
|
|
|
j_33556984 += 1;
|
|
}
|
|
};
|
|
if (res_33556982.length < j_33556984) { for (var i = res_33556982.length ; i < j_33556984 ; ++i) res_33556982.push(null); }
|
|
else { res_33556982.length = j_33556984; };
|
|
result_33556928 = res_33556982.join("");
|
|
|
|
return result_33556928;
|
|
|
|
}
|
|
|
|
function raiseException(e_p0, ename_p1) {
|
|
e_p0.name = ename_p1;
|
|
if ((excHandler == 0)) {
|
|
unhandledException(e_p0);
|
|
}
|
|
|
|
throw e_p0;
|
|
|
|
|
|
}
|
|
|
|
function chckIndx(i_p0, a_p1, b_p2) {
|
|
var result_33557374 = 0;
|
|
|
|
BeforeRet: {
|
|
if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
|
|
result_33557374 = i_p0;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
raiseIndexError(i_p0, a_p1, b_p2);
|
|
}
|
|
|
|
};
|
|
|
|
return result_33557374;
|
|
|
|
}
|
|
|
|
function makeNimstrLit(c_p0) {
|
|
var result = [];
|
|
for (var i = 0; i < c_p0.length; ++i) {
|
|
result[i] = c_p0.charCodeAt(i);
|
|
}
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function addInt(a_p0, b_p1) {
|
|
var result = a_p0 + b_p1;
|
|
checkOverflowInt(result);
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function subInt(a_p0, b_p1) {
|
|
var result = a_p0 - b_p1;
|
|
checkOverflowInt(result);
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function chckRange(i_p0, a_p1, b_p2) {
|
|
var result_33557379 = 0;
|
|
|
|
BeforeRet: {
|
|
if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
|
|
result_33557379 = i_p0;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
raiseRangeError();
|
|
}
|
|
|
|
};
|
|
|
|
return result_33557379;
|
|
|
|
}
|
|
|
|
function cstrToNimstr(c_p0) {
|
|
var ln = c_p0.length;
|
|
var result = new Array(ln);
|
|
var r = 0;
|
|
for (var i = 0; i < ln; ++i) {
|
|
var ch = c_p0.charCodeAt(i);
|
|
|
|
if (ch < 128) {
|
|
result[r] = ch;
|
|
}
|
|
else {
|
|
if (ch < 2048) {
|
|
result[r] = (ch >> 6) | 192;
|
|
}
|
|
else {
|
|
if (ch < 55296 || ch >= 57344) {
|
|
result[r] = (ch >> 12) | 224;
|
|
}
|
|
else {
|
|
++i;
|
|
ch = 65536 + (((ch & 1023) << 10) | (c_p0.charCodeAt(i) & 1023));
|
|
result[r] = (ch >> 18) | 240;
|
|
++r;
|
|
result[r] = ((ch >> 12) & 63) | 128;
|
|
}
|
|
++r;
|
|
result[r] = ((ch >> 6) & 63) | 128;
|
|
}
|
|
++r;
|
|
result[r] = (ch & 63) | 128;
|
|
}
|
|
++r;
|
|
}
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
var ConstSet2 = setConstr([65, 90]);
|
|
var ConstSet3 = setConstr(95, 32, 46);
|
|
var ConstSet4 = setConstr(95, 32, 46);
|
|
|
|
function mulInt(a_p0, b_p1) {
|
|
var result = a_p0 * b_p1;
|
|
checkOverflowInt(result);
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
var ConstSet5 = setConstr([97, 122]);
|
|
var ConstSet6 = setConstr([65, 90], [97, 122]);
|
|
var ConstSet7 = setConstr([97, 122]);
|
|
var ConstSet8 = setConstr([65, 90]);
|
|
var ConstSet9 = setConstr([65, 90], [97, 122]);
|
|
|
|
function nimMax(a_p0, b_p1) {
|
|
var Temporary1;
|
|
|
|
var result_33557166 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((b_p1 <= a_p0)) {
|
|
Temporary1 = a_p0;
|
|
}
|
|
else {
|
|
Temporary1 = b_p1;
|
|
}
|
|
|
|
result_33557166 = Temporary1;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557166;
|
|
|
|
}
|
|
|
|
function nimMin(a_p0, b_p1) {
|
|
var Temporary1;
|
|
|
|
var result_33557162 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((a_p0 <= b_p1)) {
|
|
Temporary1 = a_p0;
|
|
}
|
|
else {
|
|
Temporary1 = b_p1;
|
|
}
|
|
|
|
result_33557162 = Temporary1;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557162;
|
|
|
|
}
|
|
|
|
function addChar(x_p0, c_p1) {
|
|
x_p0.push(c_p1);
|
|
|
|
|
|
}
|
|
var objectID_1174405298 = [0];
|
|
|
|
function setTheme(theme_p0) {
|
|
document.documentElement.setAttribute("data-theme", theme_p0);
|
|
window.localStorage.setItem("theme", theme_p0);
|
|
|
|
|
|
}
|
|
|
|
function isFatPointer__system_u2887(ti_p0) {
|
|
var result_33557321 = false;
|
|
|
|
BeforeRet: {
|
|
result_33557321 = !((ConstSet1[ti_p0.base.kind] != undefined));
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557321;
|
|
|
|
}
|
|
|
|
function nimCopyAux(dest_p0, src_p1, n_p2) {
|
|
switch (n_p2.kind) {
|
|
case 0:
|
|
break;
|
|
case 1:
|
|
dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
|
|
|
|
break;
|
|
case 2:
|
|
for (var i = 0; i < n_p2.sons.length; i++) {
|
|
nimCopyAux(dest_p0, src_p1, n_p2.sons[i]);
|
|
}
|
|
|
|
break;
|
|
case 3:
|
|
dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
|
|
for (var i = 0; i < n_p2.sons.length; ++i) {
|
|
nimCopyAux(dest_p0, src_p1, n_p2.sons[i][1]);
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, start_p2, n_p3) {
|
|
var Temporary1;
|
|
|
|
var old_335544528 = (result_p0[result_p0_Idx]).length;
|
|
if (result_p0[result_p0_Idx].length < (Temporary1 = (old_335544528 + n_p3), Temporary1)) { for (var i = result_p0[result_p0_Idx].length; i < Temporary1; ++i) result_p0[result_p0_Idx].push(0); }
|
|
else {result_p0[result_p0_Idx].length = Temporary1; };
|
|
Label2: {
|
|
var iHEX60gensym4_335544542 = 0;
|
|
var i_570426583 = 0;
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(i_570426583 < n_p3)) break Label4;
|
|
iHEX60gensym4_335544542 = i_570426583;
|
|
result_p0[result_p0_Idx][(old_335544528 + iHEX60gensym4_335544542)] = x_p1.charCodeAt((start_p2 + iHEX60gensym4_335544542));
|
|
i_570426583 += 1;
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, x_p1) {
|
|
addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, 0, ((x_p1) == null ? 0 : (x_p1).length));
|
|
|
|
|
|
}
|
|
|
|
function addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, x_p1) {
|
|
addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, ((x_p1) + ""));
|
|
|
|
|
|
}
|
|
|
|
function addInt__stdZprivateZdigitsutils_u241(result_p0, result_p0_Idx, x_p1) {
|
|
addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, BigInt(x_p1));
|
|
|
|
|
|
}
|
|
|
|
function HEX24__systemZdollars_u14(xHEX60gensym0_p0) {
|
|
var result_402653200 = [[]];
|
|
|
|
result_402653200[0] = nimCopy(null, [], NTI33554449);
|
|
addInt__stdZprivateZdigitsutils_u241(result_402653200, 0, xHEX60gensym0_p0);
|
|
|
|
return result_402653200[0];
|
|
|
|
}
|
|
|
|
function add__system_u1954(x_p0, x_p0_Idx, y_p1) {
|
|
if (x_p0[x_p0_Idx] === null) { x_p0[x_p0_Idx] = []; }
|
|
var off = x_p0[x_p0_Idx].length;
|
|
x_p0[x_p0_Idx].length += y_p1.length;
|
|
for (var i = 0; i < y_p1.length; ++i) {
|
|
x_p0[x_p0_Idx][off+i] = y_p1.charCodeAt(i);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function newSeq__system_u2525(len_p0) {
|
|
var result_33556961 = [];
|
|
|
|
result_33556961 = new Array(len_p0); for (var i = 0 ; i < len_p0 ; ++i) { result_33556961[i] = null; }
|
|
return result_33556961;
|
|
|
|
}
|
|
|
|
function isNimException__system_u2025() {
|
|
return lastJSError && lastJSError.m_type;
|
|
|
|
|
|
}
|
|
|
|
function getCurrentException() {
|
|
var result_33556460 = null;
|
|
|
|
if (isNimException__system_u2025()) {
|
|
result_33556460 = lastJSError;
|
|
}
|
|
|
|
|
|
return result_33556460;
|
|
|
|
}
|
|
|
|
function raiseDefect() {
|
|
if (isNimException__system_u2025()) {
|
|
var e_33556673 = getCurrentException();
|
|
if (isObj(e_33556673.m_type, NTI33555162)) {
|
|
if ((excHandler == 0)) {
|
|
unhandledException(e_33556673);
|
|
}
|
|
|
|
throw e_33556673;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function unhandledException(e_p0) {
|
|
var buf_33556667 = [[]];
|
|
if (!(((e_p0.message).length == 0))) {
|
|
nimAddStrStr(buf_33556667[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110,58,32]);;
|
|
nimAddStrStr(buf_33556667[0], e_p0.message);;
|
|
}
|
|
else {
|
|
nimAddStrStr(buf_33556667[0], [69,114,114,111,114,58,32,117,110,104,97,110,100,108,101,100,32,101,120,99,101,112,116,105,111,110]);;
|
|
}
|
|
|
|
nimAddStrStr(buf_33556667[0], [32,91]);;
|
|
add__system_u1954(buf_33556667, 0, e_p0.name);
|
|
nimAddStrStr(buf_33556667[0], [93,10]);;
|
|
var cbuf_33556668 = toJSStr(buf_33556667[0]);
|
|
if (typeof(Error) !== "undefined") {
|
|
throw new Error(cbuf_33556668);
|
|
}
|
|
else {
|
|
throw cbuf_33556668;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function raiseIndexError(i_p0, a_p1, b_p2) {
|
|
var Temporary1;
|
|
|
|
if ((b_p2 < a_p1)) {
|
|
Temporary1 = [105,110,100,101,120,32,111,117,116,32,111,102,32,98,111,117,110,100,115,44,32,116,104,101,32,99,111,110,116,97,105,110,101,114,32,105,115,32,101,109,112,116,121];
|
|
}
|
|
else {
|
|
Temporary1 = ([105,110,100,101,120,32]).concat(HEX24__systemZdollars_u14(i_p0),[32,110,111,116,32,105,110,32],HEX24__systemZdollars_u14(a_p1),[32,46,46,32],HEX24__systemZdollars_u14(b_p2));
|
|
}
|
|
|
|
raiseException({message: nimCopy(null, Temporary1, NTI33554449), parent: null, m_type: NTI251658261, name: null, trace: [], up: null}, "IndexDefect");
|
|
|
|
|
|
}
|
|
|
|
function sysFatal__stdZassertions_u43(message_p1) {
|
|
raiseException({message: nimCopy(null, message_p1, NTI33554449), m_type: NTI251658257, parent: null, name: null, trace: [], up: null}, "AssertionDefect");
|
|
|
|
|
|
}
|
|
|
|
function raiseAssert__stdZassertions_u41(msg_p0) {
|
|
sysFatal__stdZassertions_u43(msg_p0);
|
|
|
|
|
|
}
|
|
|
|
function failedAssertImpl__stdZassertions_u83(msg_p0) {
|
|
raiseAssert__stdZassertions_u41(msg_p0);
|
|
|
|
|
|
}
|
|
|
|
function onDOMLoaded(e_p0) {
|
|
var Temporary4;
|
|
|
|
function HEX3Aanonymous__dochack_u65(event_p0) {
|
|
event_p0.target.parentNode.style.display = "none";
|
|
event_p0.target.parentNode.nextSibling.style.display = "inline";
|
|
|
|
|
|
}
|
|
|
|
document.getElementById("theme-select").value = window.localStorage.getItem("theme");
|
|
Label1: {
|
|
var pragmaDots_570425408 = null;
|
|
var colontmp__570426574 = [];
|
|
colontmp__570426574 = document.getElementsByClassName("pragmadots");
|
|
var i_570426576 = 0;
|
|
var L_570426577 = (colontmp__570426574).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426576 < L_570426577)) break Label3;
|
|
pragmaDots_570425408 = colontmp__570426574[chckIndx(i_570426576, 0, (colontmp__570426574).length - 1)];
|
|
Temporary4 = HEX3Aanonymous__dochack_u65.bind(null); Temporary4.ClP_0 = HEX3Aanonymous__dochack_u65; Temporary4.ClE_0 = null;
|
|
pragmaDots_570425408.onclick = Temporary4;
|
|
i_570426576 += 1;
|
|
if (!(((colontmp__570426574).length == L_570426577))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function raiseOverflow() {
|
|
raiseException({message: [111,118,101,114,45,32,111,114,32,117,110,100,101,114,102,108,111,119], parent: null, m_type: NTI251658255, name: null, trace: [], up: null}, "OverflowDefect");
|
|
|
|
|
|
}
|
|
|
|
function checkOverflowInt(a_p0) {
|
|
if (a_p0 > 2147483647 || a_p0 < -2147483648) raiseOverflow();
|
|
|
|
|
|
|
|
}
|
|
|
|
function isWhitespace__dochack_u408(x_p0) {
|
|
var result_570425754 = false;
|
|
|
|
result_570425754 = (((x_p0.nodeName == "#text") && !/\S/.test(x_p0.textContent)) || (x_p0.nodeName == "#comment"));
|
|
|
|
return result_570425754;
|
|
|
|
}
|
|
|
|
function toToc__dochack_u411(x_p0, father_p1) {
|
|
var Temporary5;
|
|
var Temporary6;
|
|
var Temporary7;
|
|
var Temporary8;
|
|
var Temporary15;
|
|
|
|
if ((x_p0.nodeName == "UL")) {
|
|
var f_570425765 = {heading: null, kids: [], sortId: (father_p1.kids).length, doSort: false};
|
|
var i_570425766 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!(i_570425766 < x_p0.childNodes.length)) break Label2;
|
|
var nxt_570425767 = addInt(i_570425766, 1);
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(nxt_570425767 < x_p0.childNodes.length)) Temporary5 = false; else { Temporary5 = isWhitespace__dochack_u408(x_p0.childNodes[nxt_570425767]); } if (!Temporary5) break Label4;
|
|
nxt_570425767 = addInt(nxt_570425767, 1);
|
|
}
|
|
};
|
|
if (!(nxt_570425767 < x_p0.childNodes.length)) Temporary8 = false; else { Temporary8 = (x_p0.childNodes[i_570425766].nodeName == "LI"); } if (!Temporary8) Temporary7 = false; else { Temporary7 = (x_p0.childNodes[i_570425766].childNodes.length == 1); } if (!Temporary7) Temporary6 = false; else { Temporary6 = (x_p0.childNodes[nxt_570425767].nodeName == "UL"); } if (Temporary6) {
|
|
var e_570425780 = {heading: x_p0.childNodes[i_570425766].childNodes[0], kids: [], sortId: (f_570425765.kids).length, doSort: false};
|
|
var it_570425781 = x_p0.childNodes[nxt_570425767];
|
|
Label9: {
|
|
var j_570425786 = 0;
|
|
var colontmp__570426591 = 0;
|
|
colontmp__570426591 = it_570425781.childNodes.length;
|
|
var i_570426592 = 0;
|
|
Label10: {
|
|
Label11: while (true) {
|
|
if (!(i_570426592 < colontmp__570426591)) break Label11;
|
|
j_570425786 = i_570426592;
|
|
toToc__dochack_u411(it_570425781.childNodes[j_570425786], e_570425780);
|
|
i_570426592 = addInt(i_570426592, 1);
|
|
}
|
|
};
|
|
};
|
|
f_570425765.kids.push(e_570425780);;
|
|
i_570425766 = addInt(nxt_570425767, 1);
|
|
}
|
|
else {
|
|
toToc__dochack_u411(x_p0.childNodes[i_570425766], f_570425765);
|
|
i_570425766 = addInt(i_570425766, 1);
|
|
}
|
|
|
|
}
|
|
};
|
|
father_p1.kids.push(f_570425765);;
|
|
}
|
|
else {
|
|
if (isWhitespace__dochack_u408(x_p0)) {
|
|
}
|
|
else {
|
|
if ((x_p0.nodeName == "LI")) {
|
|
var idx_570425804 = [];
|
|
Label12: {
|
|
var i_570425809 = 0;
|
|
var colontmp__570426595 = 0;
|
|
colontmp__570426595 = x_p0.childNodes.length;
|
|
var i_570426596 = 0;
|
|
Label13: {
|
|
Label14: while (true) {
|
|
if (!(i_570426596 < colontmp__570426595)) break Label14;
|
|
i_570425809 = i_570426596;
|
|
if (!(isWhitespace__dochack_u408(x_p0.childNodes[i_570425809]))) {
|
|
idx_570425804.push(i_570425809);;
|
|
}
|
|
|
|
i_570426596 = addInt(i_570426596, 1);
|
|
}
|
|
};
|
|
};
|
|
if (!((idx_570425804).length == 2)) Temporary15 = false; else { Temporary15 = (x_p0.childNodes[idx_570425804[chckIndx(1, 0, (idx_570425804).length - 1)]].nodeName == "UL"); } if (Temporary15) {
|
|
var e_570425825 = {heading: x_p0.childNodes[idx_570425804[chckIndx(0, 0, (idx_570425804).length - 1)]], kids: [], sortId: (father_p1.kids).length, doSort: false};
|
|
var it_570425826 = x_p0.childNodes[idx_570425804[chckIndx(1, 0, (idx_570425804).length - 1)]];
|
|
Label16: {
|
|
var j_570425831 = 0;
|
|
var colontmp__570426599 = 0;
|
|
colontmp__570426599 = it_570425826.childNodes.length;
|
|
var i_570426600 = 0;
|
|
Label17: {
|
|
Label18: while (true) {
|
|
if (!(i_570426600 < colontmp__570426599)) break Label18;
|
|
j_570425831 = i_570426600;
|
|
toToc__dochack_u411(it_570425826.childNodes[j_570425831], e_570425825);
|
|
i_570426600 = addInt(i_570426600, 1);
|
|
}
|
|
};
|
|
};
|
|
father_p1.kids.push(e_570425825);;
|
|
}
|
|
else {
|
|
Label19: {
|
|
var i_570425840 = 0;
|
|
var colontmp__570426603 = 0;
|
|
colontmp__570426603 = x_p0.childNodes.length;
|
|
var i_570426604 = 0;
|
|
Label20: {
|
|
Label21: while (true) {
|
|
if (!(i_570426604 < colontmp__570426603)) break Label21;
|
|
i_570425840 = i_570426604;
|
|
toToc__dochack_u411(x_p0.childNodes[i_570425840], father_p1);
|
|
i_570426604 = addInt(i_570426604, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
}
|
|
else {
|
|
father_p1.kids.push({heading: x_p0, kids: [], sortId: (father_p1.kids).length, doSort: false});;
|
|
}
|
|
}}
|
|
|
|
|
|
}
|
|
|
|
function extractItems__dochack_u199(x_p0, heading_p1, items_p2, items_p2_Idx) {
|
|
BeforeRet: {
|
|
if ((x_p0 == null)) {
|
|
break BeforeRet;
|
|
}
|
|
|
|
if ((!((x_p0.heading == null)) && (x_p0.heading.textContent == heading_p1))) {
|
|
Label1: {
|
|
var i_570425563 = 0;
|
|
var colontmp__570426607 = 0;
|
|
colontmp__570426607 = (x_p0.kids).length;
|
|
var i_570426608 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426608 < colontmp__570426607)) break Label3;
|
|
i_570425563 = i_570426608;
|
|
items_p2[items_p2_Idx].push(x_p0.kids[chckIndx(i_570425563, 0, (x_p0.kids).length - 1)].heading);;
|
|
i_570426608 = addInt(i_570426608, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
else {
|
|
Label4: {
|
|
var k_570425589 = null;
|
|
var i_570426612 = 0;
|
|
var L_570426613 = (x_p0.kids).length;
|
|
Label5: {
|
|
Label6: while (true) {
|
|
if (!(i_570426612 < L_570426613)) break Label6;
|
|
k_570425589 = x_p0.kids[chckIndx(i_570426612, 0, (x_p0.kids).length - 1)];
|
|
extractItems__dochack_u199(k_570425589, heading_p1, items_p2, items_p2_Idx);
|
|
i_570426612 += 1;
|
|
if (!(((x_p0.kids).length == L_570426613))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function tree__dochack_u130(tag_p0, kids_p1) {
|
|
var result_570425477 = null;
|
|
|
|
result_570425477 = document.createElement(tag_p0);
|
|
Label1: {
|
|
var k_570425491 = null;
|
|
var i_570426625 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426625 < (kids_p1).length)) break Label3;
|
|
k_570425491 = kids_p1[chckIndx(i_570426625, 0, (kids_p1).length - 1)];
|
|
result_570425477.appendChild(k_570425491);
|
|
i_570426625 += 1;
|
|
}
|
|
};
|
|
};
|
|
|
|
return result_570425477;
|
|
|
|
}
|
|
|
|
function text__dochack_u155(s_p0) {
|
|
var result_570425501 = null;
|
|
|
|
result_570425501 = document.createTextNode(s_p0);
|
|
|
|
return result_570425501;
|
|
|
|
}
|
|
|
|
function uncovered__dochack_u600(x_p0) {
|
|
var Temporary1;
|
|
|
|
var result_570425946 = null;
|
|
|
|
BeforeRet: {
|
|
if ((((x_p0.kids).length == 0) && !((x_p0.heading == null)))) {
|
|
if (!(x_p0.heading.hasOwnProperty('__karaxMarker__'))) {
|
|
Temporary1 = x_p0;
|
|
}
|
|
else {
|
|
Temporary1 = null;
|
|
}
|
|
|
|
result_570425946 = Temporary1;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_570425946 = {heading: x_p0.heading, kids: [], sortId: x_p0.sortId, doSort: x_p0.doSort};
|
|
Label2: {
|
|
var k_570425961 = null;
|
|
var i_570426632 = 0;
|
|
var L_570426633 = (x_p0.kids).length;
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(i_570426632 < L_570426633)) break Label4;
|
|
k_570425961 = x_p0.kids[chckIndx(i_570426632, 0, (x_p0.kids).length - 1)];
|
|
var y_570425962 = uncovered__dochack_u600(k_570425961);
|
|
if (!((y_570425962 == null))) {
|
|
result_570425946.kids.push(y_570425962);;
|
|
}
|
|
|
|
i_570426632 += 1;
|
|
if (!(((x_p0.kids).length == L_570426633))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
if (((result_570425946.kids).length == 0)) {
|
|
result_570425946 = null;
|
|
}
|
|
|
|
};
|
|
|
|
return result_570425946;
|
|
|
|
}
|
|
|
|
function mergeTocs__dochack_u630(orig_p0, news_p1) {
|
|
var result_570425977 = null;
|
|
|
|
result_570425977 = uncovered__dochack_u600(orig_p0);
|
|
if ((result_570425977 == null)) {
|
|
result_570425977 = news_p1;
|
|
}
|
|
else {
|
|
Label1: {
|
|
var i_570425989 = 0;
|
|
var colontmp__570426628 = 0;
|
|
colontmp__570426628 = (news_p1.kids).length;
|
|
var i_570426629 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426629 < colontmp__570426628)) break Label3;
|
|
i_570425989 = i_570426629;
|
|
result_570425977.kids.push(news_p1.kids[chckIndx(i_570425989, 0, (news_p1.kids).length - 1)]);;
|
|
i_570426629 = addInt(i_570426629, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
|
|
return result_570425977;
|
|
|
|
}
|
|
|
|
function buildToc__dochack_u650(orig_p0, types_p1, procs_p2) {
|
|
var result_570425998 = null;
|
|
|
|
var newStuff_570426003 = {heading: null, kids: [], doSort: true, sortId: 0};
|
|
Label1: {
|
|
var t_570426007 = null;
|
|
var i_570426620 = 0;
|
|
var L_570426621 = (types_p1).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426620 < L_570426621)) break Label3;
|
|
t_570426007 = types_p1[chckIndx(i_570426620, 0, (types_p1).length - 1)];
|
|
var c_570426012 = {heading: t_570426007.cloneNode(true), kids: [], doSort: true, sortId: 0};
|
|
t_570426007.__karaxMarker__ = true;
|
|
Label4: {
|
|
var p_570426016 = null;
|
|
var i_570426617 = 0;
|
|
var L_570426618 = (procs_p2).length;
|
|
Label5: {
|
|
Label6: while (true) {
|
|
if (!(i_570426617 < L_570426618)) break Label6;
|
|
p_570426016 = procs_p2[chckIndx(i_570426617, 0, (procs_p2).length - 1)];
|
|
if (!(p_570426016.hasOwnProperty('__karaxMarker__'))) {
|
|
var xx_570426017 = p_570426016.parentNode.getElementsByClassName("attachedType");
|
|
if ((((xx_570426017).length == 1) && (xx_570426017[chckIndx(0, 0, (xx_570426017).length - 1)].textContent == t_570426007.textContent))) {
|
|
var q_570426022 = tree__dochack_u130("A", [text__dochack_u155(p_570426016.title)]);
|
|
q_570426022.setAttribute("href", p_570426016.getAttribute("href"));
|
|
c_570426012.kids.push({heading: q_570426022, kids: [], sortId: 0, doSort: false});;
|
|
p_570426016.__karaxMarker__ = true;
|
|
}
|
|
|
|
}
|
|
|
|
i_570426617 += 1;
|
|
if (!(((procs_p2).length == L_570426618))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
newStuff_570426003.kids.push(c_570426012);;
|
|
i_570426620 += 1;
|
|
if (!(((types_p1).length == L_570426621))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
result_570425998 = mergeTocs__dochack_u630(orig_p0, newStuff_570426003);
|
|
|
|
return result_570425998;
|
|
|
|
}
|
|
|
|
function add__dochack_u148(parent_p0, kid_p1) {
|
|
if (((parent_p0.nodeName == "TR") && ((kid_p1.nodeName == "TD") || (kid_p1.nodeName == "TH")))) {
|
|
var k_570425495 = document.createElement("TD");
|
|
k_570425495.appendChild(kid_p1);
|
|
parent_p0.appendChild(k_570425495);
|
|
}
|
|
else {
|
|
parent_p0.appendChild(kid_p1);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function setClass__dochack_u152(e_p0, value_p1) {
|
|
e_p0.setAttribute("class", value_p1);
|
|
|
|
|
|
}
|
|
|
|
function toHtml__dochack_u278(x_p0, isRoot_p1) {
|
|
var Temporary1;
|
|
|
|
function HEX3Aanonymous__dochack_u298(a_p0, b_p1) {
|
|
var result_570425645 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((!((a_p0.heading == null)) && !((b_p1.heading == null)))) {
|
|
var x_570425654 = a_p0.heading.textContent;
|
|
var y_570425655 = b_p1.heading.textContent;
|
|
if ((x_570425654 < y_570425655)) {
|
|
result_570425645 = (-1);
|
|
break BeforeRet;
|
|
}
|
|
|
|
if ((y_570425655 < x_570425654)) {
|
|
result_570425645 = 1;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_570425645 = 0;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
result_570425645 = subInt(a_p0.sortId, b_p1.sortId);
|
|
break BeforeRet;
|
|
}
|
|
|
|
};
|
|
|
|
return result_570425645;
|
|
|
|
}
|
|
|
|
var result_570425625 = null;
|
|
|
|
BeforeRet: {
|
|
if ((x_p0 == null)) {
|
|
result_570425625 = null;
|
|
break BeforeRet;
|
|
}
|
|
|
|
if (((x_p0.kids).length == 0)) {
|
|
if ((x_p0.heading == null)) {
|
|
result_570425625 = null;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_570425625 = x_p0.heading.cloneNode(true);
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_570425625 = tree__dochack_u130("DIV", []);
|
|
if ((!((x_p0.heading == null)) && !(x_p0.heading.hasOwnProperty('__karaxMarker__')))) {
|
|
add__dochack_u148(result_570425625, x_p0.heading.cloneNode(true));
|
|
}
|
|
|
|
var ul_570425641 = tree__dochack_u130("UL", []);
|
|
if (isRoot_p1) {
|
|
setClass__dochack_u152(ul_570425641, "simple simple-toc");
|
|
}
|
|
else {
|
|
setClass__dochack_u152(ul_570425641, "simple");
|
|
}
|
|
|
|
if (x_p0.doSort) {
|
|
Temporary1 = HEX3Aanonymous__dochack_u298.bind(null); Temporary1.ClP_0 = HEX3Aanonymous__dochack_u298; Temporary1.ClE_0 = null;
|
|
x_p0.kids.sort(Temporary1);
|
|
}
|
|
|
|
Label2: {
|
|
var k_570425667 = null;
|
|
var i_570426636 = 0;
|
|
var L_570426637 = (x_p0.kids).length;
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(i_570426636 < L_570426637)) break Label4;
|
|
k_570425667 = x_p0.kids[chckIndx(i_570426636, 0, (x_p0.kids).length - 1)];
|
|
var y_570425668 = toHtml__dochack_u278(k_570425667, false);
|
|
if (!((y_570425668 == null))) {
|
|
add__dochack_u148(ul_570425641, tree__dochack_u130("LI", [y_570425668]));
|
|
}
|
|
|
|
i_570426636 += 1;
|
|
if (!(((x_p0.kids).length == L_570426637))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
if (!((ul_570425641.childNodes.length == 0))) {
|
|
add__dochack_u148(result_570425625, ul_570425641);
|
|
}
|
|
|
|
if ((result_570425625.childNodes.length == 0)) {
|
|
result_570425625 = null;
|
|
}
|
|
|
|
};
|
|
|
|
return result_570425625;
|
|
|
|
}
|
|
|
|
function replaceById__dochack_u158(id_p0, newTree_p1) {
|
|
var x_570425505 = document.getElementById(id_p0);
|
|
x_570425505.parentNode.replaceChild(newTree_p1, x_570425505);
|
|
newTree_p1.id = id_p0;
|
|
|
|
|
|
}
|
|
|
|
function togglevis__dochack_u708(d_p0) {
|
|
if ((d_p0.style.display == "none")) {
|
|
d_p0.style.display = "inline";
|
|
}
|
|
else {
|
|
d_p0.style.display = "none";
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function groupBy(value_p0) {
|
|
var toc_570426056 = document.getElementById("toc-list");
|
|
if ((alternative_570426051[0] == null)) {
|
|
var tt_570426064 = {heading: null, kids: [], sortId: 0, doSort: false};
|
|
toToc__dochack_u411(toc_570426056, tt_570426064);
|
|
tt_570426064 = tt_570426064.kids[chckIndx(0, 0, (tt_570426064.kids).length - 1)];
|
|
var types_570426069 = [[]];
|
|
var procs_570426074 = [[]];
|
|
extractItems__dochack_u199(tt_570426064, "Types", types_570426069, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Procs", procs_570426074, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Converters", procs_570426074, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Methods", procs_570426074, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Templates", procs_570426074, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Macros", procs_570426074, 0);
|
|
extractItems__dochack_u199(tt_570426064, "Iterators", procs_570426074, 0);
|
|
var ntoc_570426075 = buildToc__dochack_u650(tt_570426064, types_570426069[0], procs_570426074[0]);
|
|
var x_570426076 = toHtml__dochack_u278(ntoc_570426075, true);
|
|
alternative_570426051[0] = tree__dochack_u130("DIV", [x_570426076]);
|
|
}
|
|
|
|
if ((value_p0 == "type")) {
|
|
replaceById__dochack_u158("tocRoot", alternative_570426051[0]);
|
|
}
|
|
else {
|
|
replaceById__dochack_u158("tocRoot", tree__dochack_u130("DIV", []));
|
|
}
|
|
|
|
togglevis__dochack_u708(document.getElementById("toc-list"));
|
|
|
|
|
|
}
|
|
|
|
function raiseRangeError() {
|
|
raiseException({message: [118,97,108,117,101,32,111,117,116,32,111,102,32,114,97,110,103,101], parent: null, m_type: NTI251658263, name: null, trace: [], up: null}, "RangeDefect");
|
|
|
|
|
|
}
|
|
|
|
function HEX5BHEX5D__pureZstrutils_u1308(s_p0, x_p1) {
|
|
var result_738198817 = [];
|
|
|
|
var a_738198819 = x_p1.a;
|
|
var L_738198821 = addInt(subInt(subInt((s_p0).length, x_p1.b), a_738198819), 1);
|
|
result_738198817 = nimCopy(null, mnewString(chckRange(L_738198821, 0, 2147483647)), NTI33554449);
|
|
Label1: {
|
|
var i_738198826 = 0;
|
|
var i_570426646 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426646 < L_738198821)) break Label3;
|
|
i_738198826 = i_570426646;
|
|
result_738198817[chckIndx(i_738198826, 0, (result_738198817).length - 1)] = s_p0[chckIndx(addInt(i_738198826, a_738198819), 0, (s_p0).length - 1)];
|
|
i_570426646 = addInt(i_570426646, 1);
|
|
}
|
|
};
|
|
};
|
|
|
|
return result_738198817;
|
|
|
|
}
|
|
|
|
function HEX2EHEX2E__stdZenumutils_u105(a_p0, b_p1) {
|
|
var result_956301424 = ({a: 0, b: 0});
|
|
|
|
result_956301424 = nimCopy(result_956301424, {a: a_p0, b: b_p1}, NTI956301399);
|
|
|
|
return result_956301424;
|
|
|
|
}
|
|
async function loadIndex__dochack_u928() {
|
|
var result_570426274 = null;
|
|
|
|
BeforeRet: {
|
|
var indexURL_570426280 = document.getElementById("indexLink").getAttribute("href");
|
|
var rootURL_570426306 = HEX5BHEX5D__pureZstrutils_u1308(cstrToNimstr(indexURL_570426280), HEX2EHEX2E__stdZenumutils_u105(0, 14));
|
|
var resp_570426318 = (await (await fetch(indexURL_570426280)).text());
|
|
var indexElem_570426319 = document.createElement("div");
|
|
indexElem_570426319.innerHTML = resp_570426318;
|
|
Label1: {
|
|
var href_570426341 = null;
|
|
var colontmp__570426640 = [];
|
|
colontmp__570426640 = indexElem_570426319.getElementsByClassName("reference");
|
|
var i_570426642 = 0;
|
|
var L_570426643 = (colontmp__570426640).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426642 < L_570426643)) break Label3;
|
|
href_570426341 = colontmp__570426640[chckIndx(i_570426642, 0, (colontmp__570426640).length - 1)];
|
|
href_570426341.setAttribute("href", toJSStr((rootURL_570426306).concat(cstrToNimstr(href_570426341.getAttribute("href")))));
|
|
db_570426093[0].push(href_570426341);;
|
|
contents_570426094[0].push(href_570426341.getAttribute("data-doc-search-tag"));;
|
|
i_570426642 += 1;
|
|
if (!(((colontmp__570426640).length == L_570426643))) {
|
|
failedAssertImpl__stdZassertions_u83(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
result_570426274 = undefined;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_570426274;
|
|
|
|
}
|
|
|
|
function then__dochack_u1107(future_p0, onSuccess_p1, onReject_p2) {
|
|
var result_570426457 = null;
|
|
|
|
BeforeRet: {
|
|
var ret_570426467 = null;
|
|
ret_570426467 = future_p0.then(onSuccess_p1, onReject_p2);
|
|
result_570426457 = ret_570426467;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_570426457;
|
|
|
|
}
|
|
|
|
function nsuToLowerAsciiChar(c_p0) {
|
|
var result_738197591 = 0;
|
|
|
|
if ((ConstSet2[c_p0] != undefined)) {
|
|
result_738197591 = (c_p0 ^ 32);
|
|
}
|
|
else {
|
|
result_738197591 = c_p0;
|
|
}
|
|
|
|
|
|
return result_738197591;
|
|
|
|
}
|
|
|
|
function fuzzyMatch__fuzzysearch_u16(pattern_p0, str_p1) {
|
|
var Temporary4;
|
|
var Temporary5;
|
|
var Temporary6;
|
|
var Temporary7;
|
|
var Temporary8;
|
|
|
|
var result_721420309 = {Field0: 0, Field1: false};
|
|
|
|
var scoreState_721420310 = (-100);
|
|
var headerMatched_721420311 = false;
|
|
var unmatchedLeadingCharCount_721420312 = 0;
|
|
var consecutiveMatchCount_721420313 = 0;
|
|
var strIndex_721420314 = 0;
|
|
var patIndex_721420315 = 0;
|
|
var score_721420316 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!((strIndex_721420314 < ((str_p1) == null ? 0 : (str_p1).length)) && (patIndex_721420315 < ((pattern_p0) == null ? 0 : (pattern_p0).length)))) break Label2;
|
|
Label3: {
|
|
var patternChar_721420319 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(patIndex_721420315, 0, (pattern_p0).length - 1)));
|
|
var strChar_721420320 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(strIndex_721420314, 0, (str_p1).length - 1)));
|
|
if ((ConstSet3[patternChar_721420319] != undefined)) {
|
|
patIndex_721420315 = addInt(patIndex_721420315, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((ConstSet4[strChar_721420320] != undefined)) {
|
|
strIndex_721420314 = addInt(strIndex_721420314, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((!(headerMatched_721420311) && (strChar_721420320 == 58))) {
|
|
headerMatched_721420311 = true;
|
|
scoreState_721420310 = (-100);
|
|
score_721420316 = chckRange(Number(BigInt(Math.trunc(Math.floor((0.5 * score_721420316))))), (-2147483648), 2147483647);
|
|
patIndex_721420315 = 0;
|
|
strIndex_721420314 = addInt(strIndex_721420314, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((strChar_721420320 == patternChar_721420319)) {
|
|
switch (scoreState_721420310) {
|
|
case (-100):
|
|
case 20:
|
|
scoreState_721420310 = 10;
|
|
break;
|
|
case 0:
|
|
scoreState_721420310 = 5;
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
break;
|
|
case 10:
|
|
case 5:
|
|
consecutiveMatchCount_721420313 = addInt(consecutiveMatchCount_721420313, 1);
|
|
scoreState_721420310 = 5;
|
|
score_721420316 = addInt(score_721420316, mulInt(5, consecutiveMatchCount_721420313));
|
|
if ((scoreState_721420310 == 10)) {
|
|
score_721420316 = addInt(score_721420316, 10);
|
|
}
|
|
|
|
var onBoundary_721420372 = (patIndex_721420315 == ((pattern_p0) == null ? -1 : (pattern_p0).length - 1));
|
|
if ((!(onBoundary_721420372) && (strIndex_721420314 < ((str_p1) == null ? -1 : (str_p1).length - 1)))) {
|
|
var nextPatternChar_721420373 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(addInt(patIndex_721420315, 1), 0, (pattern_p0).length - 1)));
|
|
var nextStrChar_721420374 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(addInt(strIndex_721420314, 1), 0, (str_p1).length - 1)));
|
|
if (!!((ConstSet5[nextStrChar_721420374] != undefined))) Temporary4 = false; else { Temporary4 = !((nextStrChar_721420374 == nextPatternChar_721420373)); } onBoundary_721420372 = Temporary4;
|
|
}
|
|
|
|
if (onBoundary_721420372) {
|
|
scoreState_721420310 = 20;
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
}
|
|
|
|
break;
|
|
case (-1):
|
|
case (-3):
|
|
if (!((ConstSet6[str_p1.charCodeAt(chckIndx(subInt(strIndex_721420314, 1), 0, (str_p1).length - 1))] != undefined))) Temporary5 = true; else { if (!(ConstSet7[str_p1.charCodeAt(chckIndx(subInt(strIndex_721420314, 1), 0, (str_p1).length - 1))] != undefined)) Temporary6 = false; else { Temporary6 = (ConstSet8[str_p1.charCodeAt(chckIndx(strIndex_721420314, 0, (str_p1).length - 1))] != undefined); } Temporary5 = Temporary6; } var isLeadingChar_721420398 = Temporary5;
|
|
if (isLeadingChar_721420398) {
|
|
scoreState_721420310 = 10;
|
|
}
|
|
else {
|
|
scoreState_721420310 = 0;
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
}
|
|
|
|
break;
|
|
}
|
|
patIndex_721420315 = addInt(patIndex_721420315, 1);
|
|
}
|
|
else {
|
|
switch (scoreState_721420310) {
|
|
case (-100):
|
|
scoreState_721420310 = (-3);
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
break;
|
|
case 5:
|
|
scoreState_721420310 = (-1);
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
consecutiveMatchCount_721420313 = 0;
|
|
break;
|
|
case (-3):
|
|
if ((unmatchedLeadingCharCount_721420312 < 3)) {
|
|
scoreState_721420310 = (-3);
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
}
|
|
|
|
unmatchedLeadingCharCount_721420312 = addInt(unmatchedLeadingCharCount_721420312, 1);
|
|
break;
|
|
default:
|
|
scoreState_721420310 = (-1);
|
|
score_721420316 = addInt(score_721420316, scoreState_721420310);
|
|
break;
|
|
}
|
|
}
|
|
|
|
strIndex_721420314 = addInt(strIndex_721420314, 1);
|
|
};
|
|
}
|
|
};
|
|
if (!(patIndex_721420315 == ((pattern_p0) == null ? 0 : (pattern_p0).length))) Temporary7 = false; else { if ((strIndex_721420314 == ((str_p1) == null ? 0 : (str_p1).length))) Temporary8 = true; else { Temporary8 = !((ConstSet9[str_p1.charCodeAt(chckIndx(strIndex_721420314, 0, (str_p1).length - 1))] != undefined)); } Temporary7 = Temporary8; } if (Temporary7) {
|
|
score_721420316 = addInt(score_721420316, 10);
|
|
}
|
|
|
|
var colontmp__570426659 = nimMax(0, score_721420316);
|
|
var colontmp__570426660 = (0 < score_721420316);
|
|
result_721420309 = nimCopy(result_721420309, {Field0: colontmp__570426659, Field1: colontmp__570426660}, NTI721420302);
|
|
|
|
return result_721420309;
|
|
|
|
}
|
|
|
|
function escapeCString__dochack_u751(x_p0, x_p0_Idx) {
|
|
var s_570426097 = [];
|
|
Label1: {
|
|
var c_570426098 = 0;
|
|
var iHEX60gensym13_570426663 = 0;
|
|
var nHEX60gensym13_570426664 = ((x_p0[x_p0_Idx]) == null ? 0 : (x_p0[x_p0_Idx]).length);
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(iHEX60gensym13_570426663 < nHEX60gensym13_570426664)) break Label3;
|
|
c_570426098 = x_p0[x_p0_Idx].charCodeAt(chckIndx(iHEX60gensym13_570426663, 0, (x_p0[x_p0_Idx]).length - 1));
|
|
switch (c_570426098) {
|
|
case 60:
|
|
nimAddStrStr(s_570426097, [38,108,116,59]);;
|
|
break;
|
|
case 62:
|
|
nimAddStrStr(s_570426097, [38,103,116,59]);;
|
|
break;
|
|
default:
|
|
addChar(s_570426097, c_570426098);;
|
|
break;
|
|
}
|
|
iHEX60gensym13_570426663 += 1;
|
|
}
|
|
};
|
|
};
|
|
x_p0[x_p0_Idx] = toJSStr(s_570426097);
|
|
|
|
|
|
}
|
|
|
|
function dosearch__dochack_u755(value_p0) {
|
|
var Temporary5;
|
|
|
|
function HEX3Aanonymous__dochack_u783(a_p0, b_p1) {
|
|
var result_570426140 = 0;
|
|
|
|
result_570426140 = subInt(b_p1["Field1"], a_p0["Field1"]);
|
|
|
|
return result_570426140;
|
|
|
|
}
|
|
|
|
var result_570426101 = null;
|
|
|
|
BeforeRet: {
|
|
if (((db_570426093[0]).length == 0)) {
|
|
break BeforeRet;
|
|
}
|
|
|
|
var ul_570426105 = tree__dochack_u130("UL", []);
|
|
result_570426101 = tree__dochack_u130("DIV", []);
|
|
setClass__dochack_u152(result_570426101, "search_results");
|
|
var matches_570426110 = [];
|
|
Label1: {
|
|
var i_570426118 = 0;
|
|
var colontmp__570426650 = 0;
|
|
colontmp__570426650 = (db_570426093[0]).length;
|
|
var i_570426651 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_570426651 < colontmp__570426650)) break Label3;
|
|
i_570426118 = i_570426651;
|
|
Label4: {
|
|
var c_570426119 = contents_570426094[0][chckIndx(i_570426118, 0, (contents_570426094[0]).length - 1)];
|
|
if (((c_570426119 == "Examples") || (c_570426119 == "PEG construction"))) {
|
|
break Label4;
|
|
}
|
|
|
|
var tmpTuple_570426120 = fuzzyMatch__fuzzysearch_u16(value_p0, c_570426119);
|
|
var score_570426121 = tmpTuple_570426120["Field0"];
|
|
var matched_570426122 = tmpTuple_570426120["Field1"];
|
|
if (matched_570426122) {
|
|
matches_570426110.push({Field0: db_570426093[0][chckIndx(i_570426118, 0, (db_570426093[0]).length - 1)], Field1: score_570426121});;
|
|
}
|
|
|
|
};
|
|
i_570426651 = addInt(i_570426651, 1);
|
|
}
|
|
};
|
|
};
|
|
Temporary5 = HEX3Aanonymous__dochack_u783.bind(null); Temporary5.ClP_0 = HEX3Aanonymous__dochack_u783; Temporary5.ClE_0 = null;
|
|
matches_570426110.sort(Temporary5);
|
|
Label6: {
|
|
var i_570426157 = 0;
|
|
var colontmp__570426654 = 0;
|
|
colontmp__570426654 = nimMin((matches_570426110).length, 29);
|
|
var i_570426655 = 0;
|
|
Label7: {
|
|
Label8: while (true) {
|
|
if (!(i_570426655 < colontmp__570426654)) break Label8;
|
|
i_570426157 = i_570426655;
|
|
matches_570426110[chckIndx(i_570426157, 0, (matches_570426110).length - 1)]["Field0"].innerHTML = matches_570426110[chckIndx(i_570426157, 0, (matches_570426110).length - 1)]["Field0"].getAttribute("data-doc-search-tag");
|
|
escapeCString__dochack_u751(matches_570426110[chckIndx(i_570426157, 0, (matches_570426110).length - 1)]["Field0"], "innerHTML");
|
|
add__dochack_u148(ul_570426105, tree__dochack_u130("LI", [matches_570426110[chckIndx(i_570426157, 0, (matches_570426110).length - 1)]["Field0"]]));
|
|
i_570426655 = addInt(i_570426655, 1);
|
|
}
|
|
};
|
|
};
|
|
if ((ul_570426105.childNodes.length == 0)) {
|
|
add__dochack_u148(result_570426101, tree__dochack_u130("B", [text__dochack_u155("no search results")]));
|
|
}
|
|
else {
|
|
add__dochack_u148(result_570426101, tree__dochack_u130("B", [text__dochack_u155("search results")]));
|
|
add__dochack_u148(result_570426101, ul_570426105);
|
|
}
|
|
|
|
};
|
|
|
|
return result_570426101;
|
|
|
|
}
|
|
|
|
function hideSearch__dochack_u1090() {
|
|
if (!((oldtoc_570426430[0] == null))) {
|
|
replaceById__dochack_u158("tocRoot", oldtoc_570426430[0]);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function runSearch__dochack_u1094() {
|
|
var elem_570426439 = document.getElementById("searchInput");
|
|
var value_570426440 = elem_570426439.value;
|
|
if (!((value_570426440 == ""))) {
|
|
if ((oldtoc_570426430[0] == null)) {
|
|
oldtoc_570426430[0] = document.getElementById("tocRoot");
|
|
}
|
|
|
|
var results_570426444 = dosearch__dochack_u755(value_570426440);
|
|
replaceById__dochack_u158("tocRoot", results_570426444);
|
|
}
|
|
else {
|
|
hideSearch__dochack_u1090();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function search() {
|
|
var Temporary1;
|
|
|
|
if ((loadIndexFut_570426433[0] == null)) {
|
|
loadIndexFut_570426433[0] = loadIndex__dochack_u928();
|
|
(then__dochack_u1107(loadIndexFut_570426433[0], runSearch__dochack_u1094, null));
|
|
}
|
|
|
|
if (!((timer_570426431[0] == null))) {
|
|
clearTimeout(timer_570426431[0]);
|
|
}
|
|
|
|
Temporary1 = runSearch__dochack_u1094.bind(null); Temporary1.ClP_0 = runSearch__dochack_u1094; Temporary1.ClE_0 = null;
|
|
timer_570426431[0] = setTimeout(Temporary1, 400);
|
|
|
|
|
|
}
|
|
|
|
function copyToClipboard() {
|
|
|
|
function updatePreTags() {
|
|
|
|
const allPreTags = document.querySelectorAll("pre:not(.line-nums)")
|
|
|
|
allPreTags.forEach((e) => {
|
|
|
|
const div = document.createElement("div")
|
|
div.classList.add("copyToClipBoard")
|
|
|
|
const preTag = document.createElement("pre")
|
|
preTag.innerHTML = e.innerHTML
|
|
|
|
const button = document.createElement("button")
|
|
button.value = e.textContent.replace('...', '')
|
|
button.classList.add("copyToClipBoardBtn")
|
|
button.style.cursor = "pointer"
|
|
|
|
div.appendChild(preTag)
|
|
div.appendChild(button)
|
|
|
|
e.outerHTML = div.outerHTML
|
|
|
|
})
|
|
}
|
|
|
|
|
|
function copyTextToClipboard(e) {
|
|
const clipBoardContent = e.target.value
|
|
navigator.clipboard.writeText(clipBoardContent).then(function() {
|
|
e.target.style.setProperty("--clipboard-image", "var(--clipboard-image-selected)")
|
|
}, function(err) {
|
|
console.error("Could not copy text: ", err);
|
|
});
|
|
}
|
|
|
|
window.addEventListener("click", (e) => {
|
|
if (e.target.classList.contains("copyToClipBoardBtn")) {
|
|
copyTextToClipboard(e)
|
|
}
|
|
})
|
|
|
|
window.addEventListener("mouseover", (e) => {
|
|
if (e.target.nodeName === "PRE") {
|
|
e.target.nextElementSibling.style.setProperty("--clipboard-image", "var(--clipboard-image-normal)")
|
|
}
|
|
})
|
|
|
|
window.addEventListener("DOMContentLoaded", updatePreTags)
|
|
|
|
|
|
|
|
|
|
}
|
|
var Temporary1;
|
|
var Temporary2;
|
|
|
|
function HEX3Aanonymous__dochack_u1175(e_p0) {
|
|
if ((e_p0.key == "/")) {
|
|
e_p0.preventDefault();
|
|
var searchElem_570426521 = document.getElementById("searchInput");
|
|
searchElem_570426521.focus();
|
|
searchElem_570426521.parentElement.scrollIntoView();
|
|
runSearch__dochack_u1094();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
var Temporary3;
|
|
|
|
function HEX3Aanonymous__dochack_u1210(e_p0) {
|
|
hideSearch__dochack_u1090();
|
|
|
|
|
|
}
|
|
var Temporary4;
|
|
var t_570425383 = window.localStorage.getItem("theme");
|
|
if ((t_570425383 == null)) {
|
|
Temporary1 = "auto";
|
|
}
|
|
else {
|
|
Temporary1 = t_570425383;
|
|
}
|
|
|
|
setTheme(Temporary1);
|
|
var alternative_570426051 = [null];
|
|
var db_570426093 = [[]];
|
|
var contents_570426094 = [[]];
|
|
var oldtoc_570426430 = [null];
|
|
var timer_570426431 = [null];
|
|
var loadIndexFut_570426433 = [null];
|
|
Temporary2 = HEX3Aanonymous__dochack_u1175.bind(null); Temporary2.ClP_0 = HEX3Aanonymous__dochack_u1175; Temporary2.ClE_0 = null;
|
|
window.addEventListener("keypress", Temporary2, false);
|
|
Temporary3 = HEX3Aanonymous__dochack_u1210.bind(null); Temporary3.ClP_0 = HEX3Aanonymous__dochack_u1210; Temporary3.ClE_0 = null;
|
|
window.addEventListener("hashchange", Temporary3, false);
|
|
copyToClipboard();
|
|
Temporary4 = onDOMLoaded.bind(null); Temporary4.ClP_0 = onDOMLoaded; Temporary4.ClE_0 = null;
|
|
window.addEventListener("DOMContentLoaded", Temporary4, false);
|