dochack.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654
  1. /* Generated by the Nim Compiler v2.3.1 */
  2. var framePtr = null;
  3. var excHandler = 0;
  4. var lastJSError = null;
  5. var NTI33554466 = {size: 0,kind: 1,base: null,node: null,finalizer: null};
  6. var NTI704643086 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  7. var NTI33554435 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
  8. var NTI939524176 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
  9. var NTI939524183 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
  10. var NTI134217745 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  11. var NTI134217749 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  12. var NTI134217751 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  13. var NTI33555167 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  14. var NTI33555175 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
  15. var NTI33554450 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
  16. var NTI33555174 = {size: 0, kind: 22, base: null, node: null, finalizer: null};
  17. var NTI33555171 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  18. var NTI33555172 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  19. var NTI134217741 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  20. var NTI134217743 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
  21. var NTI33554449 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
  22. var NNI134217743 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  23. NTI134217743.node = NNI134217743;
  24. var NNI134217741 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  25. NTI134217741.node = NNI134217741;
  26. var NNI33555172 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  27. NTI33555172.node = NNI33555172;
  28. NTI33555174.base = NTI33555171;
  29. NTI33555175.base = NTI33555171;
  30. var NNI33555171 = {kind: 2, len: 5, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI33555174, name: "parent", sons: null},
  31. {kind: 1, offset: "name", len: 0, typ: NTI33554450, name: "name", sons: null},
  32. {kind: 1, offset: "message", len: 0, typ: NTI33554449, name: "msg", sons: null},
  33. {kind: 1, offset: "trace", len: 0, typ: NTI33554449, name: "trace", sons: null},
  34. {kind: 1, offset: "up", len: 0, typ: NTI33555175, name: "up", sons: null}]};
  35. NTI33555171.node = NNI33555171;
  36. var NNI33555167 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  37. NTI33555167.node = NNI33555167;
  38. NTI33555171.base = NTI33555167;
  39. NTI33555172.base = NTI33555171;
  40. NTI134217741.base = NTI33555172;
  41. NTI134217743.base = NTI134217741;
  42. var NNI134217751 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  43. NTI134217751.node = NNI134217751;
  44. NTI134217751.base = NTI33555172;
  45. var NNI134217749 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  46. NTI134217749.node = NNI134217749;
  47. NTI134217749.base = NTI33555172;
  48. var NNI134217745 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
  49. NTI134217745.node = NNI134217745;
  50. NTI134217745.base = NTI33555172;
  51. var NNI939524183 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "a", len: 0, typ: NTI939524176, name: "a", sons: null},
  52. {kind: 1, offset: "b", len: 0, typ: NTI33554435, name: "b", sons: null}]};
  53. NTI939524183.node = NNI939524183;
  54. 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},
  55. {kind: 1, offset: "Field1", len: 0, typ: NTI33554466, name: "Field1", sons: null}]};
  56. NTI704643086.node = NNI704643086;
  57. function setConstr() {
  58. var result = {};
  59. for (var i = 0; i < arguments.length; ++i) {
  60. var x = arguments[i];
  61. if (typeof(x) == "object") {
  62. for (var j = x[0]; j <= x[1]; ++j) {
  63. result[j] = true;
  64. }
  65. } else {
  66. result[x] = true;
  67. }
  68. }
  69. return result;
  70. }
  71. var ConstSet1 = setConstr(17, 16, 4, 18, 27, 19, 23, 22, 21);
  72. function nimCopy(dest_p0, src_p1, ti_p2) {
  73. var result_33557321 = null;
  74. switch (ti_p2.kind) {
  75. case 21:
  76. case 22:
  77. case 23:
  78. case 5:
  79. if (!(isFatPointer__system_u2869(ti_p2))) {
  80. result_33557321 = src_p1;
  81. }
  82. else {
  83. result_33557321 = [src_p1[0], src_p1[1]];
  84. }
  85. break;
  86. case 19:
  87. if (dest_p0 === null || dest_p0 === undefined) {
  88. dest_p0 = {};
  89. }
  90. else {
  91. for (var key in dest_p0) { delete dest_p0[key]; }
  92. }
  93. for (var key in src_p1) { dest_p0[key] = src_p1[key]; }
  94. result_33557321 = dest_p0;
  95. break;
  96. case 18:
  97. case 17:
  98. if (!((ti_p2.base == null))) {
  99. result_33557321 = nimCopy(dest_p0, src_p1, ti_p2.base);
  100. }
  101. else {
  102. if ((ti_p2.kind == 17)) {
  103. result_33557321 = (dest_p0 === null || dest_p0 === undefined) ? {m_type: ti_p2} : dest_p0;
  104. }
  105. else {
  106. result_33557321 = (dest_p0 === null || dest_p0 === undefined) ? {} : dest_p0;
  107. }
  108. }
  109. nimCopyAux(result_33557321, src_p1, ti_p2.node);
  110. break;
  111. case 4:
  112. case 16:
  113. if(ArrayBuffer.isView(src_p1)) {
  114. if(dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
  115. dest_p0 = new src_p1.constructor(src_p1);
  116. } else {
  117. dest_p0.set(src_p1, 0);
  118. }
  119. result_33557321 = dest_p0;
  120. } else {
  121. if (src_p1 === null) {
  122. result_33557321 = null;
  123. }
  124. else {
  125. if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
  126. dest_p0 = new Array(src_p1.length);
  127. }
  128. result_33557321 = dest_p0;
  129. for (var i = 0; i < src_p1.length; ++i) {
  130. result_33557321[i] = nimCopy(result_33557321[i], src_p1[i], ti_p2.base);
  131. }
  132. }
  133. }
  134. break;
  135. case 24:
  136. case 27:
  137. if (src_p1 === null) {
  138. result_33557321 = null;
  139. }
  140. else {
  141. if (dest_p0 === null || dest_p0 === undefined || dest_p0.length != src_p1.length) {
  142. dest_p0 = new Array(src_p1.length);
  143. }
  144. result_33557321 = dest_p0;
  145. for (var i = 0; i < src_p1.length; ++i) {
  146. result_33557321[i] = nimCopy(result_33557321[i], src_p1[i], ti_p2.base);
  147. }
  148. }
  149. break;
  150. case 28:
  151. if (src_p1 !== null) {
  152. result_33557321 = src_p1.slice(0);
  153. }
  154. break;
  155. default:
  156. result_33557321 = src_p1;
  157. break;
  158. }
  159. return result_33557321;
  160. }
  161. function mnewString(len_p0) {
  162. var result = new Array(len_p0);
  163. for (var i = 0; i < len_p0; i++) {result[i] = 0;}
  164. return result;
  165. }
  166. function toJSStr(s_p0) {
  167. var result_33556910 = null;
  168. var res_33556964 = newSeq__system_u2507((s_p0).length);
  169. var i_33556965 = 0;
  170. var j_33556966 = 0;
  171. Label1: {
  172. Label2: while (true) {
  173. if (!(i_33556965 < (s_p0).length)) break Label2;
  174. var c_33556967 = s_p0[i_33556965];
  175. if ((c_33556967 < 128)) {
  176. res_33556964[j_33556966] = String.fromCharCode(c_33556967);
  177. i_33556965 += 1;
  178. }
  179. else {
  180. var helper_33556993 = newSeq__system_u2507(0);
  181. Label3: {
  182. Label4: while (true) {
  183. if (!true) break Label4;
  184. var code_33556994 = c_33556967.toString(16);
  185. if ((((code_33556994) == null ? 0 : (code_33556994).length) == 1)) {
  186. helper_33556993.push("%0");;
  187. }
  188. else {
  189. helper_33556993.push("%");;
  190. }
  191. helper_33556993.push(code_33556994);;
  192. i_33556965 += 1;
  193. if ((((s_p0).length <= i_33556965) || (s_p0[i_33556965] < 128))) {
  194. break Label3;
  195. }
  196. c_33556967 = s_p0[i_33556965];
  197. }
  198. };
  199. ++excHandler;
  200. try {
  201. res_33556964[j_33556966] = decodeURIComponent(helper_33556993.join(""));
  202. --excHandler;
  203. } catch (EXCEPTION) {
  204. var prevJSError = lastJSError;
  205. lastJSError = EXCEPTION;
  206. --excHandler;
  207. res_33556964[j_33556966] = helper_33556993.join("");
  208. lastJSError = prevJSError;
  209. } finally {
  210. }
  211. }
  212. j_33556966 += 1;
  213. }
  214. };
  215. if (res_33556964.length < j_33556966) { for (var i = res_33556964.length ; i < j_33556966 ; ++i) res_33556964.push(null); }
  216. else { res_33556964.length = j_33556966; };
  217. result_33556910 = res_33556964.join("");
  218. return result_33556910;
  219. }
  220. function raiseException(e_p0, ename_p1) {
  221. e_p0.name = ename_p1;
  222. if ((excHandler == 0)) {
  223. unhandledException(e_p0);
  224. }
  225. throw e_p0;
  226. }
  227. function addInt(a_p0, b_p1) {
  228. var result = a_p0 + b_p1;
  229. checkOverflowInt(result);
  230. return result;
  231. }
  232. function chckRange(i_p0, a_p1, b_p2) {
  233. var result_33557361 = 0;
  234. BeforeRet: {
  235. if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
  236. result_33557361 = i_p0;
  237. break BeforeRet;
  238. }
  239. else {
  240. raiseRangeError();
  241. }
  242. };
  243. return result_33557361;
  244. }
  245. function chckIndx(i_p0, a_p1, b_p2) {
  246. var result_33557356 = 0;
  247. BeforeRet: {
  248. if (((a_p1 <= i_p0) && (i_p0 <= b_p2))) {
  249. result_33557356 = i_p0;
  250. break BeforeRet;
  251. }
  252. else {
  253. raiseIndexError(i_p0, a_p1, b_p2);
  254. }
  255. };
  256. return result_33557356;
  257. }
  258. function makeNimstrLit(c_p0) {
  259. var result = [];
  260. for (var i = 0; i < c_p0.length; ++i) {
  261. result[i] = c_p0.charCodeAt(i);
  262. }
  263. return result;
  264. }
  265. function subInt(a_p0, b_p1) {
  266. var result = a_p0 - b_p1;
  267. checkOverflowInt(result);
  268. return result;
  269. }
  270. function cstrToNimstr(c_p0) {
  271. var ln = c_p0.length;
  272. var result = new Array(ln);
  273. var r = 0;
  274. for (var i = 0; i < ln; ++i) {
  275. var ch = c_p0.charCodeAt(i);
  276. if (ch < 128) {
  277. result[r] = ch;
  278. }
  279. else {
  280. if (ch < 2048) {
  281. result[r] = (ch >> 6) | 192;
  282. }
  283. else {
  284. if (ch < 55296 || ch >= 57344) {
  285. result[r] = (ch >> 12) | 224;
  286. }
  287. else {
  288. ++i;
  289. ch = 65536 + (((ch & 1023) << 10) | (c_p0.charCodeAt(i) & 1023));
  290. result[r] = (ch >> 18) | 240;
  291. ++r;
  292. result[r] = ((ch >> 12) & 63) | 128;
  293. }
  294. ++r;
  295. result[r] = ((ch >> 6) & 63) | 128;
  296. }
  297. ++r;
  298. result[r] = (ch & 63) | 128;
  299. }
  300. ++r;
  301. }
  302. return result;
  303. }
  304. var ConstSet2 = setConstr([65, 90]);
  305. var ConstSet3 = setConstr(95, 32, 46);
  306. var ConstSet4 = setConstr(95, 32, 46);
  307. function mulInt(a_p0, b_p1) {
  308. var result = a_p0 * b_p1;
  309. checkOverflowInt(result);
  310. return result;
  311. }
  312. var ConstSet5 = setConstr([97, 122]);
  313. var ConstSet6 = setConstr([65, 90], [97, 122]);
  314. var ConstSet7 = setConstr([97, 122]);
  315. var ConstSet8 = setConstr([65, 90]);
  316. var ConstSet9 = setConstr([65, 90], [97, 122]);
  317. function nimMax(a_p0, b_p1) {
  318. var Temporary1;
  319. var result_33557148 = 0;
  320. BeforeRet: {
  321. if ((b_p1 <= a_p0)) {
  322. Temporary1 = a_p0;
  323. }
  324. else {
  325. Temporary1 = b_p1;
  326. }
  327. result_33557148 = Temporary1;
  328. break BeforeRet;
  329. };
  330. return result_33557148;
  331. }
  332. function nimMin(a_p0, b_p1) {
  333. var Temporary1;
  334. var result_33557144 = 0;
  335. BeforeRet: {
  336. if ((a_p0 <= b_p1)) {
  337. Temporary1 = a_p0;
  338. }
  339. else {
  340. Temporary1 = b_p1;
  341. }
  342. result_33557144 = Temporary1;
  343. break BeforeRet;
  344. };
  345. return result_33557144;
  346. }
  347. function addChar(x_p0, c_p1) {
  348. x_p0.push(c_p1);
  349. }
  350. var objectID_1157628082 = [0];
  351. function setTheme(theme_p0) {
  352. document.documentElement.setAttribute("data-theme", theme_p0);
  353. window.localStorage.setItem("theme", theme_p0);
  354. }
  355. function isFatPointer__system_u2869(ti_p0) {
  356. var result_33557303 = false;
  357. BeforeRet: {
  358. result_33557303 = !((ConstSet1[ti_p0.base.kind] != undefined));
  359. break BeforeRet;
  360. };
  361. return result_33557303;
  362. }
  363. function nimCopyAux(dest_p0, src_p1, n_p2) {
  364. switch (n_p2.kind) {
  365. case 0:
  366. break;
  367. case 1:
  368. dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
  369. break;
  370. case 2:
  371. for (var i = 0; i < n_p2.sons.length; i++) {
  372. nimCopyAux(dest_p0, src_p1, n_p2.sons[i]);
  373. }
  374. break;
  375. case 3:
  376. dest_p0[n_p2.offset] = nimCopy(dest_p0[n_p2.offset], src_p1[n_p2.offset], n_p2.typ);
  377. for (var i = 0; i < n_p2.sons.length; ++i) {
  378. nimCopyAux(dest_p0, src_p1, n_p2.sons[i][1]);
  379. }
  380. break;
  381. }
  382. }
  383. function add__system_u1942(x_p0, x_p0_Idx, y_p1) {
  384. if (x_p0[x_p0_Idx] === null) { x_p0[x_p0_Idx] = []; }
  385. var off = x_p0[x_p0_Idx].length;
  386. x_p0[x_p0_Idx].length += y_p1.length;
  387. for (var i = 0; i < y_p1.length; ++i) {
  388. x_p0[x_p0_Idx][off+i] = y_p1.charCodeAt(i);
  389. }
  390. }
  391. function newSeq__system_u2507(len_p0) {
  392. var result_33556943 = [];
  393. result_33556943 = new Array(len_p0); for (var i = 0 ; i < len_p0 ; ++i) { result_33556943[i] = null; }
  394. return result_33556943;
  395. }
  396. function unhandledException(e_p0) {
  397. var buf_33556658 = [[]];
  398. if (!(((e_p0.message).length == 0))) {
  399. buf_33556658[0].push.apply(buf_33556658[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]);;
  400. buf_33556658[0].push.apply(buf_33556658[0], e_p0.message);;
  401. }
  402. else {
  403. buf_33556658[0].push.apply(buf_33556658[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]);;
  404. }
  405. buf_33556658[0].push.apply(buf_33556658[0], [32,91]);;
  406. add__system_u1942(buf_33556658, 0, e_p0.name);
  407. buf_33556658[0].push.apply(buf_33556658[0], [93,10]);;
  408. var cbuf_33556659 = toJSStr(buf_33556658[0]);
  409. if (typeof(Error) !== "undefined") {
  410. throw new Error(cbuf_33556659);
  411. }
  412. else {
  413. throw cbuf_33556659;
  414. }
  415. }
  416. function raiseOverflow() {
  417. 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");
  418. }
  419. function checkOverflowInt(a_p0) {
  420. if (a_p0 > 2147483647 || a_p0 < -2147483648) raiseOverflow();
  421. }
  422. function raiseRangeError() {
  423. 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");
  424. }
  425. function addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, start_p2, n_p3) {
  426. var Temporary1;
  427. var old_301990096 = (result_p0[result_p0_Idx]).length;
  428. if (result_p0[result_p0_Idx].length < (Temporary1 = chckRange(addInt(old_301990096, n_p3), 0, 2147483647), Temporary1)) { for (var i = result_p0[result_p0_Idx].length; i < Temporary1; ++i) result_p0[result_p0_Idx].push(0); }
  429. else {result_p0[result_p0_Idx].length = Temporary1; };
  430. Label2: {
  431. var iHEX60gensym4_301990110 = 0;
  432. var i_553649367 = 0;
  433. Label3: {
  434. Label4: while (true) {
  435. if (!(i_553649367 < n_p3)) break Label4;
  436. iHEX60gensym4_301990110 = i_553649367;
  437. result_p0[result_p0_Idx][chckIndx(addInt(old_301990096, iHEX60gensym4_301990110), 0, (result_p0[result_p0_Idx]).length - 1)] = x_p1.charCodeAt(chckIndx(addInt(start_p2, iHEX60gensym4_301990110), 0, (x_p1).length - 1));
  438. i_553649367 = addInt(i_553649367, 1);
  439. }
  440. };
  441. };
  442. }
  443. function addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, x_p1) {
  444. addChars__stdZprivateZdigitsutils_u202(result_p0, result_p0_Idx, x_p1, 0, ((x_p1) == null ? 0 : (x_p1).length));
  445. }
  446. function addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, x_p1) {
  447. addChars__stdZprivateZdigitsutils_u198(result_p0, result_p0_Idx, ((x_p1) + ""));
  448. }
  449. function addInt__stdZprivateZdigitsutils_u241(result_p0, result_p0_Idx, x_p1) {
  450. addInt__stdZprivateZdigitsutils_u223(result_p0, result_p0_Idx, BigInt(x_p1));
  451. }
  452. function HEX24__systemZdollars_u8(x_p0) {
  453. var result_385875978 = [[]];
  454. result_385875978[0] = nimCopy(null, [], NTI33554449);
  455. addInt__stdZprivateZdigitsutils_u241(result_385875978, 0, x_p0);
  456. return result_385875978[0];
  457. }
  458. function raiseIndexError(i_p0, a_p1, b_p2) {
  459. var Temporary1;
  460. if ((b_p2 < a_p1)) {
  461. 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];
  462. }
  463. else {
  464. Temporary1 = ([105,110,100,101,120,32]).concat(HEX24__systemZdollars_u8(i_p0),[32,110,111,116,32,105,110,32],HEX24__systemZdollars_u8(a_p1),[32,46,46,32],HEX24__systemZdollars_u8(b_p2));
  465. }
  466. raiseException({message: nimCopy(null, Temporary1, NTI33554449), parent: null, m_type: NTI134217749, name: null, trace: [], up: null}, "IndexDefect");
  467. }
  468. function sysFatal__stdZassertions_u44(message_p1) {
  469. raiseException({message: nimCopy(null, message_p1, NTI33554449), m_type: NTI134217745, parent: null, name: null, trace: [], up: null}, "AssertionDefect");
  470. }
  471. function raiseAssert__stdZassertions_u42(msg_p0) {
  472. sysFatal__stdZassertions_u44(msg_p0);
  473. }
  474. function failedAssertImpl__stdZassertions_u84(msg_p0) {
  475. raiseAssert__stdZassertions_u42(msg_p0);
  476. }
  477. function onDOMLoaded(e_p0) {
  478. var Temporary4;
  479. function HEX3Aanonymous__dochack_u65(event_p0) {
  480. event_p0.target.parentNode.style.display = "none";
  481. event_p0.target.parentNode.nextSibling.style.display = "inline";
  482. }
  483. document.getElementById("theme-select").value = window.localStorage.getItem("theme");
  484. Label1: {
  485. var pragmaDots_553648192 = null;
  486. var colontmp__553649358 = [];
  487. colontmp__553649358 = document.getElementsByClassName("pragmadots");
  488. var i_553649360 = 0;
  489. var L_553649361 = (colontmp__553649358).length;
  490. Label2: {
  491. Label3: while (true) {
  492. if (!(i_553649360 < L_553649361)) break Label3;
  493. pragmaDots_553648192 = colontmp__553649358[chckIndx(i_553649360, 0, (colontmp__553649358).length - 1)];
  494. Temporary4 = HEX3Aanonymous__dochack_u65.bind(null); Temporary4.ClP_0 = HEX3Aanonymous__dochack_u65; Temporary4.ClE_0 = null;
  495. pragmaDots_553648192.onclick = Temporary4;
  496. i_553649360 += 1;
  497. if (!(((colontmp__553649358).length == L_553649361))) {
  498. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  499. }
  500. }
  501. };
  502. };
  503. }
  504. function isWhitespace__dochack_u408(x_p0) {
  505. var result_553648538 = false;
  506. result_553648538 = (((x_p0.nodeName == "#text") && !/\S/.test(x_p0.textContent)) || (x_p0.nodeName == "#comment"));
  507. return result_553648538;
  508. }
  509. function toToc__dochack_u411(x_p0, father_p1) {
  510. var Temporary5;
  511. var Temporary6;
  512. var Temporary7;
  513. var Temporary8;
  514. var Temporary15;
  515. if ((x_p0.nodeName == "UL")) {
  516. var f_553648549 = {heading: null, kids: [], sortId: (father_p1.kids).length, doSort: false};
  517. var i_553648550 = 0;
  518. Label1: {
  519. Label2: while (true) {
  520. if (!(i_553648550 < x_p0.childNodes.length)) break Label2;
  521. var nxt_553648551 = addInt(i_553648550, 1);
  522. Label3: {
  523. Label4: while (true) {
  524. if (!(nxt_553648551 < x_p0.childNodes.length)) Temporary5 = false; else { Temporary5 = isWhitespace__dochack_u408(x_p0.childNodes[nxt_553648551]); } if (!Temporary5) break Label4;
  525. nxt_553648551 = addInt(nxt_553648551, 1);
  526. }
  527. };
  528. if (!(nxt_553648551 < x_p0.childNodes.length)) Temporary8 = false; else { Temporary8 = (x_p0.childNodes[i_553648550].nodeName == "LI"); } if (!Temporary8) Temporary7 = false; else { Temporary7 = (x_p0.childNodes[i_553648550].childNodes.length == 1); } if (!Temporary7) Temporary6 = false; else { Temporary6 = (x_p0.childNodes[nxt_553648551].nodeName == "UL"); } if (Temporary6) {
  529. var e_553648564 = {heading: x_p0.childNodes[i_553648550].childNodes[0], kids: [], sortId: (f_553648549.kids).length, doSort: false};
  530. var it_553648565 = x_p0.childNodes[nxt_553648551];
  531. Label9: {
  532. var j_553648570 = 0;
  533. var colontmp__553649374 = 0;
  534. colontmp__553649374 = it_553648565.childNodes.length;
  535. var i_553649375 = 0;
  536. Label10: {
  537. Label11: while (true) {
  538. if (!(i_553649375 < colontmp__553649374)) break Label11;
  539. j_553648570 = i_553649375;
  540. toToc__dochack_u411(it_553648565.childNodes[j_553648570], e_553648564);
  541. i_553649375 = addInt(i_553649375, 1);
  542. }
  543. };
  544. };
  545. f_553648549.kids.push(e_553648564);;
  546. i_553648550 = addInt(nxt_553648551, 1);
  547. }
  548. else {
  549. toToc__dochack_u411(x_p0.childNodes[i_553648550], f_553648549);
  550. i_553648550 = addInt(i_553648550, 1);
  551. }
  552. }
  553. };
  554. father_p1.kids.push(f_553648549);;
  555. }
  556. else {
  557. if (isWhitespace__dochack_u408(x_p0)) {
  558. }
  559. else {
  560. if ((x_p0.nodeName == "LI")) {
  561. var idx_553648588 = [];
  562. Label12: {
  563. var i_553648593 = 0;
  564. var colontmp__553649378 = 0;
  565. colontmp__553649378 = x_p0.childNodes.length;
  566. var i_553649379 = 0;
  567. Label13: {
  568. Label14: while (true) {
  569. if (!(i_553649379 < colontmp__553649378)) break Label14;
  570. i_553648593 = i_553649379;
  571. if (!(isWhitespace__dochack_u408(x_p0.childNodes[i_553648593]))) {
  572. idx_553648588.push(i_553648593);;
  573. }
  574. i_553649379 = addInt(i_553649379, 1);
  575. }
  576. };
  577. };
  578. if (!((idx_553648588).length == 2)) Temporary15 = false; else { Temporary15 = (x_p0.childNodes[idx_553648588[chckIndx(1, 0, (idx_553648588).length - 1)]].nodeName == "UL"); } if (Temporary15) {
  579. var e_553648609 = {heading: x_p0.childNodes[idx_553648588[chckIndx(0, 0, (idx_553648588).length - 1)]], kids: [], sortId: (father_p1.kids).length, doSort: false};
  580. var it_553648610 = x_p0.childNodes[idx_553648588[chckIndx(1, 0, (idx_553648588).length - 1)]];
  581. Label16: {
  582. var j_553648615 = 0;
  583. var colontmp__553649382 = 0;
  584. colontmp__553649382 = it_553648610.childNodes.length;
  585. var i_553649383 = 0;
  586. Label17: {
  587. Label18: while (true) {
  588. if (!(i_553649383 < colontmp__553649382)) break Label18;
  589. j_553648615 = i_553649383;
  590. toToc__dochack_u411(it_553648610.childNodes[j_553648615], e_553648609);
  591. i_553649383 = addInt(i_553649383, 1);
  592. }
  593. };
  594. };
  595. father_p1.kids.push(e_553648609);;
  596. }
  597. else {
  598. Label19: {
  599. var i_553648624 = 0;
  600. var colontmp__553649386 = 0;
  601. colontmp__553649386 = x_p0.childNodes.length;
  602. var i_553649387 = 0;
  603. Label20: {
  604. Label21: while (true) {
  605. if (!(i_553649387 < colontmp__553649386)) break Label21;
  606. i_553648624 = i_553649387;
  607. toToc__dochack_u411(x_p0.childNodes[i_553648624], father_p1);
  608. i_553649387 = addInt(i_553649387, 1);
  609. }
  610. };
  611. };
  612. }
  613. }
  614. else {
  615. father_p1.kids.push({heading: x_p0, kids: [], sortId: (father_p1.kids).length, doSort: false});;
  616. }
  617. }}
  618. }
  619. function extractItems__dochack_u199(x_p0, heading_p1, items_p2, items_p2_Idx) {
  620. BeforeRet: {
  621. if ((x_p0 == null)) {
  622. break BeforeRet;
  623. }
  624. if ((!((x_p0.heading == null)) && (x_p0.heading.textContent == heading_p1))) {
  625. Label1: {
  626. var i_553648347 = 0;
  627. var colontmp__553649390 = 0;
  628. colontmp__553649390 = (x_p0.kids).length;
  629. var i_553649391 = 0;
  630. Label2: {
  631. Label3: while (true) {
  632. if (!(i_553649391 < colontmp__553649390)) break Label3;
  633. i_553648347 = i_553649391;
  634. items_p2[items_p2_Idx].push(x_p0.kids[chckIndx(i_553648347, 0, (x_p0.kids).length - 1)].heading);;
  635. i_553649391 = addInt(i_553649391, 1);
  636. }
  637. };
  638. };
  639. }
  640. else {
  641. Label4: {
  642. var k_553648373 = null;
  643. var i_553649395 = 0;
  644. var L_553649396 = (x_p0.kids).length;
  645. Label5: {
  646. Label6: while (true) {
  647. if (!(i_553649395 < L_553649396)) break Label6;
  648. k_553648373 = x_p0.kids[chckIndx(i_553649395, 0, (x_p0.kids).length - 1)];
  649. extractItems__dochack_u199(k_553648373, heading_p1, items_p2, items_p2_Idx);
  650. i_553649395 += 1;
  651. if (!(((x_p0.kids).length == L_553649396))) {
  652. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  653. }
  654. }
  655. };
  656. };
  657. }
  658. };
  659. }
  660. function tree__dochack_u130(tag_p0, kids_p1) {
  661. var result_553648261 = null;
  662. result_553648261 = document.createElement(tag_p0);
  663. Label1: {
  664. var k_553648275 = null;
  665. var i_553649408 = 0;
  666. Label2: {
  667. Label3: while (true) {
  668. if (!(i_553649408 < (kids_p1).length)) break Label3;
  669. k_553648275 = kids_p1[chckIndx(i_553649408, 0, (kids_p1).length - 1)];
  670. result_553648261.appendChild(k_553648275);
  671. i_553649408 += 1;
  672. }
  673. };
  674. };
  675. return result_553648261;
  676. }
  677. function text__dochack_u155(s_p0) {
  678. var result_553648285 = null;
  679. result_553648285 = document.createTextNode(s_p0);
  680. return result_553648285;
  681. }
  682. function uncovered__dochack_u600(x_p0) {
  683. var Temporary1;
  684. var result_553648730 = null;
  685. BeforeRet: {
  686. if ((((x_p0.kids).length == 0) && !((x_p0.heading == null)))) {
  687. if (!(x_p0.heading.hasOwnProperty('__karaxMarker__'))) {
  688. Temporary1 = x_p0;
  689. }
  690. else {
  691. Temporary1 = null;
  692. }
  693. result_553648730 = Temporary1;
  694. break BeforeRet;
  695. }
  696. result_553648730 = {heading: x_p0.heading, kids: [], sortId: x_p0.sortId, doSort: x_p0.doSort};
  697. Label2: {
  698. var k_553648745 = null;
  699. var i_553649415 = 0;
  700. var L_553649416 = (x_p0.kids).length;
  701. Label3: {
  702. Label4: while (true) {
  703. if (!(i_553649415 < L_553649416)) break Label4;
  704. k_553648745 = x_p0.kids[chckIndx(i_553649415, 0, (x_p0.kids).length - 1)];
  705. var y_553648746 = uncovered__dochack_u600(k_553648745);
  706. if (!((y_553648746 == null))) {
  707. result_553648730.kids.push(y_553648746);;
  708. }
  709. i_553649415 += 1;
  710. if (!(((x_p0.kids).length == L_553649416))) {
  711. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  712. }
  713. }
  714. };
  715. };
  716. if (((result_553648730.kids).length == 0)) {
  717. result_553648730 = null;
  718. }
  719. };
  720. return result_553648730;
  721. }
  722. function mergeTocs__dochack_u630(orig_p0, news_p1) {
  723. var result_553648761 = null;
  724. result_553648761 = uncovered__dochack_u600(orig_p0);
  725. if ((result_553648761 == null)) {
  726. result_553648761 = news_p1;
  727. }
  728. else {
  729. Label1: {
  730. var i_553648773 = 0;
  731. var colontmp__553649411 = 0;
  732. colontmp__553649411 = (news_p1.kids).length;
  733. var i_553649412 = 0;
  734. Label2: {
  735. Label3: while (true) {
  736. if (!(i_553649412 < colontmp__553649411)) break Label3;
  737. i_553648773 = i_553649412;
  738. result_553648761.kids.push(news_p1.kids[chckIndx(i_553648773, 0, (news_p1.kids).length - 1)]);;
  739. i_553649412 = addInt(i_553649412, 1);
  740. }
  741. };
  742. };
  743. }
  744. return result_553648761;
  745. }
  746. function buildToc__dochack_u650(orig_p0, types_p1, procs_p2) {
  747. var result_553648782 = null;
  748. var newStuff_553648787 = {heading: null, kids: [], doSort: true, sortId: 0};
  749. Label1: {
  750. var t_553648791 = null;
  751. var i_553649403 = 0;
  752. var L_553649404 = (types_p1).length;
  753. Label2: {
  754. Label3: while (true) {
  755. if (!(i_553649403 < L_553649404)) break Label3;
  756. t_553648791 = types_p1[chckIndx(i_553649403, 0, (types_p1).length - 1)];
  757. var c_553648796 = {heading: t_553648791.cloneNode(true), kids: [], doSort: true, sortId: 0};
  758. t_553648791.__karaxMarker__ = true;
  759. Label4: {
  760. var p_553648800 = null;
  761. var i_553649400 = 0;
  762. var L_553649401 = (procs_p2).length;
  763. Label5: {
  764. Label6: while (true) {
  765. if (!(i_553649400 < L_553649401)) break Label6;
  766. p_553648800 = procs_p2[chckIndx(i_553649400, 0, (procs_p2).length - 1)];
  767. if (!(p_553648800.hasOwnProperty('__karaxMarker__'))) {
  768. var xx_553648801 = p_553648800.parentNode.getElementsByClassName("attachedType");
  769. if ((((xx_553648801).length == 1) && (xx_553648801[chckIndx(0, 0, (xx_553648801).length - 1)].textContent == t_553648791.textContent))) {
  770. var q_553648806 = tree__dochack_u130("A", [text__dochack_u155(p_553648800.title)]);
  771. q_553648806.setAttribute("href", p_553648800.getAttribute("href"));
  772. c_553648796.kids.push({heading: q_553648806, kids: [], sortId: 0, doSort: false});;
  773. p_553648800.__karaxMarker__ = true;
  774. }
  775. }
  776. i_553649400 += 1;
  777. if (!(((procs_p2).length == L_553649401))) {
  778. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  779. }
  780. }
  781. };
  782. };
  783. newStuff_553648787.kids.push(c_553648796);;
  784. i_553649403 += 1;
  785. if (!(((types_p1).length == L_553649404))) {
  786. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  787. }
  788. }
  789. };
  790. };
  791. result_553648782 = mergeTocs__dochack_u630(orig_p0, newStuff_553648787);
  792. return result_553648782;
  793. }
  794. function add__dochack_u148(parent_p0, kid_p1) {
  795. if (((parent_p0.nodeName == "TR") && ((kid_p1.nodeName == "TD") || (kid_p1.nodeName == "TH")))) {
  796. var k_553648279 = document.createElement("TD");
  797. k_553648279.appendChild(kid_p1);
  798. parent_p0.appendChild(k_553648279);
  799. }
  800. else {
  801. parent_p0.appendChild(kid_p1);
  802. }
  803. }
  804. function setClass__dochack_u152(e_p0, value_p1) {
  805. e_p0.setAttribute("class", value_p1);
  806. }
  807. function toHtml__dochack_u278(x_p0, isRoot_p1) {
  808. var Temporary1;
  809. function HEX3Aanonymous__dochack_u298(a_p0, b_p1) {
  810. var result_553648429 = 0;
  811. BeforeRet: {
  812. if ((!((a_p0.heading == null)) && !((b_p1.heading == null)))) {
  813. var x_553648438 = a_p0.heading.textContent;
  814. var y_553648439 = b_p1.heading.textContent;
  815. if ((x_553648438 < y_553648439)) {
  816. result_553648429 = (-1);
  817. break BeforeRet;
  818. }
  819. if ((y_553648439 < x_553648438)) {
  820. result_553648429 = 1;
  821. break BeforeRet;
  822. }
  823. result_553648429 = 0;
  824. break BeforeRet;
  825. }
  826. else {
  827. result_553648429 = subInt(a_p0.sortId, b_p1.sortId);
  828. break BeforeRet;
  829. }
  830. };
  831. return result_553648429;
  832. }
  833. var result_553648409 = null;
  834. BeforeRet: {
  835. if ((x_p0 == null)) {
  836. result_553648409 = null;
  837. break BeforeRet;
  838. }
  839. if (((x_p0.kids).length == 0)) {
  840. if ((x_p0.heading == null)) {
  841. result_553648409 = null;
  842. break BeforeRet;
  843. }
  844. result_553648409 = x_p0.heading.cloneNode(true);
  845. break BeforeRet;
  846. }
  847. result_553648409 = tree__dochack_u130("DIV", []);
  848. if ((!((x_p0.heading == null)) && !(x_p0.heading.hasOwnProperty('__karaxMarker__')))) {
  849. add__dochack_u148(result_553648409, x_p0.heading.cloneNode(true));
  850. }
  851. var ul_553648425 = tree__dochack_u130("UL", []);
  852. if (isRoot_p1) {
  853. setClass__dochack_u152(ul_553648425, "simple simple-toc");
  854. }
  855. else {
  856. setClass__dochack_u152(ul_553648425, "simple");
  857. }
  858. if (x_p0.doSort) {
  859. Temporary1 = HEX3Aanonymous__dochack_u298.bind(null); Temporary1.ClP_0 = HEX3Aanonymous__dochack_u298; Temporary1.ClE_0 = null;
  860. x_p0.kids.sort(Temporary1);
  861. }
  862. Label2: {
  863. var k_553648451 = null;
  864. var i_553649419 = 0;
  865. var L_553649420 = (x_p0.kids).length;
  866. Label3: {
  867. Label4: while (true) {
  868. if (!(i_553649419 < L_553649420)) break Label4;
  869. k_553648451 = x_p0.kids[chckIndx(i_553649419, 0, (x_p0.kids).length - 1)];
  870. var y_553648452 = toHtml__dochack_u278(k_553648451, false);
  871. if (!((y_553648452 == null))) {
  872. add__dochack_u148(ul_553648425, tree__dochack_u130("LI", [y_553648452]));
  873. }
  874. i_553649419 += 1;
  875. if (!(((x_p0.kids).length == L_553649420))) {
  876. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  877. }
  878. }
  879. };
  880. };
  881. if (!((ul_553648425.childNodes.length == 0))) {
  882. add__dochack_u148(result_553648409, ul_553648425);
  883. }
  884. if ((result_553648409.childNodes.length == 0)) {
  885. result_553648409 = null;
  886. }
  887. };
  888. return result_553648409;
  889. }
  890. function replaceById__dochack_u158(id_p0, newTree_p1) {
  891. var x_553648289 = document.getElementById(id_p0);
  892. x_553648289.parentNode.replaceChild(newTree_p1, x_553648289);
  893. newTree_p1.id = id_p0;
  894. }
  895. function togglevis__dochack_u708(d_p0) {
  896. if ((d_p0.style.display == "none")) {
  897. d_p0.style.display = "inline";
  898. }
  899. else {
  900. d_p0.style.display = "none";
  901. }
  902. }
  903. function groupBy(value_p0) {
  904. var toc_553648840 = document.getElementById("toc-list");
  905. if ((alternative_553648835[0] == null)) {
  906. var tt_553648848 = {heading: null, kids: [], sortId: 0, doSort: false};
  907. toToc__dochack_u411(toc_553648840, tt_553648848);
  908. tt_553648848 = tt_553648848.kids[chckIndx(0, 0, (tt_553648848.kids).length - 1)];
  909. var types_553648853 = [[]];
  910. var procs_553648858 = [[]];
  911. extractItems__dochack_u199(tt_553648848, "Types", types_553648853, 0);
  912. extractItems__dochack_u199(tt_553648848, "Procs", procs_553648858, 0);
  913. extractItems__dochack_u199(tt_553648848, "Converters", procs_553648858, 0);
  914. extractItems__dochack_u199(tt_553648848, "Methods", procs_553648858, 0);
  915. extractItems__dochack_u199(tt_553648848, "Templates", procs_553648858, 0);
  916. extractItems__dochack_u199(tt_553648848, "Macros", procs_553648858, 0);
  917. extractItems__dochack_u199(tt_553648848, "Iterators", procs_553648858, 0);
  918. var ntoc_553648859 = buildToc__dochack_u650(tt_553648848, types_553648853[0], procs_553648858[0]);
  919. var x_553648860 = toHtml__dochack_u278(ntoc_553648859, true);
  920. alternative_553648835[0] = tree__dochack_u130("DIV", [x_553648860]);
  921. }
  922. if ((value_p0 == "type")) {
  923. replaceById__dochack_u158("tocRoot", alternative_553648835[0]);
  924. }
  925. else {
  926. replaceById__dochack_u158("tocRoot", tree__dochack_u130("DIV", []));
  927. }
  928. togglevis__dochack_u708(document.getElementById("toc-list"));
  929. }
  930. function HEX5BHEX5D__pureZstrutils_u1307(s_p0, x_p1) {
  931. var result_721421600 = [];
  932. var a_721421602 = x_p1.a;
  933. var L_721421604 = addInt(subInt(subInt((s_p0).length, x_p1.b), a_721421602), 1);
  934. result_721421600 = nimCopy(null, mnewString(chckRange(L_721421604, 0, 2147483647)), NTI33554449);
  935. Label1: {
  936. var i_721421609 = 0;
  937. var i_553649429 = 0;
  938. Label2: {
  939. Label3: while (true) {
  940. if (!(i_553649429 < L_721421604)) break Label3;
  941. i_721421609 = i_553649429;
  942. result_721421600[chckIndx(i_721421609, 0, (result_721421600).length - 1)] = s_p0[chckIndx(addInt(i_721421609, a_721421602), 0, (s_p0).length - 1)];
  943. i_553649429 = addInt(i_553649429, 1);
  944. }
  945. };
  946. };
  947. return result_721421600;
  948. }
  949. function HEX2EHEX2E__stdZenumutils_u105(a_p0, b_p1) {
  950. var result_939524208 = ({a: 0, b: 0});
  951. result_939524208 = nimCopy(result_939524208, {a: a_p0, b: b_p1}, NTI939524183);
  952. return result_939524208;
  953. }
  954. async function loadIndex__dochack_u928() {
  955. var result_553649058 = null;
  956. BeforeRet: {
  957. var indexURL_553649064 = document.getElementById("indexLink").getAttribute("href");
  958. var rootURL_553649090 = HEX5BHEX5D__pureZstrutils_u1307(cstrToNimstr(indexURL_553649064), HEX2EHEX2E__stdZenumutils_u105(0, 14));
  959. var resp_553649102 = (await (await fetch(indexURL_553649064)).text());
  960. var indexElem_553649103 = document.createElement("div");
  961. indexElem_553649103.innerHTML = resp_553649102;
  962. Label1: {
  963. var href_553649125 = null;
  964. var colontmp__553649423 = [];
  965. colontmp__553649423 = indexElem_553649103.getElementsByClassName("reference");
  966. var i_553649425 = 0;
  967. var L_553649426 = (colontmp__553649423).length;
  968. Label2: {
  969. Label3: while (true) {
  970. if (!(i_553649425 < L_553649426)) break Label3;
  971. href_553649125 = colontmp__553649423[chckIndx(i_553649425, 0, (colontmp__553649423).length - 1)];
  972. href_553649125.setAttribute("href", toJSStr((rootURL_553649090).concat(cstrToNimstr(href_553649125.getAttribute("href")))));
  973. db_553648877[0].push(href_553649125);;
  974. contents_553648878[0].push(href_553649125.getAttribute("data-doc-search-tag"));;
  975. i_553649425 += 1;
  976. if (!(((colontmp__553649423).length == L_553649426))) {
  977. failedAssertImpl__stdZassertions_u84(makeNimstrLit("iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it"));
  978. }
  979. }
  980. };
  981. };
  982. result_553649058 = undefined;
  983. break BeforeRet;
  984. };
  985. return result_553649058;
  986. }
  987. function then__dochack_u1107(future_p0, onSuccess_p1, onReject_p2) {
  988. var result_553649241 = null;
  989. BeforeRet: {
  990. var ret_553649251 = null;
  991. ret_553649251 = future_p0.then(onSuccess_p1, onReject_p2);
  992. result_553649241 = ret_553649251;
  993. break BeforeRet;
  994. };
  995. return result_553649241;
  996. }
  997. function nsuToLowerAsciiChar(c_p0) {
  998. var result_721420374 = 0;
  999. if ((ConstSet2[c_p0] != undefined)) {
  1000. result_721420374 = (c_p0 ^ 32);
  1001. }
  1002. else {
  1003. result_721420374 = c_p0;
  1004. }
  1005. return result_721420374;
  1006. }
  1007. function fuzzyMatch__fuzzysearch_u16(pattern_p0, str_p1) {
  1008. var Temporary4;
  1009. var Temporary5;
  1010. var Temporary6;
  1011. var Temporary7;
  1012. var Temporary8;
  1013. var result_704643093 = {Field0: 0, Field1: false};
  1014. var scoreState_704643094 = (-100);
  1015. var headerMatched_704643095 = false;
  1016. var unmatchedLeadingCharCount_704643096 = 0;
  1017. var consecutiveMatchCount_704643097 = 0;
  1018. var strIndex_704643098 = 0;
  1019. var patIndex_704643099 = 0;
  1020. var score_704643100 = 0;
  1021. Label1: {
  1022. Label2: while (true) {
  1023. if (!((strIndex_704643098 < ((str_p1) == null ? 0 : (str_p1).length)) && (patIndex_704643099 < ((pattern_p0) == null ? 0 : (pattern_p0).length)))) break Label2;
  1024. Label3: {
  1025. var patternChar_704643103 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(patIndex_704643099, 0, (pattern_p0).length - 1)));
  1026. var strChar_704643104 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(strIndex_704643098, 0, (str_p1).length - 1)));
  1027. if ((ConstSet3[patternChar_704643103] != undefined)) {
  1028. patIndex_704643099 = addInt(patIndex_704643099, 1);
  1029. break Label3;
  1030. }
  1031. if ((ConstSet4[strChar_704643104] != undefined)) {
  1032. strIndex_704643098 = addInt(strIndex_704643098, 1);
  1033. break Label3;
  1034. }
  1035. if ((!(headerMatched_704643095) && (strChar_704643104 == 58))) {
  1036. headerMatched_704643095 = true;
  1037. scoreState_704643094 = (-100);
  1038. score_704643100 = ((Math.floor((0.5 * score_704643100))) | 0);
  1039. patIndex_704643099 = 0;
  1040. strIndex_704643098 = addInt(strIndex_704643098, 1);
  1041. break Label3;
  1042. }
  1043. if ((strChar_704643104 == patternChar_704643103)) {
  1044. switch (scoreState_704643094) {
  1045. case (-100):
  1046. case 20:
  1047. scoreState_704643094 = 10;
  1048. break;
  1049. case 0:
  1050. scoreState_704643094 = 5;
  1051. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1052. break;
  1053. case 10:
  1054. case 5:
  1055. consecutiveMatchCount_704643097 = addInt(consecutiveMatchCount_704643097, 1);
  1056. scoreState_704643094 = 5;
  1057. score_704643100 = addInt(score_704643100, mulInt(5, consecutiveMatchCount_704643097));
  1058. if ((scoreState_704643094 == 10)) {
  1059. score_704643100 = addInt(score_704643100, 10);
  1060. }
  1061. var onBoundary_704643156 = (patIndex_704643099 == ((pattern_p0) == null ? -1 : (pattern_p0).length - 1));
  1062. if ((!(onBoundary_704643156) && (strIndex_704643098 < ((str_p1) == null ? -1 : (str_p1).length - 1)))) {
  1063. var nextPatternChar_704643157 = nsuToLowerAsciiChar(pattern_p0.charCodeAt(chckIndx(addInt(patIndex_704643099, 1), 0, (pattern_p0).length - 1)));
  1064. var nextStrChar_704643158 = nsuToLowerAsciiChar(str_p1.charCodeAt(chckIndx(addInt(strIndex_704643098, 1), 0, (str_p1).length - 1)));
  1065. if (!!((ConstSet5[nextStrChar_704643158] != undefined))) Temporary4 = false; else { Temporary4 = !((nextStrChar_704643158 == nextPatternChar_704643157)); } onBoundary_704643156 = Temporary4;
  1066. }
  1067. if (onBoundary_704643156) {
  1068. scoreState_704643094 = 20;
  1069. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1070. }
  1071. break;
  1072. case (-1):
  1073. case (-3):
  1074. if (!((ConstSet6[str_p1.charCodeAt(chckIndx(subInt(strIndex_704643098, 1), 0, (str_p1).length - 1))] != undefined))) Temporary5 = true; else { if (!(ConstSet7[str_p1.charCodeAt(chckIndx(subInt(strIndex_704643098, 1), 0, (str_p1).length - 1))] != undefined)) Temporary6 = false; else { Temporary6 = (ConstSet8[str_p1.charCodeAt(chckIndx(strIndex_704643098, 0, (str_p1).length - 1))] != undefined); } Temporary5 = Temporary6; } var isLeadingChar_704643182 = Temporary5;
  1075. if (isLeadingChar_704643182) {
  1076. scoreState_704643094 = 10;
  1077. }
  1078. else {
  1079. scoreState_704643094 = 0;
  1080. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1081. }
  1082. break;
  1083. }
  1084. patIndex_704643099 = addInt(patIndex_704643099, 1);
  1085. }
  1086. else {
  1087. switch (scoreState_704643094) {
  1088. case (-100):
  1089. scoreState_704643094 = (-3);
  1090. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1091. break;
  1092. case 5:
  1093. scoreState_704643094 = (-1);
  1094. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1095. consecutiveMatchCount_704643097 = 0;
  1096. break;
  1097. case (-3):
  1098. if ((unmatchedLeadingCharCount_704643096 < 3)) {
  1099. scoreState_704643094 = (-3);
  1100. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1101. }
  1102. unmatchedLeadingCharCount_704643096 = addInt(unmatchedLeadingCharCount_704643096, 1);
  1103. break;
  1104. default:
  1105. scoreState_704643094 = (-1);
  1106. score_704643100 = addInt(score_704643100, scoreState_704643094);
  1107. break;
  1108. }
  1109. }
  1110. strIndex_704643098 = addInt(strIndex_704643098, 1);
  1111. };
  1112. }
  1113. };
  1114. if (!(patIndex_704643099 == ((pattern_p0) == null ? 0 : (pattern_p0).length))) Temporary7 = false; else { if ((strIndex_704643098 == ((str_p1) == null ? 0 : (str_p1).length))) Temporary8 = true; else { Temporary8 = !((ConstSet9[str_p1.charCodeAt(chckIndx(strIndex_704643098, 0, (str_p1).length - 1))] != undefined)); } Temporary7 = Temporary8; } if (Temporary7) {
  1115. score_704643100 = addInt(score_704643100, 10);
  1116. }
  1117. var colontmp__553649442 = nimMax(0, score_704643100);
  1118. var colontmp__553649443 = (0 < score_704643100);
  1119. result_704643093 = nimCopy(result_704643093, {Field0: colontmp__553649442, Field1: colontmp__553649443}, NTI704643086);
  1120. return result_704643093;
  1121. }
  1122. function escapeCString__dochack_u751(x_p0, x_p0_Idx) {
  1123. var s_553648881 = [];
  1124. Label1: {
  1125. var c_553648882 = 0;
  1126. var iHEX60gensym13_553649446 = 0;
  1127. var nHEX60gensym13_553649447 = ((x_p0[x_p0_Idx]) == null ? 0 : (x_p0[x_p0_Idx]).length);
  1128. Label2: {
  1129. Label3: while (true) {
  1130. if (!(iHEX60gensym13_553649446 < nHEX60gensym13_553649447)) break Label3;
  1131. c_553648882 = x_p0[x_p0_Idx].charCodeAt(chckIndx(iHEX60gensym13_553649446, 0, (x_p0[x_p0_Idx]).length - 1));
  1132. switch (c_553648882) {
  1133. case 60:
  1134. s_553648881.push.apply(s_553648881, [38,108,116,59]);;
  1135. break;
  1136. case 62:
  1137. s_553648881.push.apply(s_553648881, [38,103,116,59]);;
  1138. break;
  1139. default:
  1140. addChar(s_553648881, c_553648882);;
  1141. break;
  1142. }
  1143. iHEX60gensym13_553649446 += 1;
  1144. }
  1145. };
  1146. };
  1147. x_p0[x_p0_Idx] = toJSStr(s_553648881);
  1148. }
  1149. function dosearch__dochack_u755(value_p0) {
  1150. var Temporary5;
  1151. function HEX3Aanonymous__dochack_u783(a_p0, b_p1) {
  1152. var result_553648924 = 0;
  1153. result_553648924 = subInt(b_p1["Field1"], a_p0["Field1"]);
  1154. return result_553648924;
  1155. }
  1156. var result_553648885 = null;
  1157. BeforeRet: {
  1158. if (((db_553648877[0]).length == 0)) {
  1159. break BeforeRet;
  1160. }
  1161. var ul_553648889 = tree__dochack_u130("UL", []);
  1162. result_553648885 = tree__dochack_u130("DIV", []);
  1163. setClass__dochack_u152(result_553648885, "search_results");
  1164. var matches_553648894 = [];
  1165. Label1: {
  1166. var i_553648902 = 0;
  1167. var colontmp__553649433 = 0;
  1168. colontmp__553649433 = (db_553648877[0]).length;
  1169. var i_553649434 = 0;
  1170. Label2: {
  1171. Label3: while (true) {
  1172. if (!(i_553649434 < colontmp__553649433)) break Label3;
  1173. i_553648902 = i_553649434;
  1174. Label4: {
  1175. var c_553648903 = contents_553648878[0][chckIndx(i_553648902, 0, (contents_553648878[0]).length - 1)];
  1176. if (((c_553648903 == "Examples") || (c_553648903 == "PEG construction"))) {
  1177. break Label4;
  1178. }
  1179. var tmpTuple_553648904 = fuzzyMatch__fuzzysearch_u16(value_p0, c_553648903);
  1180. var score_553648905 = tmpTuple_553648904["Field0"];
  1181. var matched_553648906 = tmpTuple_553648904["Field1"];
  1182. if (matched_553648906) {
  1183. matches_553648894.push({Field0: db_553648877[0][chckIndx(i_553648902, 0, (db_553648877[0]).length - 1)], Field1: score_553648905});;
  1184. }
  1185. };
  1186. i_553649434 = addInt(i_553649434, 1);
  1187. }
  1188. };
  1189. };
  1190. Temporary5 = HEX3Aanonymous__dochack_u783.bind(null); Temporary5.ClP_0 = HEX3Aanonymous__dochack_u783; Temporary5.ClE_0 = null;
  1191. matches_553648894.sort(Temporary5);
  1192. Label6: {
  1193. var i_553648941 = 0;
  1194. var colontmp__553649437 = 0;
  1195. colontmp__553649437 = nimMin((matches_553648894).length, 29);
  1196. var i_553649438 = 0;
  1197. Label7: {
  1198. Label8: while (true) {
  1199. if (!(i_553649438 < colontmp__553649437)) break Label8;
  1200. i_553648941 = i_553649438;
  1201. matches_553648894[chckIndx(i_553648941, 0, (matches_553648894).length - 1)]["Field0"].innerHTML = matches_553648894[chckIndx(i_553648941, 0, (matches_553648894).length - 1)]["Field0"].getAttribute("data-doc-search-tag");
  1202. escapeCString__dochack_u751(matches_553648894[chckIndx(i_553648941, 0, (matches_553648894).length - 1)]["Field0"], "innerHTML");
  1203. add__dochack_u148(ul_553648889, tree__dochack_u130("LI", [matches_553648894[chckIndx(i_553648941, 0, (matches_553648894).length - 1)]["Field0"]]));
  1204. i_553649438 = addInt(i_553649438, 1);
  1205. }
  1206. };
  1207. };
  1208. if ((ul_553648889.childNodes.length == 0)) {
  1209. add__dochack_u148(result_553648885, tree__dochack_u130("B", [text__dochack_u155("no search results")]));
  1210. }
  1211. else {
  1212. add__dochack_u148(result_553648885, tree__dochack_u130("B", [text__dochack_u155("search results")]));
  1213. add__dochack_u148(result_553648885, ul_553648889);
  1214. }
  1215. };
  1216. return result_553648885;
  1217. }
  1218. function hideSearch__dochack_u1090() {
  1219. if (!((oldtoc_553649214[0] == null))) {
  1220. replaceById__dochack_u158("tocRoot", oldtoc_553649214[0]);
  1221. }
  1222. }
  1223. function runSearch__dochack_u1094() {
  1224. var elem_553649223 = document.getElementById("searchInput");
  1225. var value_553649224 = elem_553649223.value;
  1226. if (!((value_553649224 == ""))) {
  1227. if ((oldtoc_553649214[0] == null)) {
  1228. oldtoc_553649214[0] = document.getElementById("tocRoot");
  1229. }
  1230. var results_553649228 = dosearch__dochack_u755(value_553649224);
  1231. replaceById__dochack_u158("tocRoot", results_553649228);
  1232. }
  1233. else {
  1234. hideSearch__dochack_u1090();
  1235. }
  1236. }
  1237. function search() {
  1238. var Temporary1;
  1239. if ((loadIndexFut_553649217[0] == null)) {
  1240. loadIndexFut_553649217[0] = loadIndex__dochack_u928();
  1241. (then__dochack_u1107(loadIndexFut_553649217[0], runSearch__dochack_u1094, null));
  1242. }
  1243. if (!((timer_553649215[0] == null))) {
  1244. clearTimeout(timer_553649215[0]);
  1245. }
  1246. Temporary1 = runSearch__dochack_u1094.bind(null); Temporary1.ClP_0 = runSearch__dochack_u1094; Temporary1.ClE_0 = null;
  1247. timer_553649215[0] = setTimeout(Temporary1, 400);
  1248. }
  1249. function copyToClipboard() {
  1250. function updatePreTags() {
  1251. const allPreTags = document.querySelectorAll("pre:not(.line-nums)")
  1252. allPreTags.forEach((e) => {
  1253. const div = document.createElement("div")
  1254. div.classList.add("copyToClipBoard")
  1255. const preTag = document.createElement("pre")
  1256. preTag.innerHTML = e.innerHTML
  1257. const button = document.createElement("button")
  1258. button.value = e.textContent.replace('...', '')
  1259. button.classList.add("copyToClipBoardBtn")
  1260. button.style.cursor = "pointer"
  1261. div.appendChild(preTag)
  1262. div.appendChild(button)
  1263. e.outerHTML = div.outerHTML
  1264. })
  1265. }
  1266. function copyTextToClipboard(e) {
  1267. const clipBoardContent = e.target.value
  1268. navigator.clipboard.writeText(clipBoardContent).then(function() {
  1269. e.target.style.setProperty("--clipboard-image", "var(--clipboard-image-selected)")
  1270. }, function(err) {
  1271. console.error("Could not copy text: ", err);
  1272. });
  1273. }
  1274. window.addEventListener("click", (e) => {
  1275. if (e.target.classList.contains("copyToClipBoardBtn")) {
  1276. copyTextToClipboard(e)
  1277. }
  1278. })
  1279. window.addEventListener("mouseover", (e) => {
  1280. if (e.target.nodeName === "PRE") {
  1281. e.target.nextElementSibling.style.setProperty("--clipboard-image", "var(--clipboard-image-normal)")
  1282. }
  1283. })
  1284. window.addEventListener("DOMContentLoaded", updatePreTags)
  1285. }
  1286. var Temporary1;
  1287. var Temporary2;
  1288. function HEX3Aanonymous__dochack_u1175(e_p0) {
  1289. if ((e_p0.key == "/")) {
  1290. e_p0.preventDefault();
  1291. var searchElem_553649305 = document.getElementById("searchInput");
  1292. searchElem_553649305.focus();
  1293. searchElem_553649305.parentElement.scrollIntoView();
  1294. runSearch__dochack_u1094();
  1295. }
  1296. }
  1297. var Temporary3;
  1298. function HEX3Aanonymous__dochack_u1210(e_p0) {
  1299. hideSearch__dochack_u1090();
  1300. }
  1301. var Temporary4;
  1302. var t_553648167 = window.localStorage.getItem("theme");
  1303. if ((t_553648167 == null)) {
  1304. Temporary1 = "auto";
  1305. }
  1306. else {
  1307. Temporary1 = t_553648167;
  1308. }
  1309. setTheme(Temporary1);
  1310. var alternative_553648835 = [null];
  1311. var db_553648877 = [[]];
  1312. var contents_553648878 = [[]];
  1313. var oldtoc_553649214 = [null];
  1314. var timer_553649215 = [null];
  1315. var loadIndexFut_553649217 = [null];
  1316. Temporary2 = HEX3Aanonymous__dochack_u1175.bind(null); Temporary2.ClP_0 = HEX3Aanonymous__dochack_u1175; Temporary2.ClE_0 = null;
  1317. window.addEventListener("keypress", Temporary2, false);
  1318. Temporary3 = HEX3Aanonymous__dochack_u1210.bind(null); Temporary3.ClP_0 = HEX3Aanonymous__dochack_u1210; Temporary3.ClE_0 = null;
  1319. window.addEventListener("hashchange", Temporary3, false);
  1320. copyToClipboard();
  1321. Temporary4 = onDOMLoaded.bind(null); Temporary4.ClP_0 = onDOMLoaded; Temporary4.ClE_0 = null;
  1322. window.addEventListener("DOMContentLoaded", Temporary4, false);