1607 lines
54 KiB
JavaScript
1607 lines
54 KiB
JavaScript
/* Generated by the Nim Compiler v1.9.1 */
|
|
var framePtr = null;
|
|
var excHandler = 0;
|
|
var lastJSError = null;
|
|
var NTI33554466 = {size: 0,kind: 1,base: null,node: null,finalizer: null};
|
|
var NTI704643086 = {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 NTI956301398 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
|
|
var NTI134217745 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI134217749 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI134217751 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555171 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555179 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
|
|
var NTI33554449 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
|
|
var NTI33554450 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
|
|
var NTI33555178 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
|
|
var NTI33555175 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI33555176 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI134217741 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NTI134217743 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
|
|
var NNI134217743 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI134217743.node = NNI134217743;
|
|
var NNI134217741 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI134217741.node = NNI134217741;
|
|
var NNI33555176 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI33555176.node = NNI33555176;
|
|
NTI33555178.base = NTI33555175;
|
|
NTI33555179.base = NTI33555175;
|
|
var NNI33555175 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI33555178, 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: NTI33555179, name: "up", sons: null}]};
|
|
NTI33555175.node = NNI33555175;
|
|
var NNI33555171 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI33555171.node = NNI33555171;
|
|
NTI33555175.base = NTI33555171;
|
|
NTI33555176.base = NTI33555175;
|
|
NTI134217741.base = NTI33555176;
|
|
NTI134217743.base = NTI134217741;
|
|
var NNI134217751 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI134217751.node = NNI134217751;
|
|
NTI134217751.base = NTI33555176;
|
|
var NNI134217749 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI134217749.node = NNI134217749;
|
|
NTI134217749.base = NTI33555176;
|
|
var NNI134217745 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
|
|
NTI134217745.node = NNI134217745;
|
|
NTI134217745.base = NTI33555176;
|
|
var NNI956301398 = {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}]};
|
|
NTI956301398.node = NNI956301398;
|
|
var NNI704643086 = {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}]};
|
|
NTI704643086.node = NNI704643086;
|
|
|
|
function mnewString(len_33556950) {
|
|
return new Array(len_33556950);
|
|
|
|
|
|
|
|
}
|
|
|
|
function toJSStr(s_33556854) {
|
|
var result_33556855 = null;
|
|
|
|
var res_33556893 = newSeq_33556872((s_33556854).length);
|
|
var i_33556894 = 0;
|
|
var j_33556895 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!(i_33556894 < (s_33556854).length)) break Label2;
|
|
var c_33556896 = s_33556854[i_33556894];
|
|
if ((c_33556896 < 128)) {
|
|
res_33556893[j_33556895] = String.fromCharCode(c_33556896);
|
|
i_33556894 += 1;
|
|
}
|
|
else {
|
|
var helper_33556909 = newSeq_33556872(0);
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!true) break Label4;
|
|
var code_33556910 = c_33556896.toString(16);
|
|
if ((((code_33556910) == null ? 0 : (code_33556910).length) == 1)) {
|
|
helper_33556909.push("%0");;
|
|
}
|
|
else {
|
|
helper_33556909.push("%");;
|
|
}
|
|
|
|
helper_33556909.push(code_33556910);;
|
|
i_33556894 += 1;
|
|
if ((((s_33556854).length <= i_33556894) || (s_33556854[i_33556894] < 128))) {
|
|
break Label3;
|
|
}
|
|
|
|
c_33556896 = s_33556854[i_33556894];
|
|
}
|
|
};
|
|
++excHandler;
|
|
try {
|
|
res_33556893[j_33556895] = decodeURIComponent(helper_33556909.join(""));
|
|
--excHandler;
|
|
} catch (EXCEPTION) {
|
|
var prevJSError = lastJSError;
|
|
lastJSError = EXCEPTION;
|
|
--excHandler;
|
|
res_33556893[j_33556895] = helper_33556909.join("");
|
|
lastJSError = prevJSError;
|
|
} finally {
|
|
}
|
|
}
|
|
|
|
j_33556895 += 1;
|
|
}
|
|
};
|
|
if (res_33556893.length < j_33556895) { for (var i = res_33556893.length ; i < j_33556895 ; ++i) res_33556893.push(null); }
|
|
else { res_33556893.length = j_33556895; };
|
|
result_33556855 = res_33556893.join("");
|
|
|
|
return result_33556855;
|
|
|
|
}
|
|
|
|
function raiseException(e_33556642, ename_33556643) {
|
|
e_33556642.name = ename_33556643;
|
|
if ((excHandler == 0)) {
|
|
unhandledException(e_33556642);
|
|
}
|
|
|
|
throw e_33556642;
|
|
|
|
|
|
}
|
|
|
|
function addInt(a_33556997, b_33556998) {
|
|
var result = a_33556997 + b_33556998;
|
|
checkOverflowInt(result);
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function chckRange(i_33557262, a_33557263, b_33557264) {
|
|
var result_33557265 = 0;
|
|
|
|
BeforeRet: {
|
|
if (((a_33557263 <= i_33557262) && (i_33557262 <= b_33557264))) {
|
|
result_33557265 = i_33557262;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
raiseRangeError();
|
|
}
|
|
|
|
};
|
|
|
|
return result_33557265;
|
|
|
|
}
|
|
|
|
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_33557209, src_33557210, ti_33557211) {
|
|
var result_33557220 = null;
|
|
|
|
switch (ti_33557211.kind) {
|
|
case 21:
|
|
case 22:
|
|
case 23:
|
|
case 5:
|
|
if (!(isFatPointer_33557200(ti_33557211))) {
|
|
result_33557220 = src_33557210;
|
|
}
|
|
else {
|
|
result_33557220 = [src_33557210[0], src_33557210[1]];
|
|
}
|
|
|
|
break;
|
|
case 19:
|
|
if (dest_33557209 === null || dest_33557209 === undefined) {
|
|
dest_33557209 = {};
|
|
}
|
|
else {
|
|
for (var key in dest_33557209) { delete dest_33557209[key]; }
|
|
}
|
|
for (var key in src_33557210) { dest_33557209[key] = src_33557210[key]; }
|
|
result_33557220 = dest_33557209;
|
|
|
|
break;
|
|
case 18:
|
|
case 17:
|
|
if (!((ti_33557211.base == null))) {
|
|
result_33557220 = nimCopy(dest_33557209, src_33557210, ti_33557211.base);
|
|
}
|
|
else {
|
|
if ((ti_33557211.kind == 17)) {
|
|
result_33557220 = (dest_33557209 === null || dest_33557209 === undefined) ? {m_type: ti_33557211} : dest_33557209;
|
|
}
|
|
else {
|
|
result_33557220 = (dest_33557209 === null || dest_33557209 === undefined) ? {} : dest_33557209;
|
|
}
|
|
}
|
|
nimCopyAux(result_33557220, src_33557210, ti_33557211.node);
|
|
break;
|
|
case 4:
|
|
case 16:
|
|
if(ArrayBuffer.isView(src_33557210)) {
|
|
if(dest_33557209 === null || dest_33557209 === undefined || dest_33557209.length != src_33557210.length) {
|
|
dest_33557209 = new src_33557210.constructor(src_33557210);
|
|
} else {
|
|
dest_33557209.set(src_33557210, 0);
|
|
}
|
|
result_33557220 = dest_33557209;
|
|
} else {
|
|
if (src_33557210 === null) {
|
|
result_33557220 = null;
|
|
}
|
|
else {
|
|
if (dest_33557209 === null || dest_33557209 === undefined || dest_33557209.length != src_33557210.length) {
|
|
dest_33557209 = new Array(src_33557210.length);
|
|
}
|
|
result_33557220 = dest_33557209;
|
|
for (var i = 0; i < src_33557210.length; ++i) {
|
|
result_33557220[i] = nimCopy(result_33557220[i], src_33557210[i], ti_33557211.base);
|
|
}
|
|
}
|
|
}
|
|
|
|
break;
|
|
case 24:
|
|
case 27:
|
|
if (src_33557210 === null) {
|
|
result_33557220 = null;
|
|
}
|
|
else {
|
|
if (dest_33557209 === null || dest_33557209 === undefined || dest_33557209.length != src_33557210.length) {
|
|
dest_33557209 = new Array(src_33557210.length);
|
|
}
|
|
result_33557220 = dest_33557209;
|
|
for (var i = 0; i < src_33557210.length; ++i) {
|
|
result_33557220[i] = nimCopy(result_33557220[i], src_33557210[i], ti_33557211.base);
|
|
}
|
|
}
|
|
|
|
break;
|
|
case 28:
|
|
if (src_33557210 !== null) {
|
|
result_33557220 = src_33557210.slice(0);
|
|
}
|
|
|
|
break;
|
|
default:
|
|
result_33557220 = src_33557210;
|
|
break;
|
|
}
|
|
|
|
return result_33557220;
|
|
|
|
}
|
|
|
|
function chckIndx(i_33557257, a_33557258, b_33557259) {
|
|
var result_33557260 = 0;
|
|
|
|
BeforeRet: {
|
|
if (((a_33557258 <= i_33557257) && (i_33557257 <= b_33557259))) {
|
|
result_33557260 = i_33557257;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
raiseIndexError(i_33557257, a_33557258, b_33557259);
|
|
}
|
|
|
|
};
|
|
|
|
return result_33557260;
|
|
|
|
}
|
|
|
|
function makeNimstrLit(c_33556848) {
|
|
var result = [];
|
|
for (var i = 0; i < c_33556848.length; ++i) {
|
|
result[i] = c_33556848.charCodeAt(i);
|
|
}
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function subInt(a_33557001, b_33557002) {
|
|
var result = a_33557001 - b_33557002;
|
|
checkOverflowInt(result);
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
function cstrToNimstr(c_33556851) {
|
|
var ln = c_33556851.length;
|
|
var result = new Array(ln);
|
|
var r = 0;
|
|
for (var i = 0; i < ln; ++i) {
|
|
var ch = c_33556851.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_33556851.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_33557005, b_33557006) {
|
|
var result = a_33557005 * b_33557006;
|
|
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_33557055, b_33557056) {
|
|
var Temporary1;
|
|
|
|
var result_33557057 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((b_33557056 <= a_33557055)) {
|
|
Temporary1 = a_33557055;
|
|
}
|
|
else {
|
|
Temporary1 = b_33557056;
|
|
}
|
|
|
|
result_33557057 = Temporary1;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557057;
|
|
|
|
}
|
|
|
|
function nimMin(a_33557051, b_33557052) {
|
|
var Temporary1;
|
|
|
|
var result_33557053 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((a_33557051 <= b_33557052)) {
|
|
Temporary1 = a_33557051;
|
|
}
|
|
else {
|
|
Temporary1 = b_33557052;
|
|
}
|
|
|
|
result_33557053 = Temporary1;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557053;
|
|
|
|
}
|
|
|
|
function addChar(x_33557344, c_33557345) {
|
|
x_33557344.push(c_33557345);
|
|
|
|
|
|
}
|
|
var objectID_1191182507 = [0];
|
|
|
|
function setTheme(theme_553648134) {
|
|
document.documentElement.setAttribute("data-theme", theme_553648134);
|
|
window.localStorage.setItem("theme", theme_553648134);
|
|
|
|
|
|
}
|
|
|
|
function add_33556386(x_33556387, x_33556387_Idx, y_33556388) {
|
|
if (x_33556387[x_33556387_Idx] === null) { x_33556387[x_33556387_Idx] = []; }
|
|
var off = x_33556387[x_33556387_Idx].length;
|
|
x_33556387[x_33556387_Idx].length += y_33556388.length;
|
|
for (var i = 0; i < y_33556388.length; ++i) {
|
|
x_33556387[x_33556387_Idx][off+i] = y_33556388.charCodeAt(i);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function newSeq_33556872(len_33556874) {
|
|
var result_33556875 = [];
|
|
|
|
result_33556875 = new Array(len_33556874); for (var i = 0 ; i < len_33556874 ; ++i) { result_33556875[i] = null; }
|
|
return result_33556875;
|
|
|
|
}
|
|
|
|
function unhandledException(e_33556638) {
|
|
var buf_33556639 = [[]];
|
|
if (!(((e_33556638.message).length == 0))) {
|
|
buf_33556639[0].push.apply(buf_33556639[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]);;
|
|
buf_33556639[0].push.apply(buf_33556639[0], e_33556638.message);;
|
|
}
|
|
else {
|
|
buf_33556639[0].push.apply(buf_33556639[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]);;
|
|
}
|
|
|
|
buf_33556639[0].push.apply(buf_33556639[0], [32,91]);;
|
|
add_33556386(buf_33556639, 0, e_33556638.name);
|
|
buf_33556639[0].push.apply(buf_33556639[0], [93,10]);;
|
|
var cbuf_33556640 = toJSStr(buf_33556639[0]);
|
|
if (typeof(Error) !== "undefined") {
|
|
throw new Error(cbuf_33556640);
|
|
}
|
|
else {
|
|
throw cbuf_33556640;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
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: NTI134217743, name: null, trace: [], up: null}, "OverflowDefect");
|
|
|
|
|
|
}
|
|
|
|
function checkOverflowInt(a_33556995) {
|
|
if (a_33556995 > 2147483647 || a_33556995 < -2147483648) raiseOverflow();
|
|
|
|
|
|
|
|
}
|
|
|
|
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: NTI134217751, name: null, trace: [], up: null}, "RangeDefect");
|
|
|
|
|
|
}
|
|
|
|
function addChars_301990072(result_301990074, result_301990074_Idx, x_301990075, start_301990076, n_301990077) {
|
|
var Temporary1;
|
|
|
|
var old_301990078 = (result_301990074[result_301990074_Idx]).length;
|
|
if (result_301990074[result_301990074_Idx].length < (Temporary1 = chckRange(addInt(old_301990078, n_301990077), 0, 2147483647), Temporary1)) { for (var i = result_301990074[result_301990074_Idx].length; i < Temporary1; ++i) result_301990074[result_301990074_Idx].push(0); }
|
|
else {result_301990074[result_301990074_Idx].length = Temporary1; };
|
|
Label2: {
|
|
var iHEX60gensym4_301990092 = 0;
|
|
var i_553649223 = 0;
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(i_553649223 < n_301990077)) break Label4;
|
|
iHEX60gensym4_301990092 = i_553649223;
|
|
result_301990074[result_301990074_Idx][chckIndx(addInt(old_301990078, iHEX60gensym4_301990092), 0, (result_301990074[result_301990074_Idx]).length - 1)] = x_301990075.charCodeAt(chckIndx(addInt(start_301990076, iHEX60gensym4_301990092), 0, (x_301990075).length - 1));
|
|
i_553649223 = addInt(i_553649223, 1);
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function addChars_301990068(result_301990070, result_301990070_Idx, x_301990071) {
|
|
addChars_301990072(result_301990070, result_301990070_Idx, x_301990071, 0, ((x_301990071) == null ? 0 : (x_301990071).length));
|
|
|
|
|
|
}
|
|
|
|
function addInt_301990093(result_301990094, result_301990094_Idx, x_301990095) {
|
|
addChars_301990068(result_301990094, result_301990094_Idx, ((x_301990095) + ""));
|
|
|
|
|
|
}
|
|
|
|
function addInt_301990111(result_301990112, result_301990112_Idx, x_301990113) {
|
|
addInt_301990093(result_301990112, result_301990112_Idx, x_301990113);
|
|
|
|
|
|
}
|
|
|
|
function HEX24_385875976(x_385875977) {
|
|
var result_385875978 = [[]];
|
|
|
|
addInt_301990111(result_385875978, 0, x_385875977);
|
|
|
|
return result_385875978[0];
|
|
|
|
}
|
|
|
|
function isFatPointer_33557200(ti_33557201) {
|
|
var result_33557202 = false;
|
|
|
|
BeforeRet: {
|
|
result_33557202 = !((ConstSet1[ti_33557201.base.kind] != undefined));
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_33557202;
|
|
|
|
}
|
|
|
|
function nimCopyAux(dest_33557213, src_33557214, n_33557215) {
|
|
switch (n_33557215.kind) {
|
|
case 0:
|
|
break;
|
|
case 1:
|
|
dest_33557213[n_33557215.offset] = nimCopy(dest_33557213[n_33557215.offset], src_33557214[n_33557215.offset], n_33557215.typ);
|
|
|
|
break;
|
|
case 2:
|
|
for (var i = 0; i < n_33557215.sons.length; i++) {
|
|
nimCopyAux(dest_33557213, src_33557214, n_33557215.sons[i]);
|
|
}
|
|
|
|
break;
|
|
case 3:
|
|
dest_33557213[n_33557215.offset] = nimCopy(dest_33557213[n_33557215.offset], src_33557214[n_33557215.offset], n_33557215.typ);
|
|
for (var i = 0; i < n_33557215.sons.length; ++i) {
|
|
nimCopyAux(dest_33557213, src_33557214, n_33557215.sons[i][1]);
|
|
}
|
|
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
function raiseIndexError(i_33556777, a_33556778, b_33556779) {
|
|
var Temporary1;
|
|
|
|
if ((b_33556779 < a_33556778)) {
|
|
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_385875976(i_33556777) || [],[32,110,111,116,32,105,110,32] || [],HEX24_385875976(a_33556778) || [],[32,46,46,32] || [],HEX24_385875976(b_33556779) || []);
|
|
}
|
|
|
|
raiseException({message: nimCopy(null, Temporary1, NTI33554449), parent: null, m_type: NTI134217749, name: null, trace: [], up: null}, "IndexDefect");
|
|
|
|
|
|
}
|
|
|
|
function sysFatal_268435497(message_268435500) {
|
|
raiseException({message: nimCopy(null, message_268435500, NTI33554449), m_type: NTI134217745, parent: null, name: null, trace: [], up: null}, "AssertionDefect");
|
|
|
|
|
|
}
|
|
|
|
function raiseAssert_268435495(msg_268435496) {
|
|
sysFatal_268435497(msg_268435496);
|
|
|
|
|
|
}
|
|
|
|
function failedAssertImpl_268435531(msg_268435532) {
|
|
raiseAssert_268435495(msg_268435532);
|
|
|
|
|
|
}
|
|
|
|
function onDOMLoaded(e_553648163) {
|
|
|
|
function HEX3Aanonymous_553648187(event_553648188) {
|
|
event_553648188.target.parentNode.style.display = "none";
|
|
event_553648188.target.parentNode.nextSibling.style.display = "inline";
|
|
|
|
|
|
}
|
|
|
|
document.getElementById("theme-select").value = window.localStorage.getItem("theme");
|
|
Label1: {
|
|
var pragmaDots_553648186 = null;
|
|
var colontmp__553649214 = [];
|
|
colontmp__553649214 = document.getElementsByClassName("pragmadots");
|
|
var i_553649216 = 0;
|
|
var L_553649217 = (colontmp__553649214).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649216 < L_553649217)) break Label3;
|
|
pragmaDots_553648186 = colontmp__553649214[chckIndx(i_553649216, 0, (colontmp__553649214).length - 1)];
|
|
pragmaDots_553648186.onclick = HEX3Aanonymous_553648187;
|
|
i_553649216 = addInt(i_553649216, 1);
|
|
if (!(((colontmp__553649214).length == L_553649217))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function isWhitespace_553648498(x_553648499) {
|
|
var result_553648500 = false;
|
|
|
|
result_553648500 = (((x_553648499.nodeName == "#text") && !/\S/.test(x_553648499.textContent)) || (x_553648499.nodeName == "#comment"));
|
|
|
|
return result_553648500;
|
|
|
|
}
|
|
|
|
function toToc_553648501(x_553648502, father_553648503) {
|
|
var Temporary5;
|
|
var Temporary6;
|
|
var Temporary7;
|
|
var Temporary8;
|
|
var Temporary15;
|
|
|
|
if ((x_553648502.nodeName == "UL")) {
|
|
var f_553648511 = {heading: null, kids: [], sortId: (father_553648503.kids).length, doSort: false};
|
|
var i_553648512 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!(i_553648512 < x_553648502.childNodes.length)) break Label2;
|
|
var nxt_553648513 = addInt(i_553648512, 1);
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(nxt_553648513 < x_553648502.childNodes.length)) Temporary5 = false; else { Temporary5 = isWhitespace_553648498(x_553648502.childNodes[nxt_553648513]); } if (!Temporary5) break Label4;
|
|
nxt_553648513 = addInt(nxt_553648513, 1);
|
|
}
|
|
};
|
|
if (!(nxt_553648513 < x_553648502.childNodes.length)) Temporary8 = false; else { Temporary8 = (x_553648502.childNodes[i_553648512].nodeName == "LI"); } if (!Temporary8) Temporary7 = false; else { Temporary7 = (x_553648502.childNodes[i_553648512].childNodes.length == 1); } if (!Temporary7) Temporary6 = false; else { Temporary6 = (x_553648502.childNodes[nxt_553648513].nodeName == "UL"); } if (Temporary6) {
|
|
var e_553648526 = {heading: x_553648502.childNodes[i_553648512].childNodes[0], kids: [], sortId: (f_553648511.kids).length, doSort: false};
|
|
var it_553648527 = x_553648502.childNodes[nxt_553648513];
|
|
Label9: {
|
|
var j_553648532 = 0;
|
|
var colontmp__553649230 = 0;
|
|
colontmp__553649230 = it_553648527.childNodes.length;
|
|
var i_553649231 = 0;
|
|
Label10: {
|
|
Label11: while (true) {
|
|
if (!(i_553649231 < colontmp__553649230)) break Label11;
|
|
j_553648532 = i_553649231;
|
|
toToc_553648501(it_553648527.childNodes[j_553648532], e_553648526);
|
|
i_553649231 = addInt(i_553649231, 1);
|
|
}
|
|
};
|
|
};
|
|
f_553648511.kids.push(e_553648526);;
|
|
i_553648512 = addInt(nxt_553648513, 1);
|
|
}
|
|
else {
|
|
toToc_553648501(x_553648502.childNodes[i_553648512], f_553648511);
|
|
i_553648512 = addInt(i_553648512, 1);
|
|
}
|
|
|
|
}
|
|
};
|
|
father_553648503.kids.push(f_553648511);;
|
|
}
|
|
else {
|
|
if (isWhitespace_553648498(x_553648502)) {
|
|
}
|
|
else {
|
|
if ((x_553648502.nodeName == "LI")) {
|
|
var idx_553648550 = [];
|
|
Label12: {
|
|
var i_553648555 = 0;
|
|
var colontmp__553649234 = 0;
|
|
colontmp__553649234 = x_553648502.childNodes.length;
|
|
var i_553649235 = 0;
|
|
Label13: {
|
|
Label14: while (true) {
|
|
if (!(i_553649235 < colontmp__553649234)) break Label14;
|
|
i_553648555 = i_553649235;
|
|
if (!(isWhitespace_553648498(x_553648502.childNodes[i_553648555]))) {
|
|
idx_553648550.push(i_553648555);;
|
|
}
|
|
|
|
i_553649235 = addInt(i_553649235, 1);
|
|
}
|
|
};
|
|
};
|
|
if (!((idx_553648550).length == 2)) Temporary15 = false; else { Temporary15 = (x_553648502.childNodes[idx_553648550[chckIndx(1, 0, (idx_553648550).length - 1)]].nodeName == "UL"); } if (Temporary15) {
|
|
var e_553648571 = {heading: x_553648502.childNodes[idx_553648550[chckIndx(0, 0, (idx_553648550).length - 1)]], kids: [], sortId: (father_553648503.kids).length, doSort: false};
|
|
var it_553648572 = x_553648502.childNodes[idx_553648550[chckIndx(1, 0, (idx_553648550).length - 1)]];
|
|
Label16: {
|
|
var j_553648577 = 0;
|
|
var colontmp__553649238 = 0;
|
|
colontmp__553649238 = it_553648572.childNodes.length;
|
|
var i_553649239 = 0;
|
|
Label17: {
|
|
Label18: while (true) {
|
|
if (!(i_553649239 < colontmp__553649238)) break Label18;
|
|
j_553648577 = i_553649239;
|
|
toToc_553648501(it_553648572.childNodes[j_553648577], e_553648571);
|
|
i_553649239 = addInt(i_553649239, 1);
|
|
}
|
|
};
|
|
};
|
|
father_553648503.kids.push(e_553648571);;
|
|
}
|
|
else {
|
|
Label19: {
|
|
var i_553648586 = 0;
|
|
var colontmp__553649242 = 0;
|
|
colontmp__553649242 = x_553648502.childNodes.length;
|
|
var i_553649243 = 0;
|
|
Label20: {
|
|
Label21: while (true) {
|
|
if (!(i_553649243 < colontmp__553649242)) break Label21;
|
|
i_553648586 = i_553649243;
|
|
toToc_553648501(x_553648502.childNodes[i_553648586], father_553648503);
|
|
i_553649243 = addInt(i_553649243, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
}
|
|
else {
|
|
father_553648503.kids.push({heading: x_553648502, kids: [], sortId: (father_553648503.kids).length, doSort: false});;
|
|
}
|
|
}}
|
|
|
|
|
|
}
|
|
|
|
function extractItems_553648309(x_553648310, heading_553648311, items_553648312, items_553648312_Idx) {
|
|
BeforeRet: {
|
|
if ((x_553648310 == null)) {
|
|
break BeforeRet;
|
|
}
|
|
|
|
if ((!((x_553648310.heading == null)) && (x_553648310.heading.textContent == heading_553648311))) {
|
|
Label1: {
|
|
var i_553648329 = 0;
|
|
var colontmp__553649246 = 0;
|
|
colontmp__553649246 = (x_553648310.kids).length;
|
|
var i_553649247 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649247 < colontmp__553649246)) break Label3;
|
|
i_553648329 = i_553649247;
|
|
items_553648312[items_553648312_Idx].push(x_553648310.kids[chckIndx(i_553648329, 0, (x_553648310.kids).length - 1)].heading);;
|
|
i_553649247 = addInt(i_553649247, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
else {
|
|
Label4: {
|
|
var k_553648355 = null;
|
|
var i_553649251 = 0;
|
|
var L_553649252 = (x_553648310.kids).length;
|
|
Label5: {
|
|
Label6: while (true) {
|
|
if (!(i_553649251 < L_553649252)) break Label6;
|
|
k_553648355 = x_553648310.kids[chckIndx(i_553649251, 0, (x_553648310.kids).length - 1)];
|
|
extractItems_553648309(k_553648355, heading_553648311, items_553648312, items_553648312_Idx);
|
|
i_553649251 = addInt(i_553649251, 1);
|
|
if (!(((x_553648310.kids).length == L_553649252))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
function tree_553648240(tag_553648241, kids_553648242) {
|
|
var result_553648243 = null;
|
|
|
|
result_553648243 = document.createElement(tag_553648241);
|
|
Label1: {
|
|
var k_553648257 = null;
|
|
var i_553649264 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649264 < (kids_553648242).length)) break Label3;
|
|
k_553648257 = kids_553648242[chckIndx(i_553649264, 0, (kids_553648242).length - 1)];
|
|
result_553648243.appendChild(k_553648257);
|
|
i_553649264 = addInt(i_553649264, 1);
|
|
}
|
|
};
|
|
};
|
|
|
|
return result_553648243;
|
|
|
|
}
|
|
|
|
function text_553648265(s_553648266) {
|
|
var result_553648267 = null;
|
|
|
|
result_553648267 = document.createTextNode(s_553648266);
|
|
|
|
return result_553648267;
|
|
|
|
}
|
|
|
|
function uncovered_553648675(x_553648676) {
|
|
var Temporary1;
|
|
|
|
var result_553648677 = null;
|
|
|
|
BeforeRet: {
|
|
if ((((x_553648676.kids).length == 0) && !((x_553648676.heading == null)))) {
|
|
if (!(x_553648676.heading.hasOwnProperty('__karaxMarker__'))) {
|
|
Temporary1 = x_553648676;
|
|
}
|
|
else {
|
|
Temporary1 = null;
|
|
}
|
|
|
|
result_553648677 = Temporary1;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_553648677 = {heading: x_553648676.heading, kids: [], sortId: x_553648676.sortId, doSort: x_553648676.doSort};
|
|
Label2: {
|
|
var k_553648692 = null;
|
|
var i_553649271 = 0;
|
|
var L_553649272 = (x_553648676.kids).length;
|
|
Label3: {
|
|
Label4: while (true) {
|
|
if (!(i_553649271 < L_553649272)) break Label4;
|
|
k_553648692 = x_553648676.kids[chckIndx(i_553649271, 0, (x_553648676.kids).length - 1)];
|
|
var y_553648693 = uncovered_553648675(k_553648692);
|
|
if (!((y_553648693 == null))) {
|
|
result_553648677.kids.push(y_553648693);;
|
|
}
|
|
|
|
i_553649271 = addInt(i_553649271, 1);
|
|
if (!(((x_553648676.kids).length == L_553649272))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
if (((result_553648677.kids).length == 0)) {
|
|
result_553648677 = null;
|
|
}
|
|
|
|
};
|
|
|
|
return result_553648677;
|
|
|
|
}
|
|
|
|
function mergeTocs_553648705(orig_553648706, news_553648707) {
|
|
var result_553648708 = null;
|
|
|
|
result_553648708 = uncovered_553648675(orig_553648706);
|
|
if ((result_553648708 == null)) {
|
|
result_553648708 = news_553648707;
|
|
}
|
|
else {
|
|
Label1: {
|
|
var i_553648720 = 0;
|
|
var colontmp__553649267 = 0;
|
|
colontmp__553649267 = (news_553648707.kids).length;
|
|
var i_553649268 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649268 < colontmp__553649267)) break Label3;
|
|
i_553648720 = i_553649268;
|
|
result_553648708.kids.push(news_553648707.kids[chckIndx(i_553648720, 0, (news_553648707.kids).length - 1)]);;
|
|
i_553649268 = addInt(i_553649268, 1);
|
|
}
|
|
};
|
|
};
|
|
}
|
|
|
|
|
|
return result_553648708;
|
|
|
|
}
|
|
|
|
function buildToc_553648725(orig_553648726, types_553648727, procs_553648728) {
|
|
var result_553648729 = null;
|
|
|
|
var newStuff_553648734 = {heading: null, kids: [], doSort: true, sortId: 0};
|
|
Label1: {
|
|
var t_553648738 = null;
|
|
var i_553649259 = 0;
|
|
var L_553649260 = (types_553648727).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649259 < L_553649260)) break Label3;
|
|
t_553648738 = types_553648727[chckIndx(i_553649259, 0, (types_553648727).length - 1)];
|
|
var c_553648743 = {heading: t_553648738.cloneNode(true), kids: [], doSort: true, sortId: 0};
|
|
t_553648738.__karaxMarker__ = true;
|
|
Label4: {
|
|
var p_553648747 = null;
|
|
var i_553649256 = 0;
|
|
var L_553649257 = (procs_553648728).length;
|
|
Label5: {
|
|
Label6: while (true) {
|
|
if (!(i_553649256 < L_553649257)) break Label6;
|
|
p_553648747 = procs_553648728[chckIndx(i_553649256, 0, (procs_553648728).length - 1)];
|
|
if (!(p_553648747.hasOwnProperty('__karaxMarker__'))) {
|
|
var xx_553648748 = p_553648747.parentNode.getElementsByClassName("attachedType");
|
|
if ((((xx_553648748).length == 1) && (xx_553648748[chckIndx(0, 0, (xx_553648748).length - 1)].textContent == t_553648738.textContent))) {
|
|
var q_553648753 = tree_553648240("A", [text_553648265(p_553648747.title)]);
|
|
q_553648753.setAttribute("href", p_553648747.getAttribute("href"));
|
|
c_553648743.kids.push({heading: q_553648753, kids: [], sortId: 0, doSort: false});;
|
|
p_553648747.__karaxMarker__ = true;
|
|
}
|
|
|
|
}
|
|
|
|
i_553649256 = addInt(i_553649256, 1);
|
|
if (!(((procs_553648728).length == L_553649257))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
newStuff_553648734.kids.push(c_553648743);;
|
|
i_553649259 = addInt(i_553649259, 1);
|
|
if (!(((types_553648727).length == L_553649260))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
result_553648729 = mergeTocs_553648705(orig_553648726, newStuff_553648734);
|
|
|
|
return result_553648729;
|
|
|
|
}
|
|
|
|
function add_553648258(parent_553648259, kid_553648260) {
|
|
if (((parent_553648259.nodeName == "TR") && ((kid_553648260.nodeName == "TD") || (kid_553648260.nodeName == "TH")))) {
|
|
var k_553648261 = document.createElement("TD");
|
|
k_553648261.appendChild(kid_553648260);
|
|
parent_553648259.appendChild(k_553648261);
|
|
}
|
|
else {
|
|
parent_553648259.appendChild(kid_553648260);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function setClass_553648262(e_553648263, value_553648264) {
|
|
e_553648263.setAttribute("class", value_553648264);
|
|
|
|
|
|
}
|
|
|
|
function toHtml_553648382(x_553648383, isRoot_553648384) {
|
|
|
|
function HEX3Aanonymous_553648402(a_553648403, b_553648404) {
|
|
var result_553648405 = 0;
|
|
|
|
BeforeRet: {
|
|
if ((!((a_553648403.heading == null)) && !((b_553648404.heading == null)))) {
|
|
var x_553648414 = a_553648403.heading.textContent;
|
|
var y_553648415 = b_553648404.heading.textContent;
|
|
if ((x_553648414 < y_553648415)) {
|
|
result_553648405 = -1;
|
|
break BeforeRet;
|
|
}
|
|
|
|
if ((y_553648415 < x_553648414)) {
|
|
result_553648405 = 1;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_553648405 = 0;
|
|
break BeforeRet;
|
|
}
|
|
else {
|
|
result_553648405 = subInt(a_553648403.sortId, b_553648404.sortId);
|
|
break BeforeRet;
|
|
}
|
|
|
|
};
|
|
|
|
return result_553648405;
|
|
|
|
}
|
|
|
|
var result_553648385 = null;
|
|
|
|
BeforeRet: {
|
|
if ((x_553648383 == null)) {
|
|
result_553648385 = null;
|
|
break BeforeRet;
|
|
}
|
|
|
|
if (((x_553648383.kids).length == 0)) {
|
|
if ((x_553648383.heading == null)) {
|
|
result_553648385 = null;
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_553648385 = x_553648383.heading.cloneNode(true);
|
|
break BeforeRet;
|
|
}
|
|
|
|
result_553648385 = tree_553648240("DIV", []);
|
|
if ((!((x_553648383.heading == null)) && !(x_553648383.heading.hasOwnProperty('__karaxMarker__')))) {
|
|
add_553648258(result_553648385, x_553648383.heading.cloneNode(true));
|
|
}
|
|
|
|
var ul_553648401 = tree_553648240("UL", []);
|
|
if (isRoot_553648384) {
|
|
setClass_553648262(ul_553648401, "simple simple-toc");
|
|
}
|
|
else {
|
|
setClass_553648262(ul_553648401, "simple");
|
|
}
|
|
|
|
if (x_553648383.doSort) {
|
|
x_553648383.kids.sort(HEX3Aanonymous_553648402);
|
|
}
|
|
|
|
Label1: {
|
|
var k_553648427 = null;
|
|
var i_553649275 = 0;
|
|
var L_553649276 = (x_553648383.kids).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649275 < L_553649276)) break Label3;
|
|
k_553648427 = x_553648383.kids[chckIndx(i_553649275, 0, (x_553648383.kids).length - 1)];
|
|
var y_553648428 = toHtml_553648382(k_553648427, false);
|
|
if (!((y_553648428 == null))) {
|
|
add_553648258(ul_553648401, tree_553648240("LI", [y_553648428]));
|
|
}
|
|
|
|
i_553649275 = addInt(i_553649275, 1);
|
|
if (!(((x_553648383.kids).length == L_553649276))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
if (!((ul_553648401.childNodes.length == 0))) {
|
|
add_553648258(result_553648385, ul_553648401);
|
|
}
|
|
|
|
if ((result_553648385.childNodes.length == 0)) {
|
|
result_553648385 = null;
|
|
}
|
|
|
|
};
|
|
|
|
return result_553648385;
|
|
|
|
}
|
|
|
|
function replaceById_553648268(id_553648269, newTree_553648270) {
|
|
var x_553648271 = document.getElementById(id_553648269);
|
|
x_553648271.parentNode.replaceChild(newTree_553648270, x_553648271);
|
|
newTree_553648270.id = id_553648269;
|
|
|
|
|
|
}
|
|
|
|
function togglevis_553648780(d_553648781) {
|
|
if ((d_553648781.style.display == "none")) {
|
|
d_553648781.style.display = "inline";
|
|
}
|
|
else {
|
|
d_553648781.style.display = "none";
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
function groupBy(value_553648783) {
|
|
var toc_553648784 = document.getElementById("toc-list");
|
|
if ((alternative_553648779[0] == null)) {
|
|
var tt_553648792 = {heading: null, kids: [], sortId: 0, doSort: false};
|
|
toToc_553648501(toc_553648784, tt_553648792);
|
|
tt_553648792 = tt_553648792.kids[chckIndx(0, 0, (tt_553648792.kids).length - 1)];
|
|
var types_553648797 = [[]];
|
|
var procs_553648802 = [[]];
|
|
extractItems_553648309(tt_553648792, "Types", types_553648797, 0);
|
|
extractItems_553648309(tt_553648792, "Procs", procs_553648802, 0);
|
|
extractItems_553648309(tt_553648792, "Converters", procs_553648802, 0);
|
|
extractItems_553648309(tt_553648792, "Methods", procs_553648802, 0);
|
|
extractItems_553648309(tt_553648792, "Templates", procs_553648802, 0);
|
|
extractItems_553648309(tt_553648792, "Macros", procs_553648802, 0);
|
|
extractItems_553648309(tt_553648792, "Iterators", procs_553648802, 0);
|
|
var ntoc_553648803 = buildToc_553648725(tt_553648792, types_553648797[0], procs_553648802[0]);
|
|
var x_553648804 = toHtml_553648382(ntoc_553648803, true);
|
|
alternative_553648779[0] = tree_553648240("DIV", [x_553648804]);
|
|
}
|
|
|
|
if ((value_553648783 == "type")) {
|
|
replaceById_553648268("tocRoot", alternative_553648779[0]);
|
|
}
|
|
else {
|
|
replaceById_553648268("tocRoot", tree_553648240("DIV", []));
|
|
}
|
|
|
|
togglevis_553648780(document.getElementById("toc-list"));
|
|
|
|
|
|
}
|
|
|
|
function HEX5BHEX5D_721421595(s_721421598, x_721421599) {
|
|
var result_721421600 = [];
|
|
|
|
var a_721421602 = x_721421599.a;
|
|
var L_721421604 = addInt(subInt(subInt((s_721421598).length, x_721421599.b), a_721421602), 1);
|
|
result_721421600 = nimCopy(null, mnewString(chckRange(L_721421604, 0, 2147483647)), NTI33554449);
|
|
Label1: {
|
|
var i_721421609 = 0;
|
|
var i_553649285 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649285 < L_721421604)) break Label3;
|
|
i_721421609 = i_553649285;
|
|
result_721421600[chckIndx(i_721421609, 0, (result_721421600).length - 1)] = s_721421598[chckIndx(addInt(i_721421609, a_721421602), 0, (s_721421598).length - 1)];
|
|
i_553649285 = addInt(i_553649285, 1);
|
|
}
|
|
};
|
|
};
|
|
|
|
return result_721421600;
|
|
|
|
}
|
|
|
|
function HEX2EHEX2E_956301412(a_956301415, b_956301416) {
|
|
var result_956301419 = ({a: 0, b: 0});
|
|
|
|
result_956301419 = nimCopy(result_956301419, {a: a_956301415, b: b_956301416}, NTI956301398);
|
|
|
|
return result_956301419;
|
|
|
|
}
|
|
async function loadIndex_553648977() {
|
|
var result_553648979 = null;
|
|
|
|
BeforeRet: {
|
|
var indexURL_553648985 = document.getElementById("indexLink").getAttribute("href");
|
|
var rootURL_553649011 = HEX5BHEX5D_721421595(cstrToNimstr(indexURL_553648985), HEX2EHEX2E_956301412(0, 14));
|
|
var resp_553649023 = (await (await fetch(indexURL_553648985)).text());
|
|
var indexElem_553649024 = document.createElement("div");
|
|
indexElem_553649024.innerHTML = resp_553649023;
|
|
Label1: {
|
|
var href_553649046 = null;
|
|
var colontmp__553649279 = [];
|
|
colontmp__553649279 = indexElem_553649024.getElementsByClassName("reference");
|
|
var i_553649281 = 0;
|
|
var L_553649282 = (colontmp__553649279).length;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649281 < L_553649282)) break Label3;
|
|
href_553649046 = colontmp__553649279[chckIndx(i_553649281, 0, (colontmp__553649279).length - 1)];
|
|
href_553649046.setAttribute("href", toJSStr((rootURL_553649011 || []).concat(cstrToNimstr(href_553649046.getAttribute("href")) || [])));
|
|
db_553648818[0].push(href_553649046);;
|
|
contents_553648819[0].push(href_553649046.getAttribute("data-doc-search-tag"));;
|
|
i_553649281 = addInt(i_553649281, 1);
|
|
if (!(((colontmp__553649279).length == L_553649282))) {
|
|
failedAssertImpl_268435531(makeNimstrLit("iterators.nim(246, 11) `len(a) == L` the length of the seq changed while iterating over it"));
|
|
}
|
|
|
|
}
|
|
};
|
|
};
|
|
result_553648979 = undefined;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_553648979;
|
|
|
|
}
|
|
|
|
function then_553649140(future_553649143, onSuccess_553649144, onReject_553649145) {
|
|
var result_553649146 = null;
|
|
|
|
BeforeRet: {
|
|
var ret_553649156 = null;
|
|
ret_553649156 = future_553649143.then(onSuccess_553649144, onReject_553649145)
|
|
result_553649146 = ret_553649156;
|
|
break BeforeRet;
|
|
};
|
|
|
|
return result_553649146;
|
|
|
|
}
|
|
|
|
function nsuToLowerAsciiChar(c_721420372) {
|
|
var result_721420373 = 0;
|
|
|
|
if ((ConstSet2[c_721420372] != undefined)) {
|
|
result_721420373 = (c_721420372 ^ 32);
|
|
}
|
|
else {
|
|
result_721420373 = c_721420372;
|
|
}
|
|
|
|
|
|
return result_721420373;
|
|
|
|
}
|
|
|
|
function fuzzyMatch_704643088(pattern_704643089, str_704643090) {
|
|
var Temporary4;
|
|
var Temporary5;
|
|
var Temporary6;
|
|
var Temporary7;
|
|
var Temporary8;
|
|
|
|
var result_704643093 = {Field0: 0, Field1: false};
|
|
|
|
var scoreState_704643094 = -100;
|
|
var headerMatched_704643095 = false;
|
|
var unmatchedLeadingCharCount_704643096 = 0;
|
|
var consecutiveMatchCount_704643097 = 0;
|
|
var strIndex_704643098 = 0;
|
|
var patIndex_704643099 = 0;
|
|
var score_704643100 = 0;
|
|
Label1: {
|
|
Label2: while (true) {
|
|
if (!((strIndex_704643098 < ((str_704643090) == null ? 0 : (str_704643090).length)) && (patIndex_704643099 < ((pattern_704643089) == null ? 0 : (pattern_704643089).length)))) break Label2;
|
|
Label3: {
|
|
var patternChar_704643103 = nsuToLowerAsciiChar(pattern_704643089.charCodeAt(chckIndx(patIndex_704643099, 0, (pattern_704643089).length - 1)));
|
|
var strChar_704643104 = nsuToLowerAsciiChar(str_704643090.charCodeAt(chckIndx(strIndex_704643098, 0, (str_704643090).length - 1)));
|
|
if ((ConstSet3[patternChar_704643103] != undefined)) {
|
|
patIndex_704643099 = addInt(patIndex_704643099, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((ConstSet4[strChar_704643104] != undefined)) {
|
|
strIndex_704643098 = addInt(strIndex_704643098, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((!(headerMatched_704643095) && (strChar_704643104 == 58))) {
|
|
headerMatched_704643095 = true;
|
|
scoreState_704643094 = -100;
|
|
score_704643100 = ((Math.floor((0.5 * score_704643100))) | 0);
|
|
patIndex_704643099 = 0;
|
|
strIndex_704643098 = addInt(strIndex_704643098, 1);
|
|
break Label3;
|
|
}
|
|
|
|
if ((strChar_704643104 == patternChar_704643103)) {
|
|
switch (scoreState_704643094) {
|
|
case -100:
|
|
case 20:
|
|
scoreState_704643094 = 10;
|
|
break;
|
|
case 0:
|
|
scoreState_704643094 = 5;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
break;
|
|
case 10:
|
|
case 5:
|
|
consecutiveMatchCount_704643097 = addInt(consecutiveMatchCount_704643097, 1);
|
|
scoreState_704643094 = 5;
|
|
score_704643100 = addInt(score_704643100, mulInt(5, consecutiveMatchCount_704643097));
|
|
if ((scoreState_704643094 == 10)) {
|
|
score_704643100 = addInt(score_704643100, 10);
|
|
}
|
|
|
|
var onBoundary_704643156 = (patIndex_704643099 == ((pattern_704643089) == null ? -1 : (pattern_704643089).length - 1));
|
|
if ((!(onBoundary_704643156) && (strIndex_704643098 < ((str_704643090) == null ? -1 : (str_704643090).length - 1)))) {
|
|
var nextPatternChar_704643157 = nsuToLowerAsciiChar(pattern_704643089.charCodeAt(chckIndx(addInt(patIndex_704643099, 1), 0, (pattern_704643089).length - 1)));
|
|
var nextStrChar_704643158 = nsuToLowerAsciiChar(str_704643090.charCodeAt(chckIndx(addInt(strIndex_704643098, 1), 0, (str_704643090).length - 1)));
|
|
if (!!((ConstSet5[nextStrChar_704643158] != undefined))) Temporary4 = false; else { Temporary4 = !((nextStrChar_704643158 == nextPatternChar_704643157)); } onBoundary_704643156 = Temporary4;
|
|
}
|
|
|
|
if (onBoundary_704643156) {
|
|
scoreState_704643094 = 20;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
}
|
|
|
|
break;
|
|
case -1:
|
|
case -3:
|
|
if (!((ConstSet6[str_704643090.charCodeAt(chckIndx(subInt(strIndex_704643098, 1), 0, (str_704643090).length - 1))] != undefined))) Temporary5 = true; else { if (!(ConstSet7[str_704643090.charCodeAt(chckIndx(subInt(strIndex_704643098, 1), 0, (str_704643090).length - 1))] != undefined)) Temporary6 = false; else { Temporary6 = (ConstSet8[str_704643090.charCodeAt(chckIndx(strIndex_704643098, 0, (str_704643090).length - 1))] != undefined); } Temporary5 = Temporary6; } var isLeadingChar_704643182 = Temporary5;
|
|
if (isLeadingChar_704643182) {
|
|
scoreState_704643094 = 10;
|
|
}
|
|
else {
|
|
scoreState_704643094 = 0;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
}
|
|
|
|
break;
|
|
}
|
|
patIndex_704643099 = addInt(patIndex_704643099, 1);
|
|
}
|
|
else {
|
|
switch (scoreState_704643094) {
|
|
case -100:
|
|
scoreState_704643094 = -3;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
break;
|
|
case 5:
|
|
scoreState_704643094 = -1;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
consecutiveMatchCount_704643097 = 0;
|
|
break;
|
|
case -3:
|
|
if ((unmatchedLeadingCharCount_704643096 < 3)) {
|
|
scoreState_704643094 = -3;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
}
|
|
|
|
unmatchedLeadingCharCount_704643096 = addInt(unmatchedLeadingCharCount_704643096, 1);
|
|
break;
|
|
default:
|
|
scoreState_704643094 = -1;
|
|
score_704643100 = addInt(score_704643100, scoreState_704643094);
|
|
break;
|
|
}
|
|
}
|
|
|
|
strIndex_704643098 = addInt(strIndex_704643098, 1);
|
|
};
|
|
}
|
|
};
|
|
if (!(patIndex_704643099 == ((pattern_704643089) == null ? 0 : (pattern_704643089).length))) Temporary7 = false; else { if ((strIndex_704643098 == ((str_704643090) == null ? 0 : (str_704643090).length))) Temporary8 = true; else { Temporary8 = !((ConstSet9[str_704643090.charCodeAt(chckIndx(strIndex_704643098, 0, (str_704643090).length - 1))] != undefined)); } Temporary7 = Temporary8; } if (Temporary7) {
|
|
score_704643100 = addInt(score_704643100, 10);
|
|
}
|
|
|
|
var colontmp__553649299 = nimMax(0, score_704643100);
|
|
var colontmp__553649300 = (0 < score_704643100);
|
|
result_704643093 = nimCopy(result_704643093, {Field0: colontmp__553649299, Field1: colontmp__553649300}, NTI704643086);
|
|
|
|
return result_704643093;
|
|
|
|
}
|
|
|
|
function escapeCString_553648820(x_553648821, x_553648821_Idx) {
|
|
var s_553648822 = [];
|
|
Label1: {
|
|
var c_553648823 = 0;
|
|
var iHEX60gensym6_553649303 = 0;
|
|
var nHEX60gensym6_553649304 = ((x_553648821[x_553648821_Idx]) == null ? 0 : (x_553648821[x_553648821_Idx]).length);
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(iHEX60gensym6_553649303 < nHEX60gensym6_553649304)) break Label3;
|
|
c_553648823 = x_553648821[x_553648821_Idx].charCodeAt(chckIndx(iHEX60gensym6_553649303, 0, (x_553648821[x_553648821_Idx]).length - 1));
|
|
switch (c_553648823) {
|
|
case 60:
|
|
s_553648822.push.apply(s_553648822, [38,108,116,59]);;
|
|
break;
|
|
case 62:
|
|
s_553648822.push.apply(s_553648822, [38,103,116,59]);;
|
|
break;
|
|
default:
|
|
addChar(s_553648822, c_553648823);;
|
|
break;
|
|
}
|
|
iHEX60gensym6_553649303 = addInt(iHEX60gensym6_553649303, 1);
|
|
}
|
|
};
|
|
};
|
|
x_553648821[x_553648821_Idx] = toJSStr(s_553648822);
|
|
|
|
|
|
}
|
|
|
|
function dosearch_553648824(value_553648825) {
|
|
|
|
function HEX3Aanonymous_553648851(a_553648856, b_553648857) {
|
|
var result_553648862 = 0;
|
|
|
|
result_553648862 = subInt(b_553648857["Field1"], a_553648856["Field1"]);
|
|
|
|
return result_553648862;
|
|
|
|
}
|
|
|
|
var result_553648826 = null;
|
|
|
|
BeforeRet: {
|
|
if (((db_553648818[0]).length == 0)) {
|
|
break BeforeRet;
|
|
}
|
|
|
|
var ul_553648830 = tree_553648240("UL", []);
|
|
result_553648826 = tree_553648240("DIV", []);
|
|
setClass_553648262(result_553648826, "search_results");
|
|
var matches_553648835 = [];
|
|
Label1: {
|
|
var i_553648843 = 0;
|
|
var colontmp__553649289 = 0;
|
|
colontmp__553649289 = (db_553648818[0]).length;
|
|
var i_553649290 = 0;
|
|
Label2: {
|
|
Label3: while (true) {
|
|
if (!(i_553649290 < colontmp__553649289)) break Label3;
|
|
i_553648843 = i_553649290;
|
|
Label4: {
|
|
var c_553648844 = contents_553648819[0][chckIndx(i_553648843, 0, (contents_553648819[0]).length - 1)];
|
|
if (((c_553648844 == "Examples") || (c_553648844 == "PEG construction"))) {
|
|
break Label4;
|
|
}
|
|
|
|
var colontmp__553649296 = fuzzyMatch_704643088(value_553648825, c_553648844);
|
|
var score_553648845 = colontmp__553649296["Field0"];
|
|
var matched_553648846 = colontmp__553649296["Field1"];
|
|
if (matched_553648846) {
|
|
matches_553648835.push({Field0: db_553648818[0][chckIndx(i_553648843, 0, (db_553648818[0]).length - 1)], Field1: score_553648845});;
|
|
}
|
|
|
|
};
|
|
i_553649290 = addInt(i_553649290, 1);
|
|
}
|
|
};
|
|
};
|
|
matches_553648835.sort(HEX3Aanonymous_553648851);
|
|
Label5: {
|
|
var i_553648879 = 0;
|
|
var colontmp__553649293 = 0;
|
|
colontmp__553649293 = nimMin((matches_553648835).length, 29);
|
|
var i_553649294 = 0;
|
|
Label6: {
|
|
Label7: while (true) {
|
|
if (!(i_553649294 < colontmp__553649293)) break Label7;
|
|
i_553648879 = i_553649294;
|
|
matches_553648835[chckIndx(i_553648879, 0, (matches_553648835).length - 1)]["Field0"].innerHTML = matches_553648835[chckIndx(i_553648879, 0, (matches_553648835).length - 1)]["Field0"].getAttribute("data-doc-search-tag");
|
|
escapeCString_553648820(matches_553648835[chckIndx(i_553648879, 0, (matches_553648835).length - 1)]["Field0"], "innerHTML");
|
|
add_553648258(ul_553648830, tree_553648240("LI", [matches_553648835[chckIndx(i_553648879, 0, (matches_553648835).length - 1)]["Field0"]]));
|
|
i_553649294 = addInt(i_553649294, 1);
|
|
}
|
|
};
|
|
};
|
|
if ((ul_553648830.childNodes.length == 0)) {
|
|
add_553648258(result_553648826, tree_553648240("B", [text_553648265("no search results")]));
|
|
}
|
|
else {
|
|
add_553648258(result_553648826, tree_553648240("B", [text_553648265("search results")]));
|
|
add_553648258(result_553648826, ul_553648830);
|
|
}
|
|
|
|
};
|
|
|
|
return result_553648826;
|
|
|
|
}
|
|
|
|
function search() {
|
|
|
|
function wrapper_553649125() {
|
|
var elem_553649126 = document.getElementById("searchInput");
|
|
var value_553649127 = elem_553649126.value;
|
|
if (!((((value_553649127) == null ? 0 : (value_553649127).length) == 0))) {
|
|
if ((oldtoc_553649120[0] == null)) {
|
|
oldtoc_553649120[0] = document.getElementById("tocRoot");
|
|
}
|
|
|
|
var results_553649131 = dosearch_553648824(value_553649127);
|
|
replaceById_553648268("tocRoot", results_553649131);
|
|
}
|
|
else {
|
|
if (!((oldtoc_553649120[0] == null))) {
|
|
replaceById_553648268("tocRoot", oldtoc_553649120[0]);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
if ((loadIndexFut_553649123[0] == null)) {
|
|
loadIndexFut_553649123[0] = loadIndex_553648977();
|
|
var _ = then_553649140(loadIndexFut_553649123[0], wrapper_553649125, null);
|
|
}
|
|
|
|
if (!((timer_553649121[0] == null))) {
|
|
clearTimeout(timer_553649121[0]);
|
|
}
|
|
|
|
timer_553649121[0] = setTimeout(wrapper_553649125, 400);
|
|
|
|
|
|
}
|
|
|
|
function copyToClipboard() {
|
|
|
|
function updatePreTags() {
|
|
|
|
const allPreTags = document.querySelectorAll("pre")
|
|
|
|
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 t_553648161 = window.localStorage.getItem("theme");
|
|
if ((t_553648161 == null)) {
|
|
Temporary1 = "auto";
|
|
}
|
|
else {
|
|
Temporary1 = t_553648161;
|
|
}
|
|
|
|
setTheme(Temporary1);
|
|
var alternative_553648779 = [null];
|
|
var db_553648818 = [[]];
|
|
var contents_553648819 = [[]];
|
|
var oldtoc_553649120 = [null];
|
|
var timer_553649121 = [null];
|
|
var loadIndexFut_553649123 = [null];
|
|
copyToClipboard();
|
|
window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
|