diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eddc03cdf..9d9f3a65c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,17 @@ # 12.0.0-alpha.2 (Unreleased) +#### :nail_care: Polish + +- Improve formatting in the generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6932 + - `}\ncatch{` -> `} catch {` + - `for(let i = 0 ,i_finish = r.length; i < i_finish; ++i){` -> `for (let i = 0, i_finish = r.length; i < i_finish; ++i) {` + - `while(true) {` -> `while (true) {` + - Fixed tabulation for `switch case` bodies + - Fixed tabulation for `throw new Error` bodies + - Removed empty line at the end of `switch` statement + - Removed empty `default` case from `switch` statement in the generated code + # 12.0.0-alpha.1 #### :rocket: New Feature diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 99a473bcc4..a09885ae2f 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -248,7 +248,6 @@ let debugger_nl f = let break_nl f = P.string f L.break; - P.space f; semi f; P.newline f @@ -430,9 +429,10 @@ and pp_one_case_clause : 'a. _ -> P.t -> (P.t -> 'a -> unit) -> 'a * J.case_clause -> _ = fun cxt f pp_cond (switch_case, ({ switch_body; should_break; comment } : J.case_clause)) -> + P.newline f; let cxt = P.group f 1 (fun _ -> - P.group f 1 (fun _ -> + P.group f 0 (fun _ -> P.string f L.case; P.space f; pp_comment_option f comment; @@ -440,7 +440,7 @@ and pp_one_case_clause : (* could be integer or string *) P.space f; P.string f L.colon); - P.group f 1 (fun _ -> + P.group f 0 (fun _ -> let cxt = match switch_body with | [] -> cxt @@ -454,7 +454,6 @@ and pp_one_case_clause : semi f); cxt)) in - P.newline f; cxt and loop_case_clauses : @@ -858,11 +857,11 @@ and expression_desc cxt ~(level : int) f x : cxt = cxt) | New (e, el) -> P.cond_paren_group f (level > 15) (fun _ -> - P.group f 1 (fun _ -> + P.group f 0 (fun _ -> P.string f L.new_; P.space f; let cxt = expression ~level:16 cxt f e in - P.paren_group f 1 (fun _ -> + P.paren_group f 0 (fun _ -> match el with Some el -> arguments cxt f el | None -> cxt))) | Cond (e, e1, e2) -> let action () = @@ -1045,6 +1044,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = match e.expression_desc with | Number (Int { i = 1l }) -> P.string f L.while_; + P.space f; P.string f L.lparen; P.string f L.true_; P.string f L.rparen; @@ -1052,6 +1052,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = cxt | _ -> P.string f L.while_; + P.space f; let cxt = P.paren_group f 1 (fun _ -> expression ~level:0 cxt f e) in @@ -1068,7 +1069,8 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = P.group f 0 (fun _ -> (* The only place that [semi] may have semantics here *) P.string f L.for_; - P.paren_group f 1 (fun _ -> + P.space f; + let ctx = P.paren_group f 1 (fun _ -> let cxt, new_id = match (for_ident_expression, finish.expression_desc) @@ -1081,8 +1083,8 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = let cxt = expression ~level:1 cxt f ident_expression in - P.space f; comma f; + P.space f; let id = Ext_ident.create (Ident.name id ^ "_finish") in @@ -1128,7 +1130,9 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = semi f; P.space f; pp_direction f direction; - Ext_pp_scope.ident cxt f id)) + Ext_pp_scope.ident cxt f id) in + P.space f; + ctx) in brace_block cxt f s) in @@ -1177,6 +1181,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = match def with | None -> cxt | Some def -> + P.newline f; P.group f 1 (fun _ -> P.string f L.default; P.string f L.colon; @@ -1195,6 +1200,7 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = match def with | None -> cxt | Some def -> + P.newline f; P.group f 1 (fun _ -> P.string f L.default; P.string f L.colon; @@ -1224,10 +1230,9 @@ and statement_desc top cxt f (s : J.statement_desc) : cxt = match ctch with | None -> cxt | Some (i, b) -> - P.newline f; - P.string f "catch ("; + P.string f " catch ("; let cxt = Ext_pp_scope.ident cxt f i in - P.string f ")"; + P.string f ") "; brace_block cxt f b in match fin with diff --git a/jscomp/core/lam_compile.ml b/jscomp/core/lam_compile.ml index b782e12966..dfd678d97f 100644 --- a/jscomp/core/lam_compile.ml +++ b/jscomp/core/lam_compile.ml @@ -584,7 +584,10 @@ and compile_general_cases : | Complete -> None | NonComplete -> None | Default lam -> - Some (Js_output.output_as_block (compile_lambda cxt lam)) + let statements = Js_output.output_as_block (compile_lambda cxt lam) in + match statements with + | [] -> None + | _ -> Some statements in let body = group_apply ~merge_cases cases (fun last (switch_case, lam) -> diff --git a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js b/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js index 26d8c38aa9..2da39bec02 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/NestedVariants.res.js @@ -123,25 +123,24 @@ function testUnboxedBinary(param) { function testInline(x) { switch (x.TAG) { case "I" : - return { - TAG: "I", - i: x.i, - j: x.j - }; + return { + TAG: "I", + i: x.i, + j: x.j + }; case "J" : - return x; + return x; case "K" : - return { - TAG: "K", - _0: x._1, - _1: x._0 - }; + return { + TAG: "K", + _0: x._1, + _1: x._0 + }; case "L" : - return { - TAG: "L", - _0: x._0 - }; - + return { + TAG: "L", + _0: x._0 + }; } } diff --git a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js b/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js index 960efc433a..8f55a8e1fd 100644 --- a/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js +++ b/jscomp/gentype_tests/typescript-react-example/src/VariantsWithPayload.res.js @@ -58,19 +58,18 @@ function printVariantWithPayloads(x) { } switch (x.TAG) { case "B" : - console.log("printVariantWithPayloads", "B(" + (String(x._0) + ")")); - return; + console.log("printVariantWithPayloads", "B(" + (String(x._0) + ")")); + return; case "C" : - console.log("printVariantWithPayloads", "C(" + (String(x._0) + (", " + (String(x._1) + ")")))); - return; + console.log("printVariantWithPayloads", "C(" + (String(x._0) + (", " + (String(x._1) + ")")))); + return; case "D" : - let match = x._0; - console.log("printVariantWithPayloads", "D((" + (String(match[0]) + (", " + (String(match[1]) + "))")))); - return; + let match = x._0; + console.log("printVariantWithPayloads", "D((" + (String(match[0]) + (", " + (String(match[1]) + "))")))); + return; case "E" : - console.log("printVariantWithPayloads", "E(" + (String(x._0) + (", " + (x._1 + (", " + (String(x._2) + ")")))))); - return; - + console.log("printVariantWithPayloads", "E(" + (String(x._0) + (", " + (x._1 + (", " + (String(x._2) + ")")))))); + return; } } diff --git a/jscomp/runtime/release.ninja b/jscomp/runtime/release.ninja index 9b7f58df4c..b848fd71bc 100644 --- a/jscomp/runtime/release.ninja +++ b/jscomp/runtime/release.ninja @@ -25,7 +25,7 @@ o runtime/caml_exceptions.cmj : cc_cmi runtime/caml_exceptions.res | runtime/cam o runtime/caml_exceptions.cmi : cc runtime/caml_exceptions.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_float.cmj : cc_cmi runtime/caml_float.res | runtime/caml_float.cmi runtime/caml_float_extern.cmj o runtime/caml_float.cmi : cc runtime/caml_float.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_format.cmj : cc_cmi runtime/caml_format.res | runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_format.cmi runtime/caml_int64.cmj runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmj +o runtime/caml_format.cmj : cc_cmi runtime/caml_format.res | runtime/caml.cmj runtime/caml_float.cmj runtime/caml_float_extern.cmj runtime/caml_format.cmi runtime/caml_int64.cmj runtime/caml_int64_extern.cmj runtime/caml_nativeint_extern.cmj runtime/caml_string_extern.cmj o runtime/caml_format.cmi : cc runtime/caml_format.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_hash.cmj : cc_cmi runtime/caml_hash.res | runtime/caml_hash.cmi runtime/caml_hash_primitive.cmj runtime/caml_nativeint_extern.cmj o runtime/caml_hash.cmi : cc runtime/caml_hash.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj @@ -41,7 +41,7 @@ o runtime/caml_md5.cmj : cc_cmi runtime/caml_md5.res | runtime/caml_array_extern o runtime/caml_md5.cmi : cc runtime/caml_md5.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_module.cmj : cc_cmi runtime/caml_module.res | runtime/caml_array_extern.cmj runtime/caml_module.cmi runtime/caml_obj.cmj o runtime/caml_module.cmi : cc runtime/caml_module.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_obj.cmj : cc_cmi runtime/caml_obj.res | runtime/caml_array_extern.cmj runtime/caml_obj.cmi runtime/caml_option.cmj +o runtime/caml_obj.cmj : cc_cmi runtime/caml_obj.res | runtime/caml.cmj runtime/caml_array_extern.cmj runtime/caml_obj.cmi runtime/caml_option.cmj o runtime/caml_obj.cmi : cc runtime/caml_obj.resi | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_option.cmj : cc_cmi runtime/caml_option.res | runtime/caml_option.cmi runtime/caml_undefined_extern.cmj o runtime/caml_option.cmi : cc runtime/caml_option.resi | runtime/bs_stdlib_mini.cmi runtime/caml_undefined_extern.cmj runtime/js.cmi runtime/js.cmj @@ -57,7 +57,7 @@ o runtime/caml_array_extern.cmi runtime/caml_array_extern.cmj : cc runtime/caml_ o runtime/caml_bigint_extern.cmi runtime/caml_bigint_extern.cmj : cc runtime/caml_bigint_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_float_extern.cmi runtime/caml_float_extern.cmj : cc runtime/caml_float_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_int64_extern.cmi runtime/caml_int64_extern.cmj : cc runtime/caml_int64_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj -o runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj : cc runtime/caml_js_exceptions.res | runtime/bs_stdlib_mini.cmi runtime/caml_exceptions.cmj runtime/js.cmi runtime/js.cmj +o runtime/caml_js_exceptions.cmi runtime/caml_js_exceptions.cmj : cc runtime/caml_js_exceptions.res | runtime/bs_stdlib_mini.cmi runtime/caml_exceptions.cmj runtime/caml_option.cmj runtime/js.cmi runtime/js.cmj o runtime/caml_nativeint_extern.cmi runtime/caml_nativeint_extern.cmj : cc runtime/caml_nativeint_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_string_extern.cmi runtime/caml_string_extern.cmj : cc runtime/caml_string_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj o runtime/caml_undefined_extern.cmi runtime/caml_undefined_extern.cmj : cc runtime/caml_undefined_extern.res | runtime/bs_stdlib_mini.cmi runtime/js.cmi runtime/js.cmj diff --git a/jscomp/test/406_primitive_test.js b/jscomp/test/406_primitive_test.js index a1b63dd5ff..7292ab1928 100644 --- a/jscomp/test/406_primitive_test.js +++ b/jscomp/test/406_primitive_test.js @@ -32,27 +32,26 @@ eq("File \"406_primitive_test.res\", line 23, characters 3-10", backend_type, { function f() { let A = /* @__PURE__ */Caml_exceptions.create("A"); try { - for(let i = 0; i <= 200; ++i){ + for (let i = 0; i <= 200; ++i) { if (i === 10) { throw new Error(A, { - cause: { - RE_EXN_ID: A, - _1: 0 - } - }); + cause: { + RE_EXN_ID: A, + _1: 0 + } + }); } } return; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === A) { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index 2aa967abd0..c6928253d2 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -5,10 +5,10 @@ let React = require("react"); function dd() { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let h = sum(1.0, 2.0); diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index fc4bad2165..dcb171e280 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -116,24 +116,22 @@ function classify$3(x) { if (typeof x !== "object" && typeof x !== "number" && (x === "C" || x === "B" || x === "A" || x === "D")) { switch (x) { case "A" : - return "a"; + return "a"; case "B" : - return "b"; + return "b"; case "C" : - return "c"; + return "c"; case "D" : - return "d"; - + return "d"; } } else { switch (typeof x) { case "string" : - return "string"; + return "string"; case "number" : - return "int"; + return "int"; case "object" : - return "Object" + x.name; - + return "Object" + x.name; } } } @@ -145,12 +143,11 @@ let MultipleBlocks = { function classify$4(x) { switch (typeof x) { case "string" : - return "string"; + return "string"; case "number" : - return "int"; + return "int"; case "object" : - return "Object" + x.name; - + return "Object" + x.name; } } @@ -164,12 +161,11 @@ function classify$5(x) { } switch (typeof x) { case "string" : - return "string"; + return "string"; case "number" : - return "int"; + return "int"; case "object" : - return "Object" + x.name; - + return "Object" + x.name; } } @@ -181,12 +177,11 @@ function classify$6(x) { if (!Array.isArray(x) && (x === null || typeof x !== "object") && typeof x !== "number" && typeof x !== "string") { switch (x) { case false : - return "JSONFalse"; + return "JSONFalse"; case true : - return "JSONTrue"; + return "JSONTrue"; case null : - return "JSONNull"; - + return "JSONNull"; } } else { if (Array.isArray(x)) { @@ -197,21 +192,20 @@ function classify$6(x) { } switch (typeof x) { case "string" : - return { - TAG: "JSONString", - _0: x - }; + return { + TAG: "JSONString", + _0: x + }; case "number" : - return { - TAG: "JSONNumber", - _0: x - }; + return { + TAG: "JSONNumber", + _0: x + }; case "object" : - return { - TAG: "JSONObject", - _0: x - }; - + return { + TAG: "JSONObject", + _0: x + }; } } } @@ -246,12 +240,11 @@ function checkEnum(e) { } switch (e) { case "One" : - return "One!"; + return "One!"; case "Two" : - return "Two"; + return "Two"; case "Three" : - return "Threeeee"; - + return "Threeeee"; } } @@ -265,12 +258,11 @@ function checkEnum$1(e) { } switch (e) { case 1.0 : - return "One!"; + return "One!"; case "Two" : - return "Two"; + return "Two"; case "Three" : - return "Threeeee"; - + return "Threeeee"; } } @@ -284,12 +276,11 @@ function checkEnum$2(e) { } switch (e) { case null : - return "One!"; + return "One!"; case "Two" : - return "Two"; + return "Two"; case "Three" : - return "Threeeee"; - + return "Threeeee"; } } @@ -370,10 +361,9 @@ function classify$9(v) { } switch (typeof v) { case "object" : - return v.x; + return v.x; case "function" : - return v(3); - + return v(3); } } @@ -466,10 +456,9 @@ async function getUserName(u) { } switch (typeof u) { case "object" : - return u.name; + return u.name; case "string" : - return u; - + return u; } } @@ -480,8 +469,7 @@ async function awaitUser(u) { switch (typeof u) { case "object" : case "string" : - return "dummy"; - + return "dummy"; } } @@ -511,12 +499,11 @@ async function classify$10(a) { } switch (typeof a) { case "string" : - console.log(a); - return; + console.log(a); + return; case "object" : - console.log(a.userName); - return; - + console.log(a.userName); + return; } } } @@ -554,12 +541,11 @@ async function classifyAll(t) { } switch (typeof t) { case "string" : - console.log(t); - return; + console.log(t); + return; case "object" : - console.log(t.userName); - return; - + console.log(t.userName); + return; } } @@ -570,12 +556,11 @@ let AllInstanceofTypes = { function test(t) { switch (typeof t) { case "object" : - return Js_dict.get(t, "Hello"); + return Js_dict.get(t, "Hello"); case "string" : - return t; + return t; case "function" : - return t(); - + return t(); } } @@ -596,10 +581,9 @@ function should_not_merge(x) { } switch (typeof x) { case "boolean" : - return "boolean"; + return "boolean"; case "object" : - return "do not merge"; - + return "do not merge"; } } @@ -613,8 +597,7 @@ function can_merge(x) { switch (typeof x) { case "boolean" : case "object" : - return "merge"; - + return "merge"; } } diff --git a/jscomp/test/a_scope_bug.js b/jscomp/test/a_scope_bug.js index f80dcfef42..0a36a2d18c 100644 --- a/jscomp/test/a_scope_bug.js +++ b/jscomp/test/a_scope_bug.js @@ -3,7 +3,7 @@ function odd(_z) { - while(true) { + while (true) { let z = _z; let even = Math.imul(z, z); let a = (even + 4 | 0) + even | 0; diff --git a/jscomp/test/adt_optimize_test.js b/jscomp/test/adt_optimize_test.js index 6d6f16665b..29405a959d 100644 --- a/jscomp/test/adt_optimize_test.js +++ b/jscomp/test/adt_optimize_test.js @@ -5,24 +5,22 @@ function f(x) { switch (x) { case "A" : - return 1; + return 1; case "B" : - return 2; + return 2; case "C" : - return 3; - + return 3; } } function f_0(x) { switch (x) { case "A" : - return -1; + return -1; case "B" : - return 0; + return 0; case "C" : - return 1; - + return 1; } } @@ -32,28 +30,26 @@ function f2(x) { } switch (x) { case 0 : - return "T000"; + return "T000"; case 1 : - return "T001"; + return "T001"; case 2 : - return "T002"; - + return "T002"; } } function f3(x) { switch (x) { case "X0" : - return "Y0"; + return "Y0"; case "X1" : - return "Y1"; + return "Y1"; case "X2" : - return "Y2"; + return "Y2"; case "X3" : - return "Y3"; + return "Y3"; case "X4" : - return "Y4"; - + return "Y4"; } } @@ -65,21 +61,19 @@ function f5(x) { if (typeof x !== "object") { switch (x) { case "A" : - return 1; + return 1; case "B" : - return 3; + return 3; case "F" : - return 4; - + return 4; } } else { switch (x.TAG) { case "C" : case "D" : - return 1; + return 1; case "E" : - return 2; - + return 2; } } } @@ -91,10 +85,9 @@ function f6(x) { switch (x) { case "A" : case "B" : - return 0; + return 0; case "F" : - return 2; - + return 2; } } @@ -102,22 +95,20 @@ function f7(x) { if (typeof x !== "object") { switch (x) { case "A" : - return 1; + return 1; case "B" : - return 2; + return 2; case "F" : - return -1; - + return -1; } } else { switch (x.TAG) { case "C" : - return 3; + return 3; case "D" : - return 4; + return 4; case "E" : - return -1; - + return -1; } } } @@ -127,7 +118,7 @@ function f8(x) { switch (x) { case "T60" : case "T61" : - return 1; + return 1; default: return 3; } @@ -135,7 +126,7 @@ function f8(x) { switch (x.TAG) { case "T64" : case "T65" : - return 2; + return 2; default: return 3; } @@ -153,11 +144,10 @@ function f9(x) { switch (x.TAG) { case "T64" : case "T65" : - return 2; + return 2; case "T66" : case "T68" : - return 3; - + return 3; } } @@ -165,24 +155,22 @@ function f10(x) { if (typeof x !== "object") { switch (x) { case "T60" : - return 0; + return 0; case "T61" : - return 2; + return 2; case "T62" : - return 4; + return 4; case "T63" : - return 1; - + return 1; } } else { switch (x.TAG) { case "T64" : case "T65" : - return 2; + return 2; case "T66" : case "T68" : - return 3; - + return 3; } } } @@ -195,15 +183,15 @@ function f11(x) { return 1; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "adt_optimize_test.res", - 202, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "adt_optimize_test.res", + 202, + 9 + ] + } + }); } exports.f = f; diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index dbb2dba54b..fad105c1a9 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -4,7 +4,7 @@ let Mt = require("./mt.js"); function f(b, x, _n) { - while(true) { + while (true) { let n = _n; if (n > 100000) { return false; @@ -18,7 +18,7 @@ function f(b, x, _n) { } function or_f(b, x, _n) { - while(true) { + while (true) { let n = _n; if (n > 100000) { return false; diff --git a/jscomp/test/argv_test.js b/jscomp/test/argv_test.js index 92dad01f3b..d324689acb 100644 --- a/jscomp/test/argv_test.js +++ b/jscomp/test/argv_test.js @@ -51,28 +51,28 @@ Arg.parse_argv(undefined, [ if (compile.contents !== true) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "argv_test.res", - 14, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "argv_test.res", + 14, + 2 + ] + } + }); } if (test.contents !== false) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "argv_test.res", - 15, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "argv_test.res", + 15, + 2 + ] + } + }); } exports.anno_fun = anno_fun; diff --git a/jscomp/test/arith_lexer.js b/jscomp/test/arith_lexer.js index 7ede8cf05e..6d54073905 100644 --- a/jscomp/test/arith_lexer.js +++ b/jscomp/test/arith_lexer.js @@ -119,37 +119,37 @@ let __ocaml_lex_tables = { }; function __ocaml_lex_lexeme_rec(lexbuf, ___ocaml_lex_state) { - while(true) { + while (true) { let __ocaml_lex_state = ___ocaml_lex_state; let __ocaml_lex_state$1 = Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - ___ocaml_lex_state = 0; - continue; + ___ocaml_lex_state = 0; + continue; case 1 : - return { - TAG: "NUMERAL", - _0: Caml_format.int_of_string(Lexing.lexeme(lexbuf)) - }; + return { + TAG: "NUMERAL", + _0: Caml_format.int_of_string(Lexing.lexeme(lexbuf)) + }; case 2 : - return { - TAG: "IDENT", - _0: Lexing.lexeme(lexbuf) - }; + return { + TAG: "IDENT", + _0: Lexing.lexeme(lexbuf) + }; case 3 : - return "PLUS"; + return "PLUS"; case 4 : - return "MINUS"; + return "MINUS"; case 5 : - return "TIMES"; + return "TIMES"; case 6 : - return "DIVIDE"; + return "DIVIDE"; case 7 : - return "LPAREN"; + return "LPAREN"; case 8 : - return "RPAREN"; + return "RPAREN"; case 9 : - return "EOF"; + return "EOF"; default: lexbuf.refill_buff(lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; @@ -165,20 +165,19 @@ function lexeme(lexbuf) { function str(e) { switch (e.TAG) { case "Numeral" : - return Pervasives.string_of_float(e._0); + return Pervasives.string_of_float(e._0); case "Plus" : - return str(e._0) + ("+" + str(e._1)); + return str(e._0) + ("+" + str(e._1)); case "Minus" : - return str(e._0) + ("-" + str(e._1)); + return str(e._0) + ("-" + str(e._1)); case "Times" : - return str(e._0) + ("*" + str(e._1)); + return str(e._0) + ("*" + str(e._1)); case "Divide" : - return str(e._0) + ("/" + str(e._1)); + return str(e._0) + ("/" + str(e._1)); case "Negate" : - return "-" + str(e._0); + return "-" + str(e._0); case "Variable" : - return e._0; - + return e._0; } } diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index a0e7289ded..4fb23e6ba0 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -141,11 +141,11 @@ let yynames_block = "\ let yyact = [ (function (param) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "parser" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "parser" + } + }); }), (function (__caml_parser_env) { return Parsing.peek_val(__caml_parser_env, 1); @@ -212,11 +212,11 @@ let yyact = [ }), (function (__caml_parser_env) { throw new Error(Parsing.YYexit, { - cause: { - RE_EXN_ID: Parsing.YYexit, - _1: Parsing.peek_val(__caml_parser_env, 0) - } - }); + cause: { + RE_EXN_ID: Parsing.YYexit, + _1: Parsing.peek_val(__caml_parser_env, 0) + } + }); }) ]; diff --git a/jscomp/test/arith_syntax.js b/jscomp/test/arith_syntax.js index 1847109dfd..250f53064e 100644 --- a/jscomp/test/arith_syntax.js +++ b/jscomp/test/arith_syntax.js @@ -6,20 +6,19 @@ let Pervasives = require("../../lib/js/pervasives.js"); function str(e) { switch (e.TAG) { case "Numeral" : - return Pervasives.string_of_float(e._0); + return Pervasives.string_of_float(e._0); case "Plus" : - return str(e._0) + ("+" + str(e._1)); + return str(e._0) + ("+" + str(e._1)); case "Minus" : - return str(e._0) + ("-" + str(e._1)); + return str(e._0) + ("-" + str(e._1)); case "Times" : - return str(e._0) + ("*" + str(e._1)); + return str(e._0) + ("*" + str(e._1)); case "Divide" : - return str(e._0) + ("/" + str(e._1)); + return str(e._0) + ("/" + str(e._1)); case "Negate" : - return "-" + str(e._0); + return "-" + str(e._0); case "Variable" : - return e._0; - + return e._0; } } diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index e79d4a0c52..68084b77bd 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -10,20 +10,20 @@ function f0(x) { }); } else { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } return tmp(3); } function f1(x) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); return undefined(x); } @@ -31,31 +31,31 @@ function f3(x) { let tmp; switch (x) { case 0 : - tmp = (function (x) { - return x + 1 | 0; - }); - break; + tmp = (function (x) { + return x + 1 | 0; + }); + break; case 1 : - tmp = (function (x) { - return x + 2 | 0; - }); - break; + tmp = (function (x) { + return x + 2 | 0; + }); + break; case 2 : - tmp = (function (x) { - return x + 3 | 0; - }); - break; + tmp = (function (x) { + return x + 3 | 0; + }); + break; case 3 : - tmp = (function (x) { - return x + 4 | 0; - }); - break; + tmp = (function (x) { + return x + 4 | 0; + }); + break; default: throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } return tmp(3); } diff --git a/jscomp/test/array_safe_get.js b/jscomp/test/array_safe_get.js index fe009ae40c..ce8a0437bf 100644 --- a/jscomp/test/array_safe_get.js +++ b/jscomp/test/array_safe_get.js @@ -13,16 +13,15 @@ let y; try { y = Caml_array.get(x, 3); -} -catch (raw_msg){ +} catch (raw_msg) { let msg = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg.RE_EXN_ID === "Invalid_argument") { console.log(msg._1); y = 0; } else { throw new Error(msg.RE_EXN_ID, { - cause: msg - }); + cause: msg + }); } } diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index c978ce2889..20c655d7d5 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -70,7 +70,7 @@ eq("File \"array_subtle_test.res\", line 22, characters 5-12", [ Caml_array.get(v, 2) ]); -while(v.length > 0) { +while (v.length > 0) { v.pop(); }; diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 8e971d222b..3045800bd1 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -18,33 +18,32 @@ function starts_with(xs, prefix, p) { return false; } try { - for(let i = 0; i < len2; ++i){ + for (let i = 0; i < len2; ++i) { if (!p(Caml_array.get(xs, i), Caml_array.get(prefix, i))) { throw new Error(H, { - cause: { - RE_EXN_ID: H - } - }); + cause: { + RE_EXN_ID: H + } + }); } } return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === H) { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function is_sorted(x) { let len = x.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= (len - 1 | 0)) { return true; diff --git a/jscomp/test/async_inside_loop.js b/jscomp/test/async_inside_loop.js index 226c4ac47b..0f1d7d0fe1 100644 --- a/jscomp/test/async_inside_loop.js +++ b/jscomp/test/async_inside_loop.js @@ -3,7 +3,7 @@ async function topLevelAsyncFunction() { - for(let innerScopeVal = 0; innerScopeVal <= 3; ++innerScopeVal){ + for (let innerScopeVal = 0; innerScopeVal <= 3; ++innerScopeVal) { let asyncClosureAccessingScopedVal = async function () { console.log("Accessing scoped var inside loop", innerScopeVal); return await Promise.resolve(); diff --git a/jscomp/test/bal_set_mini.js b/jscomp/test/bal_set_mini.js index 45059e12cf..3e5ebbf698 100644 --- a/jscomp/test/bal_set_mini.js +++ b/jscomp/test/bal_set_mini.js @@ -98,7 +98,7 @@ function add(x, x_) { } function min_elt(_def, _x) { - while(true) { + while (true) { let x = _x; let def = _def; if (typeof x !== "object") { @@ -151,7 +151,7 @@ function remove(x, tree) { } function mem(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -167,18 +167,18 @@ function mem(x, _x_) { let v = "Empty"; -for(let i = 0; i <= 100000; ++i){ +for (let i = 0; i <= 100000; ++i) { v = add(i, v); } -for(let i$1 = 0; i$1 <= 100000; ++i$1){ +for (let i$1 = 0; i$1 <= 100000; ++i$1) { if (!mem(i$1, v)) { console.log("impossible"); } } -for(let i$2 = 0; i$2 <= 100000; ++i$2){ +for (let i$2 = 0; i$2 <= 100000; ++i$2) { v = remove(i$2, v); } diff --git a/jscomp/test/bb.js b/jscomp/test/bb.js index 0ad98406be..ad4c90bb11 100644 --- a/jscomp/test/bb.js +++ b/jscomp/test/bb.js @@ -15,22 +15,22 @@ function f(x) { function ff(x) { switch (x) { case "a" : - return "a"; + return "a"; case "b" : - return "b"; + return "b"; case "c" : - return "c"; + return "c"; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bb.res", - 13, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bb.res", + 13, + 9 + ] + } + }); } } @@ -38,25 +38,25 @@ function test(x) { let match; switch (x) { case "a" : - match = "a"; - break; + match = "a"; + break; case "b" : - match = "b"; - break; + match = "b"; + break; case "c" : - match = "c"; - break; + match = "c"; + break; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bb.res", - 21, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bb.res", + 21, + 9 + ] + } + }); } if (match === "b") { return "b"; diff --git a/jscomp/test/bdd.js b/jscomp/test/bdd.js index db7281675d..f408c2c3d7 100644 --- a/jscomp/test/bdd.js +++ b/jscomp/test/bdd.js @@ -4,7 +4,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); function $$eval(_bdd, vars) { - while(true) { + while (true) { let bdd = _bdd; if (typeof bdd !== "object") { if (bdd === "One") { @@ -59,7 +59,7 @@ function resize(newSize) { let newSz_1 = newSize - 1 | 0; let newArr = Caml_array.make(newSize, /* [] */0); let copyBucket = function (_bucket) { - while(true) { + while (true) { let bucket = _bucket; if (!bucket) { return; @@ -68,26 +68,26 @@ function resize(newSize) { if (typeof n !== "object") { if (n === "One") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bdd.res", - 60, - 13 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bdd.res", + 60, + 13 + ] + } + }); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bdd.res", - 60, - 13 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bdd.res", + 60, + 13 + ] + } + }); } else { let ind = hashVal(getId(n._0), getId(n._3), n._1) & newSz_1; Caml_array.set(newArr, ind, { @@ -99,7 +99,7 @@ function resize(newSize) { } }; }; - for(let n = 0 ,n_finish = sz_1.contents; n <= n_finish; ++n){ + for (let n = 0, n_finish = sz_1.contents; n <= n_finish; ++n) { copyBucket(Caml_array.get(arr, n)); } htab.contents = newArr; @@ -139,33 +139,33 @@ function mkNode(low, v, high) { let ind = hashVal(idl, idh, v) & sz_1.contents; let bucket = Caml_array.get(htab.contents, ind); let _b = bucket; - while(true) { + while (true) { let b = _b; if (b) { let n = b.hd; if (typeof n !== "object") { if (n === "One") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bdd.res", - 121, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bdd.res", + 121, + 15 + ] + } + }); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bdd.res", - 121, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bdd.res", + 121, + 15 + ] + } + }); } else { if (v === n._1 && idl === getId(n._0) && idh === getId(n._3)) { return n; @@ -272,15 +272,14 @@ function and2(n1, n2) { let f; switch (match) { case "LESS" : - f = mkNode(and2(l1, n2), v1, and2(r1, n2)); - break; + f = mkNode(and2(l1, n2), v1, and2(r1, n2)); + break; case "EQUAL" : - f = mkNode(and2(l1, l2), v1, and2(r1, r2)); - break; + f = mkNode(and2(l1, l2), v1, and2(r1, r2)); + break; case "GREATER" : - f = mkNode(and2(n1, l2), v2, and2(n1, r2)); - break; - + f = mkNode(and2(n1, l2), v2, and2(n1, r2)); + break; } Caml_array.set(andslot1, h, i1); Caml_array.set(andslot2, h, i2); @@ -319,15 +318,14 @@ function xor(n1, n2) { let f; switch (match) { case "LESS" : - f = mkNode(xor(l1, n2), v1, xor(r1, n2)); - break; + f = mkNode(xor(l1, n2), v1, xor(r1, n2)); + break; case "EQUAL" : - f = mkNode(xor(l1, l2), v1, xor(r1, r2)); - break; + f = mkNode(xor(l1, l2), v1, xor(r1, r2)); + break; case "GREATER" : - f = mkNode(xor(n1, l2), v2, xor(n1, r2)); - break; - + f = mkNode(xor(n1, l2), v2, xor(n1, r2)); + break; } Caml_array.set(andslot1, h, i1); Caml_array.set(andslot2, h, i2); @@ -364,7 +362,7 @@ function random() { function random_vars(n) { let vars = Caml_array.make(n, false); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { Caml_array.set(vars, i, random()); } return vars; @@ -386,7 +384,7 @@ function bool_equal(a, b) { function test_hwb(bdd, vars) { let ntrue = 0; - for(let i = 0 ,i_finish = vars.length; i < i_finish; ++i){ + for (let i = 0, i_finish = vars.length; i < i_finish; ++i) { if (Caml_array.get(vars, i)) { ntrue = ntrue + 1 | 0; } @@ -398,22 +396,22 @@ function test_hwb(bdd, vars) { function main() { let bdd = hwb(22); let succeeded = true; - for(let i = 1; i <= 100; ++i){ + for (let i = 1; i <= 100; ++i) { succeeded = succeeded && test_hwb(bdd, random_vars(22)); } if (succeeded) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bdd.res", - 301, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bdd.res", + 301, + 2 + ] + } + }); } main(); diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index d23518c4a5..d1403d2e36 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -13,7 +13,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f$1(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f$1(a[i]); } return r; @@ -28,14 +28,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f$1(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f$1(i); } return res; @@ -46,7 +46,7 @@ function fold_left(f, x, a) { return f(x, y); }; let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f$1(r, a[i]); } return r; diff --git a/jscomp/test/big_enum.js b/jscomp/test/big_enum.js index c1d5ed7922..108718e9cc 100644 --- a/jscomp/test/big_enum.js +++ b/jscomp/test/big_enum.js @@ -5,1212 +5,1210 @@ function to_enum(x) { switch (x) { case "A0" : - return 0; + return 0; case "A1" : - return 1; + return 1; case "A2" : - return 2; + return 2; case "A3" : - return 3; + return 3; case "A4" : - return 4; + return 4; case "A5" : - return 5; + return 5; case "A6" : - return 6; + return 6; case "A7" : - return 7; + return 7; case "A8" : - return 8; + return 8; case "A9" : - return 9; + return 9; case "A10" : - return 10; + return 10; case "A11" : - return 11; + return 11; case "A12" : - return 12; + return 12; case "A13" : - return 13; + return 13; case "A14" : - return 14; + return 14; case "A15" : - return 15; + return 15; case "A16" : - return 16; + return 16; case "A17" : - return 17; + return 17; case "A18" : - return 18; + return 18; case "A19" : - return 19; + return 19; case "A20" : - return 20; + return 20; case "A21" : - return 21; + return 21; case "A22" : - return 22; + return 22; case "A23" : - return 23; + return 23; case "A24" : - return 24; + return 24; case "A25" : - return 25; + return 25; case "A26" : - return 26; + return 26; case "A27" : - return 27; + return 27; case "A28" : - return 28; + return 28; case "A29" : - return 29; + return 29; case "A30" : - return 30; + return 30; case "A31" : - return 31; + return 31; case "A32" : - return 32; + return 32; case "A33" : - return 33; + return 33; case "A34" : - return 34; + return 34; case "A35" : - return 35; + return 35; case "A36" : - return 36; + return 36; case "A37" : - return 37; + return 37; case "A38" : - return 38; + return 38; case "A39" : - return 39; + return 39; case "A40" : - return 40; + return 40; case "A41" : - return 41; + return 41; case "A42" : - return 42; + return 42; case "A43" : - return 43; + return 43; case "A44" : - return 44; + return 44; case "A45" : - return 45; + return 45; case "A46" : - return 46; + return 46; case "A47" : - return 47; + return 47; case "A48" : - return 48; + return 48; case "A49" : - return 49; + return 49; case "A50" : - return 50; + return 50; case "A51" : - return 51; + return 51; case "A52" : - return 52; + return 52; case "A53" : - return 53; + return 53; case "A54" : - return 54; + return 54; case "A55" : - return 55; + return 55; case "A56" : - return 56; + return 56; case "A57" : - return 57; + return 57; case "A58" : - return 58; + return 58; case "A59" : - return 59; + return 59; case "A60" : - return 60; + return 60; case "A61" : - return 61; + return 61; case "A62" : - return 62; + return 62; case "A63" : - return 63; + return 63; case "A64" : - return 64; + return 64; case "A65" : - return 65; + return 65; case "A66" : - return 66; + return 66; case "A67" : - return 67; + return 67; case "A68" : - return 68; + return 68; case "A69" : - return 69; + return 69; case "A70" : - return 70; + return 70; case "A71" : - return 71; + return 71; case "A72" : - return 72; + return 72; case "A73" : - return 73; + return 73; case "A74" : - return 74; + return 74; case "A75" : - return 75; + return 75; case "A76" : - return 76; + return 76; case "A77" : - return 77; + return 77; case "A78" : - return 78; + return 78; case "A79" : - return 79; + return 79; case "A80" : - return 80; + return 80; case "A81" : - return 81; + return 81; case "A82" : - return 82; + return 82; case "A83" : - return 83; + return 83; case "A84" : - return 84; + return 84; case "A85" : - return 85; + return 85; case "A86" : - return 86; + return 86; case "A87" : - return 87; + return 87; case "A88" : - return 88; + return 88; case "A89" : - return 89; + return 89; case "A90" : - return 90; + return 90; case "A91" : - return 91; + return 91; case "A92" : - return 92; + return 92; case "A93" : - return 93; + return 93; case "A94" : - return 94; + return 94; case "A95" : - return 95; + return 95; case "A96" : - return 96; + return 96; case "A97" : - return 97; + return 97; case "A98" : - return 98; + return 98; case "A99" : - return 99; + return 99; case "A100" : - return 100; + return 100; case "A101" : - return 101; + return 101; case "A102" : - return 102; + return 102; case "A103" : - return 103; + return 103; case "A104" : - return 104; + return 104; case "A105" : - return 105; + return 105; case "A106" : - return 106; + return 106; case "A107" : - return 107; + return 107; case "A108" : - return 108; + return 108; case "A109" : - return 109; + return 109; case "A110" : - return 110; + return 110; case "A111" : - return 111; + return 111; case "A112" : - return 112; + return 112; case "A113" : - return 113; + return 113; case "A114" : - return 114; + return 114; case "A115" : - return 115; + return 115; case "A116" : - return 116; + return 116; case "A117" : - return 117; + return 117; case "A118" : - return 118; + return 118; case "A119" : - return 119; + return 119; case "A120" : - return 120; + return 120; case "A121" : - return 121; + return 121; case "A122" : - return 122; + return 122; case "A123" : - return 123; + return 123; case "A124" : - return 124; + return 124; case "A125" : - return 125; + return 125; case "A126" : - return 126; + return 126; case "A127" : - return 127; + return 127; case "A128" : - return 128; + return 128; case "A129" : - return 129; + return 129; case "A130" : - return 130; + return 130; case "A131" : - return 131; + return 131; case "A132" : - return 132; + return 132; case "A133" : - return 133; + return 133; case "A134" : - return 134; + return 134; case "A135" : - return 135; + return 135; case "A136" : - return 136; + return 136; case "A137" : - return 137; + return 137; case "A138" : - return 138; + return 138; case "A139" : - return 139; + return 139; case "A140" : - return 140; + return 140; case "A141" : - return 141; + return 141; case "A142" : - return 142; + return 142; case "A143" : - return 143; + return 143; case "A144" : - return 144; + return 144; case "A145" : - return 145; + return 145; case "A146" : - return 146; + return 146; case "A147" : - return 147; + return 147; case "A148" : - return 148; + return 148; case "A149" : - return 149; + return 149; case "A150" : - return 150; + return 150; case "A151" : - return 151; + return 151; case "A152" : - return 152; + return 152; case "A153" : - return 153; + return 153; case "A154" : - return 154; + return 154; case "A155" : - return 155; + return 155; case "A156" : - return 156; + return 156; case "A157" : - return 157; + return 157; case "A158" : - return 158; + return 158; case "A159" : - return 159; + return 159; case "A160" : - return 160; + return 160; case "A161" : - return 161; + return 161; case "A162" : - return 162; + return 162; case "A163" : - return 163; + return 163; case "A164" : - return 164; + return 164; case "A165" : - return 165; + return 165; case "A166" : - return 166; + return 166; case "A167" : - return 167; + return 167; case "A168" : - return 168; + return 168; case "A169" : - return 169; + return 169; case "A170" : - return 170; + return 170; case "A171" : - return 171; + return 171; case "A172" : - return 172; + return 172; case "A173" : - return 173; + return 173; case "A174" : - return 174; + return 174; case "A175" : - return 175; + return 175; case "A176" : - return 176; + return 176; case "A177" : - return 177; + return 177; case "A178" : - return 178; + return 178; case "A179" : - return 179; + return 179; case "A180" : - return 180; + return 180; case "A181" : - return 181; + return 181; case "A182" : - return 182; + return 182; case "A183" : - return 183; + return 183; case "A184" : - return 184; + return 184; case "A185" : - return 185; + return 185; case "A186" : - return 186; + return 186; case "A187" : - return 187; + return 187; case "A188" : - return 188; + return 188; case "A189" : - return 189; + return 189; case "A190" : - return 190; + return 190; case "A191" : - return 191; + return 191; case "A192" : - return 192; + return 192; case "A193" : - return 193; + return 193; case "A194" : - return 194; + return 194; case "A195" : - return 195; + return 195; case "A196" : - return 196; + return 196; case "A197" : - return 197; + return 197; case "A198" : - return 198; + return 198; case "A199" : - return 199; + return 199; case "A200" : - return 200; + return 200; case "A201" : - return 201; + return 201; case "A202" : - return 202; + return 202; case "A203" : - return 203; + return 203; case "A204" : - return 204; + return 204; case "A205" : - return 205; + return 205; case "A206" : - return 206; + return 206; case "A207" : - return 207; + return 207; case "A208" : - return 208; + return 208; case "A209" : - return 209; + return 209; case "A210" : - return 210; + return 210; case "A211" : - return 211; + return 211; case "A212" : - return 212; + return 212; case "A213" : - return 213; + return 213; case "A214" : - return 214; + return 214; case "A215" : - return 215; + return 215; case "A216" : - return 216; + return 216; case "A217" : - return 217; + return 217; case "A218" : - return 218; + return 218; case "A219" : - return 219; + return 219; case "A220" : - return 220; + return 220; case "A221" : - return 221; + return 221; case "A222" : - return 222; + return 222; case "A223" : - return 223; + return 223; case "A224" : - return 224; + return 224; case "A225" : - return 225; + return 225; case "A226" : - return 226; + return 226; case "A227" : - return 227; + return 227; case "A228" : - return 228; + return 228; case "A229" : - return 229; + return 229; case "A230" : - return 230; + return 230; case "A231" : - return 231; + return 231; case "A232" : - return 232; + return 232; case "A233" : - return 233; + return 233; case "A234" : - return 234; + return 234; case "A235" : - return 235; + return 235; case "A236" : - return 236; + return 236; case "A237" : - return 237; + return 237; case "A238" : - return 238; + return 238; case "A239" : - return 239; + return 239; case "A240" : - return 240; + return 240; case "A241" : - return 241; + return 241; case "A242" : - return 242; + return 242; case "A243" : - return 243; + return 243; case "A244" : - return 244; + return 244; case "A245" : - return 245; + return 245; case "A246" : - return 246; + return 246; case "A247" : - return 247; + return 247; case "A248" : - return 248; + return 248; case "A249" : - return 249; + return 249; case "A250" : - return 250; + return 250; case "A251" : - return 251; + return 251; case "A252" : - return 252; + return 252; case "A253" : - return 253; + return 253; case "A254" : - return 254; + return 254; case "A255" : - return 255; + return 255; case "A256" : - return 256; + return 256; case "A257" : - return 257; + return 257; case "A258" : - return 258; + return 258; case "A259" : - return 259; + return 259; case "A260" : - return 260; + return 260; case "A261" : - return 261; + return 261; case "A262" : - return 262; + return 262; case "A263" : - return 263; + return 263; case "A264" : - return 264; + return 264; case "A265" : - return 265; + return 265; case "A266" : - return 266; + return 266; case "A267" : - return 267; + return 267; case "A268" : - return 268; + return 268; case "A269" : - return 269; + return 269; case "A270" : - return 270; + return 270; case "A271" : - return 271; + return 271; case "A272" : - return 272; + return 272; case "A273" : - return 273; + return 273; case "A274" : - return 274; + return 274; case "A275" : - return 275; + return 275; case "A276" : - return 276; + return 276; case "A277" : - return 277; + return 277; case "A278" : - return 278; + return 278; case "A279" : - return 279; + return 279; case "A280" : - return 280; + return 280; case "A281" : - return 281; + return 281; case "A282" : - return 282; + return 282; case "A283" : - return 283; + return 283; case "A284" : - return 284; + return 284; case "A285" : - return 285; + return 285; case "A286" : - return 286; + return 286; case "A287" : - return 287; + return 287; case "A288" : - return 288; + return 288; case "A289" : - return 289; + return 289; case "A290" : - return 290; + return 290; case "A291" : - return 291; + return 291; case "A292" : - return 292; + return 292; case "A293" : - return 293; + return 293; case "A294" : - return 294; + return 294; case "A295" : - return 295; + return 295; case "A296" : - return 296; + return 296; case "A297" : - return 297; + return 297; case "A298" : - return 298; + return 298; case "A299" : - return 299; - + return 299; } } function to_string(x) { switch (x) { case "A0" : - return "A0"; + return "A0"; case "A1" : - return "A1"; + return "A1"; case "A2" : - return "A2"; + return "A2"; case "A3" : - return "A3"; + return "A3"; case "A4" : - return "A4"; + return "A4"; case "A5" : - return "A5"; + return "A5"; case "A6" : - return "A6"; + return "A6"; case "A7" : - return "A7"; + return "A7"; case "A8" : - return "A8"; + return "A8"; case "A9" : - return "A9"; + return "A9"; case "A10" : - return "A10"; + return "A10"; case "A11" : - return "A11"; + return "A11"; case "A12" : - return "A12"; + return "A12"; case "A13" : - return "A13"; + return "A13"; case "A14" : - return "A14"; + return "A14"; case "A15" : - return "A15"; + return "A15"; case "A16" : - return "A16"; + return "A16"; case "A17" : - return "A17"; + return "A17"; case "A18" : - return "A18"; + return "A18"; case "A19" : - return "A19"; + return "A19"; case "A20" : - return "A20"; + return "A20"; case "A21" : - return "A21"; + return "A21"; case "A22" : - return "A22"; + return "A22"; case "A23" : - return "A23"; + return "A23"; case "A24" : - return "A24"; + return "A24"; case "A25" : - return "A25"; + return "A25"; case "A26" : - return "A26"; + return "A26"; case "A27" : - return "A27"; + return "A27"; case "A28" : - return "A28"; + return "A28"; case "A29" : - return "A29"; + return "A29"; case "A30" : - return "A30"; + return "A30"; case "A31" : - return "A31"; + return "A31"; case "A32" : - return "A32"; + return "A32"; case "A33" : - return "A33"; + return "A33"; case "A34" : - return "A34"; + return "A34"; case "A35" : - return "A35"; + return "A35"; case "A36" : - return "A36"; + return "A36"; case "A37" : - return "A37"; + return "A37"; case "A38" : - return "A38"; + return "A38"; case "A39" : - return "A39"; + return "A39"; case "A40" : - return "A40"; + return "A40"; case "A41" : - return "A41"; + return "A41"; case "A42" : - return "A42"; + return "A42"; case "A43" : - return "A43"; + return "A43"; case "A44" : - return "A44"; + return "A44"; case "A45" : - return "A45"; + return "A45"; case "A46" : - return "A46"; + return "A46"; case "A47" : - return "A47"; + return "A47"; case "A48" : - return "A48"; + return "A48"; case "A49" : - return "A49"; + return "A49"; case "A50" : - return "A50"; + return "A50"; case "A51" : - return "A51"; + return "A51"; case "A52" : - return "A52"; + return "A52"; case "A53" : - return "A53"; + return "A53"; case "A54" : - return "A54"; + return "A54"; case "A55" : - return "A55"; + return "A55"; case "A56" : - return "A56"; + return "A56"; case "A57" : - return "A57"; + return "A57"; case "A58" : - return "A58"; + return "A58"; case "A59" : - return "A59"; + return "A59"; case "A60" : - return "A60"; + return "A60"; case "A61" : - return "A61"; + return "A61"; case "A62" : - return "A62"; + return "A62"; case "A63" : - return "A63"; + return "A63"; case "A64" : - return "A64"; + return "A64"; case "A65" : - return "A65"; + return "A65"; case "A66" : - return "A66"; + return "A66"; case "A67" : - return "A67"; + return "A67"; case "A68" : - return "A68"; + return "A68"; case "A69" : - return "A69"; + return "A69"; case "A70" : - return "A70"; + return "A70"; case "A71" : - return "A71"; + return "A71"; case "A72" : - return "A72"; + return "A72"; case "A73" : - return "A73"; + return "A73"; case "A74" : - return "A74"; + return "A74"; case "A75" : - return "A75"; + return "A75"; case "A76" : - return "A76"; + return "A76"; case "A77" : - return "A77"; + return "A77"; case "A78" : - return "A78"; + return "A78"; case "A79" : - return "A79"; + return "A79"; case "A80" : - return "A80"; + return "A80"; case "A81" : - return "A81"; + return "A81"; case "A82" : - return "A82"; + return "A82"; case "A83" : - return "A83"; + return "A83"; case "A84" : - return "A84"; + return "A84"; case "A85" : - return "A85"; + return "A85"; case "A86" : - return "A86"; + return "A86"; case "A87" : - return "A87"; + return "A87"; case "A88" : - return "A88"; + return "A88"; case "A89" : - return "A89"; + return "A89"; case "A90" : - return "A90"; + return "A90"; case "A91" : - return "A91"; + return "A91"; case "A92" : - return "A92"; + return "A92"; case "A93" : - return "A93"; + return "A93"; case "A94" : - return "A94"; + return "A94"; case "A95" : - return "A95"; + return "A95"; case "A96" : - return "A96"; + return "A96"; case "A97" : - return "A97"; + return "A97"; case "A98" : - return "A98"; + return "A98"; case "A99" : - return "A99"; + return "A99"; case "A100" : - return "A100"; + return "A100"; case "A101" : - return "A101"; + return "A101"; case "A102" : - return "A102"; + return "A102"; case "A103" : - return "A103"; + return "A103"; case "A104" : - return "A104"; + return "A104"; case "A105" : - return "A105"; + return "A105"; case "A106" : - return "A106"; + return "A106"; case "A107" : - return "A107"; + return "A107"; case "A108" : - return "A108"; + return "A108"; case "A109" : - return "A109"; + return "A109"; case "A110" : - return "A110"; + return "A110"; case "A111" : - return "A111"; + return "A111"; case "A112" : - return "A112"; + return "A112"; case "A113" : - return "A113"; + return "A113"; case "A114" : - return "A114"; + return "A114"; case "A115" : - return "A115"; + return "A115"; case "A116" : - return "A116"; + return "A116"; case "A117" : - return "A117"; + return "A117"; case "A118" : - return "A118"; + return "A118"; case "A119" : - return "A119"; + return "A119"; case "A120" : - return "A120"; + return "A120"; case "A121" : - return "A121"; + return "A121"; case "A122" : - return "A122"; + return "A122"; case "A123" : - return "A123"; + return "A123"; case "A124" : - return "A124"; + return "A124"; case "A125" : - return "A125"; + return "A125"; case "A126" : - return "A126"; + return "A126"; case "A127" : - return "A127"; + return "A127"; case "A128" : - return "A128"; + return "A128"; case "A129" : - return "A129"; + return "A129"; case "A130" : - return "A130"; + return "A130"; case "A131" : - return "A131"; + return "A131"; case "A132" : - return "A132"; + return "A132"; case "A133" : - return "A133"; + return "A133"; case "A134" : - return "A134"; + return "A134"; case "A135" : - return "A135"; + return "A135"; case "A136" : - return "A136"; + return "A136"; case "A137" : - return "A137"; + return "A137"; case "A138" : - return "A138"; + return "A138"; case "A139" : - return "A139"; + return "A139"; case "A140" : - return "A140"; + return "A140"; case "A141" : - return "A141"; + return "A141"; case "A142" : - return "A142"; + return "A142"; case "A143" : - return "A143"; + return "A143"; case "A144" : - return "A144"; + return "A144"; case "A145" : - return "A145"; + return "A145"; case "A146" : - return "A146"; + return "A146"; case "A147" : - return "A147"; + return "A147"; case "A148" : - return "A148"; + return "A148"; case "A149" : - return "A149"; + return "A149"; case "A150" : - return "A150"; + return "A150"; case "A151" : - return "A151"; + return "A151"; case "A152" : - return "A152"; + return "A152"; case "A153" : - return "A153"; + return "A153"; case "A154" : - return "A154"; + return "A154"; case "A155" : - return "A155"; + return "A155"; case "A156" : - return "A156"; + return "A156"; case "A157" : - return "A157"; + return "A157"; case "A158" : - return "A158"; + return "A158"; case "A159" : - return "A159"; + return "A159"; case "A160" : - return "A160"; + return "A160"; case "A161" : - return "A161"; + return "A161"; case "A162" : - return "A162"; + return "A162"; case "A163" : - return "A163"; + return "A163"; case "A164" : - return "A164"; + return "A164"; case "A165" : - return "A165"; + return "A165"; case "A166" : - return "A166"; + return "A166"; case "A167" : - return "A167"; + return "A167"; case "A168" : - return "A168"; + return "A168"; case "A169" : - return "A169"; + return "A169"; case "A170" : - return "A170"; + return "A170"; case "A171" : - return "A171"; + return "A171"; case "A172" : - return "A172"; + return "A172"; case "A173" : - return "A173"; + return "A173"; case "A174" : - return "A174"; + return "A174"; case "A175" : - return "A175"; + return "A175"; case "A176" : - return "A176"; + return "A176"; case "A177" : - return "A177"; + return "A177"; case "A178" : - return "A178"; + return "A178"; case "A179" : - return "A179"; + return "A179"; case "A180" : - return "A180"; + return "A180"; case "A181" : - return "A181"; + return "A181"; case "A182" : - return "A182"; + return "A182"; case "A183" : - return "A183"; + return "A183"; case "A184" : - return "A184"; + return "A184"; case "A185" : - return "A185"; + return "A185"; case "A186" : - return "A186"; + return "A186"; case "A187" : - return "A187"; + return "A187"; case "A188" : - return "A188"; + return "A188"; case "A189" : - return "A189"; + return "A189"; case "A190" : - return "A190"; + return "A190"; case "A191" : - return "A191"; + return "A191"; case "A192" : - return "A192"; + return "A192"; case "A193" : - return "A193"; + return "A193"; case "A194" : - return "A194"; + return "A194"; case "A195" : - return "A195"; + return "A195"; case "A196" : - return "A196"; + return "A196"; case "A197" : - return "A197"; + return "A197"; case "A198" : - return "A198"; + return "A198"; case "A199" : - return "A199"; + return "A199"; case "A200" : - return "A200"; + return "A200"; case "A201" : - return "A201"; + return "A201"; case "A202" : - return "A202"; + return "A202"; case "A203" : - return "A203"; + return "A203"; case "A204" : - return "A204"; + return "A204"; case "A205" : - return "A205"; + return "A205"; case "A206" : - return "A206"; + return "A206"; case "A207" : - return "A207"; + return "A207"; case "A208" : - return "A208"; + return "A208"; case "A209" : - return "A209"; + return "A209"; case "A210" : - return "A210"; + return "A210"; case "A211" : - return "A211"; + return "A211"; case "A212" : - return "A212"; + return "A212"; case "A213" : - return "A213"; + return "A213"; case "A214" : - return "A214"; + return "A214"; case "A215" : - return "A215"; + return "A215"; case "A216" : - return "A216"; + return "A216"; case "A217" : - return "A217"; + return "A217"; case "A218" : - return "A218"; + return "A218"; case "A219" : - return "A219"; + return "A219"; case "A220" : - return "A220"; + return "A220"; case "A221" : - return "A221"; + return "A221"; case "A222" : - return "A222"; + return "A222"; case "A223" : - return "A223"; + return "A223"; case "A224" : - return "A224"; + return "A224"; case "A225" : - return "A225"; + return "A225"; case "A226" : - return "A226"; + return "A226"; case "A227" : - return "A227"; + return "A227"; case "A228" : - return "A228"; + return "A228"; case "A229" : - return "A229"; + return "A229"; case "A230" : - return "A230"; + return "A230"; case "A231" : - return "A231"; + return "A231"; case "A232" : - return "A232"; + return "A232"; case "A233" : - return "A233"; + return "A233"; case "A234" : - return "A234"; + return "A234"; case "A235" : - return "A235"; + return "A235"; case "A236" : - return "A236"; + return "A236"; case "A237" : - return "A237"; + return "A237"; case "A238" : - return "A238"; + return "A238"; case "A239" : - return "A239"; + return "A239"; case "A240" : - return "A240"; + return "A240"; case "A241" : - return "A241"; + return "A241"; case "A242" : - return "A242"; + return "A242"; case "A243" : - return "A243"; + return "A243"; case "A244" : - return "A244"; + return "A244"; case "A245" : - return "A245"; + return "A245"; case "A246" : - return "A246"; + return "A246"; case "A247" : - return "A247"; + return "A247"; case "A248" : - return "A248"; + return "A248"; case "A249" : - return "A249"; + return "A249"; case "A250" : - return "A250"; + return "A250"; case "A251" : - return "A251"; + return "A251"; case "A252" : - return "A252"; + return "A252"; case "A253" : - return "A253"; + return "A253"; case "A254" : - return "A254"; + return "A254"; case "A255" : - return "A255"; + return "A255"; case "A256" : - return "A256"; + return "A256"; case "A257" : - return "A257"; + return "A257"; case "A258" : - return "A258"; + return "A258"; case "A259" : - return "A259"; + return "A259"; case "A260" : - return "A260"; + return "A260"; case "A261" : - return "A261"; + return "A261"; case "A262" : - return "A262"; + return "A262"; case "A263" : - return "A263"; + return "A263"; case "A264" : - return "A264"; + return "A264"; case "A265" : - return "A265"; + return "A265"; case "A266" : - return "A266"; + return "A266"; case "A267" : - return "A267"; + return "A267"; case "A268" : - return "A268"; + return "A268"; case "A269" : - return "A269"; + return "A269"; case "A270" : - return "A270"; + return "A270"; case "A271" : - return "A271"; + return "A271"; case "A272" : - return "A272"; + return "A272"; case "A273" : - return "A273"; + return "A273"; case "A274" : - return "A274"; + return "A274"; case "A275" : - return "A275"; + return "A275"; case "A276" : - return "A276"; + return "A276"; case "A277" : - return "A277"; + return "A277"; case "A278" : - return "A278"; + return "A278"; case "A279" : - return "A279"; + return "A279"; case "A280" : - return "A280"; + return "A280"; case "A281" : - return "A281"; + return "A281"; case "A282" : - return "A282"; + return "A282"; case "A283" : - return "A283"; + return "A283"; case "A284" : - return "A284"; + return "A284"; case "A285" : - return "A285"; + return "A285"; case "A286" : - return "A286"; + return "A286"; case "A287" : - return "A287"; + return "A287"; case "A288" : - return "A288"; + return "A288"; case "A289" : - return "A289"; + return "A289"; case "A290" : - return "A290"; + return "A290"; case "A291" : - return "A291"; + return "A291"; case "A292" : - return "A292"; + return "A292"; case "A293" : - return "A293"; + return "A293"; case "A294" : - return "A294"; + return "A294"; case "A295" : - return "A295"; + return "A295"; case "A296" : - return "A296"; + return "A296"; case "A297" : - return "A297"; + return "A297"; case "A298" : - return "A298"; + return "A298"; case "A299" : - return "A299"; - + return "A299"; } } diff --git a/jscomp/test/big_polyvar_test.js b/jscomp/test/big_polyvar_test.js index 2af9a1dee7..3cf61f097f 100644 --- a/jscomp/test/big_polyvar_test.js +++ b/jscomp/test/big_polyvar_test.js @@ -26,7815 +26,7815 @@ function eq(x, y) { if ("variant0" !== "variant0") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 314, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 314, + 0 + ] + } + }); } if ("variant1" !== "variant1") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 315, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 315, + 0 + ] + } + }); } if ("variant2" !== "variant2") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 316, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 316, + 0 + ] + } + }); } if ("variant3" !== "variant3") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 317, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 317, + 0 + ] + } + }); } if ("variant4" !== "variant4") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 318, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 318, + 0 + ] + } + }); } if ("variant5" !== "variant5") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 319, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 319, + 0 + ] + } + }); } if ("variant6" !== "variant6") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 320, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 320, + 0 + ] + } + }); } if ("variant7" !== "variant7") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 321, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 321, + 0 + ] + } + }); } if ("variant8" !== "variant8") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 322, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 322, + 0 + ] + } + }); } if ("variant9" !== "variant9") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 323, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 323, + 0 + ] + } + }); } if ("variant10" !== "variant10") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 324, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 324, + 0 + ] + } + }); } if ("variant11" !== "variant11") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 325, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 325, + 0 + ] + } + }); } if ("variant12" !== "variant12") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 326, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 326, + 0 + ] + } + }); } if ("variant13" !== "variant13") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 327, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 327, + 0 + ] + } + }); } if ("variant14" !== "variant14") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 328, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 328, + 0 + ] + } + }); } if ("variant15" !== "variant15") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 329, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 329, + 0 + ] + } + }); } if ("variant16" !== "variant16") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 330, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 330, + 0 + ] + } + }); } if ("variant17" !== "variant17") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 331, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 331, + 0 + ] + } + }); } if ("variant18" !== "variant18") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 332, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 332, + 0 + ] + } + }); } if ("variant19" !== "variant19") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 333, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 333, + 0 + ] + } + }); } if ("variant20" !== "variant20") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 334, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 334, + 0 + ] + } + }); } if ("variant21" !== "variant21") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 335, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 335, + 0 + ] + } + }); } if ("variant22" !== "variant22") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 336, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 336, + 0 + ] + } + }); } if ("variant23" !== "variant23") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 337, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 337, + 0 + ] + } + }); } if ("variant24" !== "variant24") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 338, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 338, + 0 + ] + } + }); } if ("variant25" !== "variant25") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 339, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 339, + 0 + ] + } + }); } if ("variant26" !== "variant26") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 340, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 340, + 0 + ] + } + }); } if ("variant27" !== "variant27") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 341, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 341, + 0 + ] + } + }); } if ("variant28" !== "variant28") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 342, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 342, + 0 + ] + } + }); } if ("variant29" !== "variant29") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 343, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 343, + 0 + ] + } + }); } if ("variant30" !== "variant30") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 344, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 344, + 0 + ] + } + }); } if ("variant31" !== "variant31") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 345, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 345, + 0 + ] + } + }); } if ("variant32" !== "variant32") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 346, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 346, + 0 + ] + } + }); } if ("variant33" !== "variant33") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 347, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 347, + 0 + ] + } + }); } if ("variant34" !== "variant34") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 348, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 348, + 0 + ] + } + }); } if ("variant35" !== "variant35") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 349, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 349, + 0 + ] + } + }); } if ("variant36" !== "variant36") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 350, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 350, + 0 + ] + } + }); } if ("variant37" !== "variant37") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 351, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 351, + 0 + ] + } + }); } if ("variant38" !== "variant38") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 352, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 352, + 0 + ] + } + }); } if ("variant39" !== "variant39") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 353, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 353, + 0 + ] + } + }); } if ("variant40" !== "variant40") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 354, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 354, + 0 + ] + } + }); } if ("variant41" !== "variant41") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 355, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 355, + 0 + ] + } + }); } if ("variant42" !== "variant42") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 356, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 356, + 0 + ] + } + }); } if ("variant43" !== "variant43") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 357, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 357, + 0 + ] + } + }); } if ("variant44" !== "variant44") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 358, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 358, + 0 + ] + } + }); } if ("variant45" !== "variant45") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 359, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 359, + 0 + ] + } + }); } if ("variant46" !== "variant46") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 360, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 360, + 0 + ] + } + }); } if ("variant47" !== "variant47") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 361, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 361, + 0 + ] + } + }); } if ("variant48" !== "variant48") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 362, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 362, + 0 + ] + } + }); } if ("variant49" !== "variant49") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 363, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 363, + 0 + ] + } + }); } if ("variant50" !== "variant50") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 364, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 364, + 0 + ] + } + }); } if ("variant51" !== "variant51") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 365, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 365, + 0 + ] + } + }); } if ("variant52" !== "variant52") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 366, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 366, + 0 + ] + } + }); } if ("variant53" !== "variant53") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 367, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 367, + 0 + ] + } + }); } if ("variant54" !== "variant54") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 368, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 368, + 0 + ] + } + }); } if ("variant55" !== "variant55") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 369, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 369, + 0 + ] + } + }); } if ("variant56" !== "variant56") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 370, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 370, + 0 + ] + } + }); } if ("variant57" !== "variant57") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 371, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 371, + 0 + ] + } + }); } if ("variant58" !== "variant58") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 372, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 372, + 0 + ] + } + }); } if ("variant59" !== "variant59") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 373, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 373, + 0 + ] + } + }); } if ("variant60" !== "variant60") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 374, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 374, + 0 + ] + } + }); } if ("variant61" !== "variant61") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 375, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 375, + 0 + ] + } + }); } if ("variant62" !== "variant62") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 376, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 376, + 0 + ] + } + }); } if ("variant63" !== "variant63") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 377, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 377, + 0 + ] + } + }); } if ("variant64" !== "variant64") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 378, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 378, + 0 + ] + } + }); } if ("variant65" !== "variant65") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 379, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 379, + 0 + ] + } + }); } if ("variant66" !== "variant66") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 380, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 380, + 0 + ] + } + }); } if ("variant67" !== "variant67") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 381, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 381, + 0 + ] + } + }); } if ("variant68" !== "variant68") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 382, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 382, + 0 + ] + } + }); } if ("variant69" !== "variant69") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 383, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 383, + 0 + ] + } + }); } if ("variant70" !== "variant70") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 384, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 384, + 0 + ] + } + }); } if ("variant71" !== "variant71") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 385, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 385, + 0 + ] + } + }); } if ("variant72" !== "variant72") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 386, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 386, + 0 + ] + } + }); } if ("variant73" !== "variant73") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 387, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 387, + 0 + ] + } + }); } if ("variant74" !== "variant74") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 388, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 388, + 0 + ] + } + }); } if ("variant75" !== "variant75") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 389, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 389, + 0 + ] + } + }); } if ("variant76" !== "variant76") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 390, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 390, + 0 + ] + } + }); } if ("variant77" !== "variant77") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 391, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 391, + 0 + ] + } + }); } if ("variant78" !== "variant78") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 392, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 392, + 0 + ] + } + }); } if ("variant79" !== "variant79") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 393, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 393, + 0 + ] + } + }); } if ("variant80" !== "variant80") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 394, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 394, + 0 + ] + } + }); } if ("variant81" !== "variant81") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 395, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 395, + 0 + ] + } + }); } if ("variant82" !== "variant82") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 396, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 396, + 0 + ] + } + }); } if ("variant83" !== "variant83") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 397, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 397, + 0 + ] + } + }); } if ("variant84" !== "variant84") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 398, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 398, + 0 + ] + } + }); } if ("variant85" !== "variant85") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 399, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 399, + 0 + ] + } + }); } if ("variant86" !== "variant86") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 400, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 400, + 0 + ] + } + }); } if ("variant87" !== "variant87") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 401, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 401, + 0 + ] + } + }); } if ("variant88" !== "variant88") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 402, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 402, + 0 + ] + } + }); } if ("variant89" !== "variant89") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 403, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 403, + 0 + ] + } + }); } if ("variant90" !== "variant90") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 404, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 404, + 0 + ] + } + }); } if ("variant91" !== "variant91") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 405, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 405, + 0 + ] + } + }); } if ("variant92" !== "variant92") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 406, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 406, + 0 + ] + } + }); } if ("variant93" !== "variant93") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 407, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 407, + 0 + ] + } + }); } if ("variant94" !== "variant94") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 408, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 408, + 0 + ] + } + }); } if ("variant95" !== "variant95") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 409, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 409, + 0 + ] + } + }); } if ("variant96" !== "variant96") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 410, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 410, + 0 + ] + } + }); } if ("variant97" !== "variant97") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 411, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 411, + 0 + ] + } + }); } if ("variant98" !== "variant98") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 412, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 412, + 0 + ] + } + }); } if ("variant99" !== "variant99") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 413, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 413, + 0 + ] + } + }); } if ("variant100" !== "variant100") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 414, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 414, + 0 + ] + } + }); } if ("variant101" !== "variant101") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 415, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 415, + 0 + ] + } + }); } if ("variant102" !== "variant102") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 416, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 416, + 0 + ] + } + }); } if ("variant103" !== "variant103") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 417, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 417, + 0 + ] + } + }); } if ("variant104" !== "variant104") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 418, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 418, + 0 + ] + } + }); } if ("variant105" !== "variant105") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 419, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 419, + 0 + ] + } + }); } if ("variant106" !== "variant106") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 420, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 420, + 0 + ] + } + }); } if ("variant107" !== "variant107") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 421, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 421, + 0 + ] + } + }); } if ("variant108" !== "variant108") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 422, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 422, + 0 + ] + } + }); } if ("variant109" !== "variant109") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 423, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 423, + 0 + ] + } + }); } if ("variant110" !== "variant110") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 424, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 424, + 0 + ] + } + }); } if ("variant111" !== "variant111") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 425, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 425, + 0 + ] + } + }); } if ("variant112" !== "variant112") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 426, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 426, + 0 + ] + } + }); } if ("variant113" !== "variant113") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 427, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 427, + 0 + ] + } + }); } if ("variant114" !== "variant114") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 428, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 428, + 0 + ] + } + }); } if ("variant115" !== "variant115") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 429, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 429, + 0 + ] + } + }); } if ("variant116" !== "variant116") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 430, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 430, + 0 + ] + } + }); } if ("variant117" !== "variant117") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 431, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 431, + 0 + ] + } + }); } if ("variant118" !== "variant118") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 432, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 432, + 0 + ] + } + }); } if ("variant119" !== "variant119") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 433, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 433, + 0 + ] + } + }); } if ("variant120" !== "variant120") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 434, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 434, + 0 + ] + } + }); } if ("variant121" !== "variant121") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 435, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 435, + 0 + ] + } + }); } if ("variant122" !== "variant122") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 436, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 436, + 0 + ] + } + }); } if ("variant123" !== "variant123") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 437, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 437, + 0 + ] + } + }); } if ("variant124" !== "variant124") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 438, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 438, + 0 + ] + } + }); } if ("variant125" !== "variant125") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 439, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 439, + 0 + ] + } + }); } if ("variant126" !== "variant126") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 440, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 440, + 0 + ] + } + }); } if ("variant127" !== "variant127") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 441, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 441, + 0 + ] + } + }); } if ("variant128" !== "variant128") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 442, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 442, + 0 + ] + } + }); } if ("variant129" !== "variant129") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 443, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 443, + 0 + ] + } + }); } if ("variant130" !== "variant130") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 444, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 444, + 0 + ] + } + }); } if ("variant131" !== "variant131") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 445, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 445, + 0 + ] + } + }); } if ("variant132" !== "variant132") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 446, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 446, + 0 + ] + } + }); } if ("variant133" !== "variant133") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 447, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 447, + 0 + ] + } + }); } if ("variant134" !== "variant134") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 448, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 448, + 0 + ] + } + }); } if ("variant135" !== "variant135") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 449, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 449, + 0 + ] + } + }); } if ("variant136" !== "variant136") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 450, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 450, + 0 + ] + } + }); } if ("variant137" !== "variant137") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 451, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 451, + 0 + ] + } + }); } if ("variant138" !== "variant138") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 452, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 452, + 0 + ] + } + }); } if ("variant139" !== "variant139") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 453, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 453, + 0 + ] + } + }); } if ("variant140" !== "variant140") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 454, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 454, + 0 + ] + } + }); } if ("variant141" !== "variant141") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 455, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 455, + 0 + ] + } + }); } if ("variant142" !== "variant142") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 456, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 456, + 0 + ] + } + }); } if ("variant143" !== "variant143") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 457, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 457, + 0 + ] + } + }); } if ("variant144" !== "variant144") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 458, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 458, + 0 + ] + } + }); } if ("variant145" !== "variant145") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 459, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 459, + 0 + ] + } + }); } if ("variant146" !== "variant146") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 460, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 460, + 0 + ] + } + }); } if ("variant147" !== "variant147") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 461, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 461, + 0 + ] + } + }); } if ("variant148" !== "variant148") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 462, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 462, + 0 + ] + } + }); } if ("variant149" !== "variant149") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 463, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 463, + 0 + ] + } + }); } if ("variant150" !== "variant150") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 464, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 464, + 0 + ] + } + }); } if ("variant151" !== "variant151") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 465, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 465, + 0 + ] + } + }); } if ("variant152" !== "variant152") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 466, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 466, + 0 + ] + } + }); } if ("variant153" !== "variant153") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 467, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 467, + 0 + ] + } + }); } if ("variant154" !== "variant154") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 468, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 468, + 0 + ] + } + }); } if ("variant155" !== "variant155") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 469, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 469, + 0 + ] + } + }); } if ("variant156" !== "variant156") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 470, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 470, + 0 + ] + } + }); } if ("variant157" !== "variant157") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 471, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 471, + 0 + ] + } + }); } if ("variant158" !== "variant158") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 472, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 472, + 0 + ] + } + }); } if ("variant159" !== "variant159") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 473, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 473, + 0 + ] + } + }); } if ("variant160" !== "variant160") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 474, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 474, + 0 + ] + } + }); } if ("variant161" !== "variant161") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 475, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 475, + 0 + ] + } + }); } if ("variant162" !== "variant162") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 476, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 476, + 0 + ] + } + }); } if ("variant163" !== "variant163") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 477, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 477, + 0 + ] + } + }); } if ("variant164" !== "variant164") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 478, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 478, + 0 + ] + } + }); } if ("variant165" !== "variant165") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 479, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 479, + 0 + ] + } + }); } if ("variant166" !== "variant166") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 480, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 480, + 0 + ] + } + }); } if ("variant167" !== "variant167") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 481, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 481, + 0 + ] + } + }); } if ("variant168" !== "variant168") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 482, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 482, + 0 + ] + } + }); } if ("variant169" !== "variant169") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 483, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 483, + 0 + ] + } + }); } if ("variant170" !== "variant170") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 484, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 484, + 0 + ] + } + }); } if ("variant171" !== "variant171") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 485, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 485, + 0 + ] + } + }); } if ("variant172" !== "variant172") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 486, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 486, + 0 + ] + } + }); } if ("variant173" !== "variant173") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 487, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 487, + 0 + ] + } + }); } if ("variant174" !== "variant174") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 488, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 488, + 0 + ] + } + }); } if ("variant175" !== "variant175") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 489, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 489, + 0 + ] + } + }); } if ("variant176" !== "variant176") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 490, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 490, + 0 + ] + } + }); } if ("variant177" !== "variant177") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 491, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 491, + 0 + ] + } + }); } if ("variant178" !== "variant178") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 492, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 492, + 0 + ] + } + }); } if ("variant179" !== "variant179") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 493, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 493, + 0 + ] + } + }); } if ("variant180" !== "variant180") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 494, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 494, + 0 + ] + } + }); } if ("variant181" !== "variant181") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 495, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 495, + 0 + ] + } + }); } if ("variant182" !== "variant182") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 496, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 496, + 0 + ] + } + }); } if ("variant183" !== "variant183") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 497, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 497, + 0 + ] + } + }); } if ("variant184" !== "variant184") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 498, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 498, + 0 + ] + } + }); } if ("variant185" !== "variant185") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 499, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 499, + 0 + ] + } + }); } if ("variant186" !== "variant186") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 500, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 500, + 0 + ] + } + }); } if ("variant187" !== "variant187") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 501, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 501, + 0 + ] + } + }); } if ("variant188" !== "variant188") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 502, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 502, + 0 + ] + } + }); } if ("variant189" !== "variant189") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 503, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 503, + 0 + ] + } + }); } if ("variant190" !== "variant190") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 504, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 504, + 0 + ] + } + }); } if ("variant191" !== "variant191") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 505, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 505, + 0 + ] + } + }); } if ("variant192" !== "variant192") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 506, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 506, + 0 + ] + } + }); } if ("variant193" !== "variant193") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 507, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 507, + 0 + ] + } + }); } if ("variant194" !== "variant194") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 508, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 508, + 0 + ] + } + }); } if ("variant195" !== "variant195") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 509, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 509, + 0 + ] + } + }); } if ("variant196" !== "variant196") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 510, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 510, + 0 + ] + } + }); } if ("variant197" !== "variant197") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 511, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 511, + 0 + ] + } + }); } if ("variant198" !== "variant198") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 512, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 512, + 0 + ] + } + }); } if ("variant199" !== "variant199") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 513, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 513, + 0 + ] + } + }); } if ("variant200" !== "variant200") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 514, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 514, + 0 + ] + } + }); } if ("variant201" !== "variant201") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 515, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 515, + 0 + ] + } + }); } if ("variant202" !== "variant202") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 516, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 516, + 0 + ] + } + }); } if ("variant203" !== "variant203") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 517, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 517, + 0 + ] + } + }); } if ("variant204" !== "variant204") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 518, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 518, + 0 + ] + } + }); } if ("variant205" !== "variant205") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 519, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 519, + 0 + ] + } + }); } if ("variant206" !== "variant206") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 520, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 520, + 0 + ] + } + }); } if ("variant207" !== "variant207") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 521, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 521, + 0 + ] + } + }); } if ("variant208" !== "variant208") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 522, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 522, + 0 + ] + } + }); } if ("variant209" !== "variant209") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 523, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 523, + 0 + ] + } + }); } if ("variant210" !== "variant210") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 524, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 524, + 0 + ] + } + }); } if ("variant211" !== "variant211") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 525, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 525, + 0 + ] + } + }); } if ("variant212" !== "variant212") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 526, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 526, + 0 + ] + } + }); } if ("variant213" !== "variant213") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 527, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 527, + 0 + ] + } + }); } if ("variant214" !== "variant214") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 528, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 528, + 0 + ] + } + }); } if ("variant215" !== "variant215") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 529, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 529, + 0 + ] + } + }); } if ("variant216" !== "variant216") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 530, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 530, + 0 + ] + } + }); } if ("variant217" !== "variant217") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 531, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 531, + 0 + ] + } + }); } if ("variant218" !== "variant218") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 532, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 532, + 0 + ] + } + }); } if ("variant219" !== "variant219") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 533, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 533, + 0 + ] + } + }); } if ("variant220" !== "variant220") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 534, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 534, + 0 + ] + } + }); } if ("variant221" !== "variant221") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 535, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 535, + 0 + ] + } + }); } if ("variant222" !== "variant222") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 536, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 536, + 0 + ] + } + }); } if ("variant223" !== "variant223") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 537, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 537, + 0 + ] + } + }); } if ("variant224" !== "variant224") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 538, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 538, + 0 + ] + } + }); } if ("variant225" !== "variant225") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 539, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 539, + 0 + ] + } + }); } if ("variant226" !== "variant226") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 540, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 540, + 0 + ] + } + }); } if ("variant227" !== "variant227") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 541, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 541, + 0 + ] + } + }); } if ("variant228" !== "variant228") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 542, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 542, + 0 + ] + } + }); } if ("variant229" !== "variant229") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 543, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 543, + 0 + ] + } + }); } if ("variant230" !== "variant230") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 544, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 544, + 0 + ] + } + }); } if ("variant231" !== "variant231") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 545, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 545, + 0 + ] + } + }); } if ("variant232" !== "variant232") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 546, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 546, + 0 + ] + } + }); } if ("variant233" !== "variant233") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 547, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 547, + 0 + ] + } + }); } if ("variant234" !== "variant234") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 548, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 548, + 0 + ] + } + }); } if ("variant235" !== "variant235") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 549, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 549, + 0 + ] + } + }); } if ("variant236" !== "variant236") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 550, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 550, + 0 + ] + } + }); } if ("variant237" !== "variant237") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 551, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 551, + 0 + ] + } + }); } if ("variant238" !== "variant238") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 552, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 552, + 0 + ] + } + }); } if ("variant239" !== "variant239") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 553, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 553, + 0 + ] + } + }); } if ("variant240" !== "variant240") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 554, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 554, + 0 + ] + } + }); } if ("variant241" !== "variant241") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 555, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 555, + 0 + ] + } + }); } if ("variant242" !== "variant242") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 556, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 556, + 0 + ] + } + }); } if ("variant243" !== "variant243") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 557, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 557, + 0 + ] + } + }); } if ("variant244" !== "variant244") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 558, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 558, + 0 + ] + } + }); } if ("variant245" !== "variant245") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 559, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 559, + 0 + ] + } + }); } if ("variant246" !== "variant246") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 560, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 560, + 0 + ] + } + }); } if ("variant247" !== "variant247") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 561, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 561, + 0 + ] + } + }); } if ("variant248" !== "variant248") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 562, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 562, + 0 + ] + } + }); } if ("variant249" !== "variant249") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 563, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 563, + 0 + ] + } + }); } if ("variant250" !== "variant250") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 564, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 564, + 0 + ] + } + }); } if ("variant251" !== "variant251") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 565, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 565, + 0 + ] + } + }); } if ("variant252" !== "variant252") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 566, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 566, + 0 + ] + } + }); } if ("variant253" !== "variant253") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 567, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 567, + 0 + ] + } + }); } if ("variant254" !== "variant254") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 568, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 568, + 0 + ] + } + }); } if ("variant255" !== "variant255") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 569, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 569, + 0 + ] + } + }); } if ("variant256" !== "variant256") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 570, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 570, + 0 + ] + } + }); } if ("variant257" !== "variant257") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 571, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 571, + 0 + ] + } + }); } if ("variant258" !== "variant258") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 572, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 572, + 0 + ] + } + }); } if ("variant259" !== "variant259") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 573, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 573, + 0 + ] + } + }); } if ("variant260" !== "variant260") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 574, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 574, + 0 + ] + } + }); } if ("variant261" !== "variant261") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 575, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 575, + 0 + ] + } + }); } if ("variant262" !== "variant262") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 576, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 576, + 0 + ] + } + }); } if ("variant263" !== "variant263") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 577, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 577, + 0 + ] + } + }); } if ("variant264" !== "variant264") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 578, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 578, + 0 + ] + } + }); } if ("variant265" !== "variant265") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 579, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 579, + 0 + ] + } + }); } if ("variant266" !== "variant266") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 580, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 580, + 0 + ] + } + }); } if ("variant267" !== "variant267") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 581, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 581, + 0 + ] + } + }); } if ("variant268" !== "variant268") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 582, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 582, + 0 + ] + } + }); } if ("variant269" !== "variant269") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 583, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 583, + 0 + ] + } + }); } if ("variant270" !== "variant270") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 584, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 584, + 0 + ] + } + }); } if ("variant271" !== "variant271") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 585, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 585, + 0 + ] + } + }); } if ("variant272" !== "variant272") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 586, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 586, + 0 + ] + } + }); } if ("variant273" !== "variant273") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 587, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 587, + 0 + ] + } + }); } if ("variant274" !== "variant274") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 588, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 588, + 0 + ] + } + }); } if ("variant275" !== "variant275") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 589, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 589, + 0 + ] + } + }); } if ("variant276" !== "variant276") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 590, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 590, + 0 + ] + } + }); } if ("variant277" !== "variant277") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 591, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 591, + 0 + ] + } + }); } if ("variant278" !== "variant278") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 592, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 592, + 0 + ] + } + }); } if ("variant279" !== "variant279") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 593, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 593, + 0 + ] + } + }); } if ("variant280" !== "variant280") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 594, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 594, + 0 + ] + } + }); } if ("variant281" !== "variant281") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 595, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 595, + 0 + ] + } + }); } if ("variant282" !== "variant282") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 596, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 596, + 0 + ] + } + }); } if ("variant283" !== "variant283") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 597, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 597, + 0 + ] + } + }); } if ("variant284" !== "variant284") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 598, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 598, + 0 + ] + } + }); } if ("variant285" !== "variant285") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 599, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 599, + 0 + ] + } + }); } if ("variant286" !== "variant286") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 600, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 600, + 0 + ] + } + }); } if ("variant287" !== "variant287") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 601, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 601, + 0 + ] + } + }); } if ("variant288" !== "variant288") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 602, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 602, + 0 + ] + } + }); } if ("variant289" !== "variant289") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 603, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 603, + 0 + ] + } + }); } if ("variant290" !== "variant290") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 604, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 604, + 0 + ] + } + }); } if ("variant291" !== "variant291") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 605, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 605, + 0 + ] + } + }); } if ("variant292" !== "variant292") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 606, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 606, + 0 + ] + } + }); } if ("variant293" !== "variant293") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 607, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 607, + 0 + ] + } + }); } if ("variant294" !== "variant294") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 608, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 608, + 0 + ] + } + }); } if ("variant295" !== "variant295") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 609, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 609, + 0 + ] + } + }); } if ("variant296" !== "variant296") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 610, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 610, + 0 + ] + } + }); } if ("variant297" !== "variant297") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 611, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 611, + 0 + ] + } + }); } if ("variant298" !== "variant298") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 612, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 612, + 0 + ] + } + }); } if ("variant299" !== "variant299") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 613, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 613, + 0 + ] + } + }); } if (!eq(tFromJs("variant0"), "variant0")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 614, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 614, + 0 + ] + } + }); } if (!eq(tFromJs("variant1"), "variant1")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 615, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 615, + 0 + ] + } + }); } if (!eq(tFromJs("variant2"), "variant2")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 616, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 616, + 0 + ] + } + }); } if (!eq(tFromJs("variant3"), "variant3")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 617, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 617, + 0 + ] + } + }); } if (!eq(tFromJs("variant4"), "variant4")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 618, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 618, + 0 + ] + } + }); } if (!eq(tFromJs("variant5"), "variant5")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 619, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 619, + 0 + ] + } + }); } if (!eq(tFromJs("variant6"), "variant6")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 620, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 620, + 0 + ] + } + }); } if (!eq(tFromJs("variant7"), "variant7")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 621, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 621, + 0 + ] + } + }); } if (!eq(tFromJs("variant8"), "variant8")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 622, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 622, + 0 + ] + } + }); } if (!eq(tFromJs("variant9"), "variant9")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 623, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 623, + 0 + ] + } + }); } if (!eq(tFromJs("variant10"), "variant10")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 624, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 624, + 0 + ] + } + }); } if (!eq(tFromJs("variant11"), "variant11")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 625, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 625, + 0 + ] + } + }); } if (!eq(tFromJs("variant12"), "variant12")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 626, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 626, + 0 + ] + } + }); } if (!eq(tFromJs("variant13"), "variant13")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 627, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 627, + 0 + ] + } + }); } if (!eq(tFromJs("variant14"), "variant14")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 628, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 628, + 0 + ] + } + }); } if (!eq(tFromJs("variant15"), "variant15")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 629, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 629, + 0 + ] + } + }); } if (!eq(tFromJs("variant16"), "variant16")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 630, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 630, + 0 + ] + } + }); } if (!eq(tFromJs("variant17"), "variant17")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 631, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 631, + 0 + ] + } + }); } if (!eq(tFromJs("variant18"), "variant18")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 632, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 632, + 0 + ] + } + }); } if (!eq(tFromJs("variant19"), "variant19")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 633, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 633, + 0 + ] + } + }); } if (!eq(tFromJs("variant20"), "variant20")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 634, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 634, + 0 + ] + } + }); } if (!eq(tFromJs("variant21"), "variant21")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 635, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 635, + 0 + ] + } + }); } if (!eq(tFromJs("variant22"), "variant22")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 636, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 636, + 0 + ] + } + }); } if (!eq(tFromJs("variant23"), "variant23")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 637, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 637, + 0 + ] + } + }); } if (!eq(tFromJs("variant24"), "variant24")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 638, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 638, + 0 + ] + } + }); } if (!eq(tFromJs("variant25"), "variant25")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 639, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 639, + 0 + ] + } + }); } if (!eq(tFromJs("variant26"), "variant26")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 640, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 640, + 0 + ] + } + }); } if (!eq(tFromJs("variant27"), "variant27")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 641, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 641, + 0 + ] + } + }); } if (!eq(tFromJs("variant28"), "variant28")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 642, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 642, + 0 + ] + } + }); } if (!eq(tFromJs("variant29"), "variant29")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 643, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 643, + 0 + ] + } + }); } if (!eq(tFromJs("variant30"), "variant30")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 644, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 644, + 0 + ] + } + }); } if (!eq(tFromJs("variant31"), "variant31")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 645, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 645, + 0 + ] + } + }); } if (!eq(tFromJs("variant32"), "variant32")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 646, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 646, + 0 + ] + } + }); } if (!eq(tFromJs("variant33"), "variant33")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 647, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 647, + 0 + ] + } + }); } if (!eq(tFromJs("variant34"), "variant34")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 648, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 648, + 0 + ] + } + }); } if (!eq(tFromJs("variant35"), "variant35")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 649, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 649, + 0 + ] + } + }); } if (!eq(tFromJs("variant36"), "variant36")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 650, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 650, + 0 + ] + } + }); } if (!eq(tFromJs("variant37"), "variant37")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 651, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 651, + 0 + ] + } + }); } if (!eq(tFromJs("variant38"), "variant38")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 652, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 652, + 0 + ] + } + }); } if (!eq(tFromJs("variant39"), "variant39")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 653, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 653, + 0 + ] + } + }); } if (!eq(tFromJs("variant40"), "variant40")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 654, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 654, + 0 + ] + } + }); } if (!eq(tFromJs("variant41"), "variant41")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 655, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 655, + 0 + ] + } + }); } if (!eq(tFromJs("variant42"), "variant42")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 656, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 656, + 0 + ] + } + }); } if (!eq(tFromJs("variant43"), "variant43")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 657, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 657, + 0 + ] + } + }); } if (!eq(tFromJs("variant44"), "variant44")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 658, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 658, + 0 + ] + } + }); } if (!eq(tFromJs("variant45"), "variant45")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 659, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 659, + 0 + ] + } + }); } if (!eq(tFromJs("variant46"), "variant46")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 660, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 660, + 0 + ] + } + }); } if (!eq(tFromJs("variant47"), "variant47")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 661, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 661, + 0 + ] + } + }); } if (!eq(tFromJs("variant48"), "variant48")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 662, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 662, + 0 + ] + } + }); } if (!eq(tFromJs("variant49"), "variant49")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 663, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 663, + 0 + ] + } + }); } if (!eq(tFromJs("variant50"), "variant50")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 664, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 664, + 0 + ] + } + }); } if (!eq(tFromJs("variant51"), "variant51")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 665, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 665, + 0 + ] + } + }); } if (!eq(tFromJs("variant52"), "variant52")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 666, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 666, + 0 + ] + } + }); } if (!eq(tFromJs("variant53"), "variant53")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 667, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 667, + 0 + ] + } + }); } if (!eq(tFromJs("variant54"), "variant54")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 668, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 668, + 0 + ] + } + }); } if (!eq(tFromJs("variant55"), "variant55")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 669, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 669, + 0 + ] + } + }); } if (!eq(tFromJs("variant56"), "variant56")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 670, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 670, + 0 + ] + } + }); } if (!eq(tFromJs("variant57"), "variant57")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 671, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 671, + 0 + ] + } + }); } if (!eq(tFromJs("variant58"), "variant58")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 672, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 672, + 0 + ] + } + }); } if (!eq(tFromJs("variant59"), "variant59")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 673, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 673, + 0 + ] + } + }); } if (!eq(tFromJs("variant60"), "variant60")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 674, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 674, + 0 + ] + } + }); } if (!eq(tFromJs("variant61"), "variant61")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 675, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 675, + 0 + ] + } + }); } if (!eq(tFromJs("variant62"), "variant62")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 676, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 676, + 0 + ] + } + }); } if (!eq(tFromJs("variant63"), "variant63")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 677, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 677, + 0 + ] + } + }); } if (!eq(tFromJs("variant64"), "variant64")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 678, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 678, + 0 + ] + } + }); } if (!eq(tFromJs("variant65"), "variant65")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 679, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 679, + 0 + ] + } + }); } if (!eq(tFromJs("variant66"), "variant66")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 680, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 680, + 0 + ] + } + }); } if (!eq(tFromJs("variant67"), "variant67")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 681, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 681, + 0 + ] + } + }); } if (!eq(tFromJs("variant68"), "variant68")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 682, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 682, + 0 + ] + } + }); } if (!eq(tFromJs("variant69"), "variant69")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 683, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 683, + 0 + ] + } + }); } if (!eq(tFromJs("variant70"), "variant70")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 684, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 684, + 0 + ] + } + }); } if (!eq(tFromJs("variant71"), "variant71")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 685, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 685, + 0 + ] + } + }); } if (!eq(tFromJs("variant72"), "variant72")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 686, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 686, + 0 + ] + } + }); } if (!eq(tFromJs("variant73"), "variant73")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 687, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 687, + 0 + ] + } + }); } if (!eq(tFromJs("variant74"), "variant74")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 688, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 688, + 0 + ] + } + }); } if (!eq(tFromJs("variant75"), "variant75")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 689, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 689, + 0 + ] + } + }); } if (!eq(tFromJs("variant76"), "variant76")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 690, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 690, + 0 + ] + } + }); } if (!eq(tFromJs("variant77"), "variant77")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 691, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 691, + 0 + ] + } + }); } if (!eq(tFromJs("variant78"), "variant78")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 692, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 692, + 0 + ] + } + }); } if (!eq(tFromJs("variant79"), "variant79")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 693, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 693, + 0 + ] + } + }); } if (!eq(tFromJs("variant80"), "variant80")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 694, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 694, + 0 + ] + } + }); } if (!eq(tFromJs("variant81"), "variant81")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 695, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 695, + 0 + ] + } + }); } if (!eq(tFromJs("variant82"), "variant82")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 696, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 696, + 0 + ] + } + }); } if (!eq(tFromJs("variant83"), "variant83")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 697, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 697, + 0 + ] + } + }); } if (!eq(tFromJs("variant84"), "variant84")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 698, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 698, + 0 + ] + } + }); } if (!eq(tFromJs("variant85"), "variant85")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 699, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 699, + 0 + ] + } + }); } if (!eq(tFromJs("variant86"), "variant86")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 700, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 700, + 0 + ] + } + }); } if (!eq(tFromJs("variant87"), "variant87")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 701, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 701, + 0 + ] + } + }); } if (!eq(tFromJs("variant88"), "variant88")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 702, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 702, + 0 + ] + } + }); } if (!eq(tFromJs("variant89"), "variant89")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 703, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 703, + 0 + ] + } + }); } if (!eq(tFromJs("variant90"), "variant90")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 704, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 704, + 0 + ] + } + }); } if (!eq(tFromJs("variant91"), "variant91")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 705, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 705, + 0 + ] + } + }); } if (!eq(tFromJs("variant92"), "variant92")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 706, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 706, + 0 + ] + } + }); } if (!eq(tFromJs("variant93"), "variant93")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 707, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 707, + 0 + ] + } + }); } if (!eq(tFromJs("variant94"), "variant94")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 708, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 708, + 0 + ] + } + }); } if (!eq(tFromJs("variant95"), "variant95")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 709, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 709, + 0 + ] + } + }); } if (!eq(tFromJs("variant96"), "variant96")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 710, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 710, + 0 + ] + } + }); } if (!eq(tFromJs("variant97"), "variant97")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 711, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 711, + 0 + ] + } + }); } if (!eq(tFromJs("variant98"), "variant98")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 712, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 712, + 0 + ] + } + }); } if (!eq(tFromJs("variant99"), "variant99")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 713, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 713, + 0 + ] + } + }); } if (!eq(tFromJs("variant100"), "variant100")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 714, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 714, + 0 + ] + } + }); } if (!eq(tFromJs("variant101"), "variant101")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 715, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 715, + 0 + ] + } + }); } if (!eq(tFromJs("variant102"), "variant102")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 716, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 716, + 0 + ] + } + }); } if (!eq(tFromJs("variant103"), "variant103")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 717, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 717, + 0 + ] + } + }); } if (!eq(tFromJs("variant104"), "variant104")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 718, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 718, + 0 + ] + } + }); } if (!eq(tFromJs("variant105"), "variant105")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 719, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 719, + 0 + ] + } + }); } if (!eq(tFromJs("variant106"), "variant106")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 720, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 720, + 0 + ] + } + }); } if (!eq(tFromJs("variant107"), "variant107")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 721, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 721, + 0 + ] + } + }); } if (!eq(tFromJs("variant108"), "variant108")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 722, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 722, + 0 + ] + } + }); } if (!eq(tFromJs("variant109"), "variant109")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 723, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 723, + 0 + ] + } + }); } if (!eq(tFromJs("variant110"), "variant110")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 724, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 724, + 0 + ] + } + }); } if (!eq(tFromJs("variant111"), "variant111")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 725, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 725, + 0 + ] + } + }); } if (!eq(tFromJs("variant112"), "variant112")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 726, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 726, + 0 + ] + } + }); } if (!eq(tFromJs("variant113"), "variant113")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 727, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 727, + 0 + ] + } + }); } if (!eq(tFromJs("variant114"), "variant114")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 728, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 728, + 0 + ] + } + }); } if (!eq(tFromJs("variant115"), "variant115")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 729, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 729, + 0 + ] + } + }); } if (!eq(tFromJs("variant116"), "variant116")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 730, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 730, + 0 + ] + } + }); } if (!eq(tFromJs("variant117"), "variant117")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 731, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 731, + 0 + ] + } + }); } if (!eq(tFromJs("variant118"), "variant118")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 732, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 732, + 0 + ] + } + }); } if (!eq(tFromJs("variant119"), "variant119")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 733, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 733, + 0 + ] + } + }); } if (!eq(tFromJs("variant120"), "variant120")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 734, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 734, + 0 + ] + } + }); } if (!eq(tFromJs("variant121"), "variant121")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 735, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 735, + 0 + ] + } + }); } if (!eq(tFromJs("variant122"), "variant122")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 736, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 736, + 0 + ] + } + }); } if (!eq(tFromJs("variant123"), "variant123")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 737, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 737, + 0 + ] + } + }); } if (!eq(tFromJs("variant124"), "variant124")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 738, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 738, + 0 + ] + } + }); } if (!eq(tFromJs("variant125"), "variant125")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 739, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 739, + 0 + ] + } + }); } if (!eq(tFromJs("variant126"), "variant126")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 740, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 740, + 0 + ] + } + }); } if (!eq(tFromJs("variant127"), "variant127")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 741, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 741, + 0 + ] + } + }); } if (!eq(tFromJs("variant128"), "variant128")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 742, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 742, + 0 + ] + } + }); } if (!eq(tFromJs("variant129"), "variant129")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 743, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 743, + 0 + ] + } + }); } if (!eq(tFromJs("variant130"), "variant130")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 744, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 744, + 0 + ] + } + }); } if (!eq(tFromJs("variant131"), "variant131")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 745, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 745, + 0 + ] + } + }); } if (!eq(tFromJs("variant132"), "variant132")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 746, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 746, + 0 + ] + } + }); } if (!eq(tFromJs("variant133"), "variant133")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 747, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 747, + 0 + ] + } + }); } if (!eq(tFromJs("variant134"), "variant134")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 748, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 748, + 0 + ] + } + }); } if (!eq(tFromJs("variant135"), "variant135")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 749, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 749, + 0 + ] + } + }); } if (!eq(tFromJs("variant136"), "variant136")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 750, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 750, + 0 + ] + } + }); } if (!eq(tFromJs("variant137"), "variant137")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 751, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 751, + 0 + ] + } + }); } if (!eq(tFromJs("variant138"), "variant138")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 752, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 752, + 0 + ] + } + }); } if (!eq(tFromJs("variant139"), "variant139")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 753, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 753, + 0 + ] + } + }); } if (!eq(tFromJs("variant140"), "variant140")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 754, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 754, + 0 + ] + } + }); } if (!eq(tFromJs("variant141"), "variant141")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 755, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 755, + 0 + ] + } + }); } if (!eq(tFromJs("variant142"), "variant142")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 756, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 756, + 0 + ] + } + }); } if (!eq(tFromJs("variant143"), "variant143")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 757, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 757, + 0 + ] + } + }); } if (!eq(tFromJs("variant144"), "variant144")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 758, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 758, + 0 + ] + } + }); } if (!eq(tFromJs("variant145"), "variant145")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 759, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 759, + 0 + ] + } + }); } if (!eq(tFromJs("variant146"), "variant146")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 760, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 760, + 0 + ] + } + }); } if (!eq(tFromJs("variant147"), "variant147")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 761, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 761, + 0 + ] + } + }); } if (!eq(tFromJs("variant148"), "variant148")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 762, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 762, + 0 + ] + } + }); } if (!eq(tFromJs("variant149"), "variant149")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 763, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 763, + 0 + ] + } + }); } if (!eq(tFromJs("variant150"), "variant150")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 764, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 764, + 0 + ] + } + }); } if (!eq(tFromJs("variant151"), "variant151")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 765, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 765, + 0 + ] + } + }); } if (!eq(tFromJs("variant152"), "variant152")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 766, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 766, + 0 + ] + } + }); } if (!eq(tFromJs("variant153"), "variant153")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 767, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 767, + 0 + ] + } + }); } if (!eq(tFromJs("variant154"), "variant154")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 768, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 768, + 0 + ] + } + }); } if (!eq(tFromJs("variant155"), "variant155")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 769, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 769, + 0 + ] + } + }); } if (!eq(tFromJs("variant156"), "variant156")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 770, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 770, + 0 + ] + } + }); } if (!eq(tFromJs("variant157"), "variant157")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 771, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 771, + 0 + ] + } + }); } if (!eq(tFromJs("variant158"), "variant158")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 772, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 772, + 0 + ] + } + }); } if (!eq(tFromJs("variant159"), "variant159")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 773, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 773, + 0 + ] + } + }); } if (!eq(tFromJs("variant160"), "variant160")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 774, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 774, + 0 + ] + } + }); } if (!eq(tFromJs("variant161"), "variant161")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 775, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 775, + 0 + ] + } + }); } if (!eq(tFromJs("variant162"), "variant162")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 776, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 776, + 0 + ] + } + }); } if (!eq(tFromJs("variant163"), "variant163")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 777, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 777, + 0 + ] + } + }); } if (!eq(tFromJs("variant164"), "variant164")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 778, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 778, + 0 + ] + } + }); } if (!eq(tFromJs("variant165"), "variant165")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 779, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 779, + 0 + ] + } + }); } if (!eq(tFromJs("variant166"), "variant166")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 780, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 780, + 0 + ] + } + }); } if (!eq(tFromJs("variant167"), "variant167")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 781, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 781, + 0 + ] + } + }); } if (!eq(tFromJs("variant168"), "variant168")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 782, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 782, + 0 + ] + } + }); } if (!eq(tFromJs("variant169"), "variant169")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 783, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 783, + 0 + ] + } + }); } if (!eq(tFromJs("variant170"), "variant170")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 784, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 784, + 0 + ] + } + }); } if (!eq(tFromJs("variant171"), "variant171")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 785, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 785, + 0 + ] + } + }); } if (!eq(tFromJs("variant172"), "variant172")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 786, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 786, + 0 + ] + } + }); } if (!eq(tFromJs("variant173"), "variant173")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 787, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 787, + 0 + ] + } + }); } if (!eq(tFromJs("variant174"), "variant174")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 788, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 788, + 0 + ] + } + }); } if (!eq(tFromJs("variant175"), "variant175")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 789, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 789, + 0 + ] + } + }); } if (!eq(tFromJs("variant176"), "variant176")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 790, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 790, + 0 + ] + } + }); } if (!eq(tFromJs("variant177"), "variant177")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 791, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 791, + 0 + ] + } + }); } if (!eq(tFromJs("variant178"), "variant178")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 792, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 792, + 0 + ] + } + }); } if (!eq(tFromJs("variant179"), "variant179")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 793, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 793, + 0 + ] + } + }); } if (!eq(tFromJs("variant180"), "variant180")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 794, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 794, + 0 + ] + } + }); } if (!eq(tFromJs("variant181"), "variant181")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 795, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 795, + 0 + ] + } + }); } if (!eq(tFromJs("variant182"), "variant182")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 796, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 796, + 0 + ] + } + }); } if (!eq(tFromJs("variant183"), "variant183")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 797, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 797, + 0 + ] + } + }); } if (!eq(tFromJs("variant184"), "variant184")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 798, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 798, + 0 + ] + } + }); } if (!eq(tFromJs("variant185"), "variant185")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 799, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 799, + 0 + ] + } + }); } if (!eq(tFromJs("variant186"), "variant186")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 800, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 800, + 0 + ] + } + }); } if (!eq(tFromJs("variant187"), "variant187")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 801, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 801, + 0 + ] + } + }); } if (!eq(tFromJs("variant188"), "variant188")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 802, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 802, + 0 + ] + } + }); } if (!eq(tFromJs("variant189"), "variant189")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 803, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 803, + 0 + ] + } + }); } if (!eq(tFromJs("variant190"), "variant190")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 804, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 804, + 0 + ] + } + }); } if (!eq(tFromJs("variant191"), "variant191")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 805, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 805, + 0 + ] + } + }); } if (!eq(tFromJs("variant192"), "variant192")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 806, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 806, + 0 + ] + } + }); } if (!eq(tFromJs("variant193"), "variant193")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 807, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 807, + 0 + ] + } + }); } if (!eq(tFromJs("variant194"), "variant194")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 808, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 808, + 0 + ] + } + }); } if (!eq(tFromJs("variant195"), "variant195")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 809, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 809, + 0 + ] + } + }); } if (!eq(tFromJs("variant196"), "variant196")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 810, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 810, + 0 + ] + } + }); } if (!eq(tFromJs("variant197"), "variant197")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 811, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 811, + 0 + ] + } + }); } if (!eq(tFromJs("variant198"), "variant198")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 812, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 812, + 0 + ] + } + }); } if (!eq(tFromJs("variant199"), "variant199")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 813, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 813, + 0 + ] + } + }); } if (!eq(tFromJs("variant200"), "variant200")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 814, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 814, + 0 + ] + } + }); } if (!eq(tFromJs("variant201"), "variant201")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 815, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 815, + 0 + ] + } + }); } if (!eq(tFromJs("variant202"), "variant202")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 816, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 816, + 0 + ] + } + }); } if (!eq(tFromJs("variant203"), "variant203")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 817, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 817, + 0 + ] + } + }); } if (!eq(tFromJs("variant204"), "variant204")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 818, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 818, + 0 + ] + } + }); } if (!eq(tFromJs("variant205"), "variant205")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 819, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 819, + 0 + ] + } + }); } if (!eq(tFromJs("variant206"), "variant206")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 820, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 820, + 0 + ] + } + }); } if (!eq(tFromJs("variant207"), "variant207")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 821, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 821, + 0 + ] + } + }); } if (!eq(tFromJs("variant208"), "variant208")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 822, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 822, + 0 + ] + } + }); } if (!eq(tFromJs("variant209"), "variant209")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 823, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 823, + 0 + ] + } + }); } if (!eq(tFromJs("variant210"), "variant210")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 824, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 824, + 0 + ] + } + }); } if (!eq(tFromJs("variant211"), "variant211")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 825, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 825, + 0 + ] + } + }); } if (!eq(tFromJs("variant212"), "variant212")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 826, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 826, + 0 + ] + } + }); } if (!eq(tFromJs("variant213"), "variant213")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 827, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 827, + 0 + ] + } + }); } if (!eq(tFromJs("variant214"), "variant214")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 828, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 828, + 0 + ] + } + }); } if (!eq(tFromJs("variant215"), "variant215")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 829, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 829, + 0 + ] + } + }); } if (!eq(tFromJs("variant216"), "variant216")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 830, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 830, + 0 + ] + } + }); } if (!eq(tFromJs("variant217"), "variant217")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 831, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 831, + 0 + ] + } + }); } if (!eq(tFromJs("variant218"), "variant218")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 832, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 832, + 0 + ] + } + }); } if (!eq(tFromJs("variant219"), "variant219")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 833, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 833, + 0 + ] + } + }); } if (!eq(tFromJs("variant220"), "variant220")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 834, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 834, + 0 + ] + } + }); } if (!eq(tFromJs("variant221"), "variant221")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 835, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 835, + 0 + ] + } + }); } if (!eq(tFromJs("variant222"), "variant222")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 836, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 836, + 0 + ] + } + }); } if (!eq(tFromJs("variant223"), "variant223")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 837, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 837, + 0 + ] + } + }); } if (!eq(tFromJs("variant224"), "variant224")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 838, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 838, + 0 + ] + } + }); } if (!eq(tFromJs("variant225"), "variant225")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 839, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 839, + 0 + ] + } + }); } if (!eq(tFromJs("variant226"), "variant226")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 840, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 840, + 0 + ] + } + }); } if (!eq(tFromJs("variant227"), "variant227")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 841, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 841, + 0 + ] + } + }); } if (!eq(tFromJs("variant228"), "variant228")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 842, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 842, + 0 + ] + } + }); } if (!eq(tFromJs("variant229"), "variant229")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 843, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 843, + 0 + ] + } + }); } if (!eq(tFromJs("variant230"), "variant230")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 844, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 844, + 0 + ] + } + }); } if (!eq(tFromJs("variant231"), "variant231")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 845, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 845, + 0 + ] + } + }); } if (!eq(tFromJs("variant232"), "variant232")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 846, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 846, + 0 + ] + } + }); } if (!eq(tFromJs("variant233"), "variant233")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 847, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 847, + 0 + ] + } + }); } if (!eq(tFromJs("variant234"), "variant234")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 848, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 848, + 0 + ] + } + }); } if (!eq(tFromJs("variant235"), "variant235")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 849, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 849, + 0 + ] + } + }); } if (!eq(tFromJs("variant236"), "variant236")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 850, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 850, + 0 + ] + } + }); } if (!eq(tFromJs("variant237"), "variant237")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 851, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 851, + 0 + ] + } + }); } if (!eq(tFromJs("variant238"), "variant238")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 852, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 852, + 0 + ] + } + }); } if (!eq(tFromJs("variant239"), "variant239")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 853, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 853, + 0 + ] + } + }); } if (!eq(tFromJs("variant240"), "variant240")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 854, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 854, + 0 + ] + } + }); } if (!eq(tFromJs("variant241"), "variant241")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 855, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 855, + 0 + ] + } + }); } if (!eq(tFromJs("variant242"), "variant242")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 856, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 856, + 0 + ] + } + }); } if (!eq(tFromJs("variant243"), "variant243")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 857, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 857, + 0 + ] + } + }); } if (!eq(tFromJs("variant244"), "variant244")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 858, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 858, + 0 + ] + } + }); } if (!eq(tFromJs("variant245"), "variant245")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 859, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 859, + 0 + ] + } + }); } if (!eq(tFromJs("variant246"), "variant246")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 860, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 860, + 0 + ] + } + }); } if (!eq(tFromJs("variant247"), "variant247")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 861, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 861, + 0 + ] + } + }); } if (!eq(tFromJs("variant248"), "variant248")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 862, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 862, + 0 + ] + } + }); } if (!eq(tFromJs("variant249"), "variant249")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 863, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 863, + 0 + ] + } + }); } if (!eq(tFromJs("variant250"), "variant250")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 864, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 864, + 0 + ] + } + }); } if (!eq(tFromJs("variant251"), "variant251")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 865, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 865, + 0 + ] + } + }); } if (!eq(tFromJs("variant252"), "variant252")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 866, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 866, + 0 + ] + } + }); } if (!eq(tFromJs("variant253"), "variant253")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 867, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 867, + 0 + ] + } + }); } if (!eq(tFromJs("variant254"), "variant254")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 868, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 868, + 0 + ] + } + }); } if (!eq(tFromJs("variant255"), "variant255")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 869, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 869, + 0 + ] + } + }); } if (!eq(tFromJs("variant256"), "variant256")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 870, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 870, + 0 + ] + } + }); } if (!eq(tFromJs("variant257"), "variant257")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 871, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 871, + 0 + ] + } + }); } if (!eq(tFromJs("variant258"), "variant258")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 872, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 872, + 0 + ] + } + }); } if (!eq(tFromJs("variant259"), "variant259")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 873, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 873, + 0 + ] + } + }); } if (!eq(tFromJs("variant260"), "variant260")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 874, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 874, + 0 + ] + } + }); } if (!eq(tFromJs("variant261"), "variant261")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 875, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 875, + 0 + ] + } + }); } if (!eq(tFromJs("variant262"), "variant262")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 876, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 876, + 0 + ] + } + }); } if (!eq(tFromJs("variant263"), "variant263")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 877, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 877, + 0 + ] + } + }); } if (!eq(tFromJs("variant264"), "variant264")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 878, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 878, + 0 + ] + } + }); } if (!eq(tFromJs("variant265"), "variant265")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 879, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 879, + 0 + ] + } + }); } if (!eq(tFromJs("variant266"), "variant266")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 880, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 880, + 0 + ] + } + }); } if (!eq(tFromJs("variant267"), "variant267")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 881, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 881, + 0 + ] + } + }); } if (!eq(tFromJs("variant268"), "variant268")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 882, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 882, + 0 + ] + } + }); } if (!eq(tFromJs("variant269"), "variant269")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 883, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 883, + 0 + ] + } + }); } if (!eq(tFromJs("variant270"), "variant270")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 884, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 884, + 0 + ] + } + }); } if (!eq(tFromJs("variant271"), "variant271")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 885, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 885, + 0 + ] + } + }); } if (!eq(tFromJs("variant272"), "variant272")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 886, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 886, + 0 + ] + } + }); } if (!eq(tFromJs("variant273"), "variant273")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 887, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 887, + 0 + ] + } + }); } if (!eq(tFromJs("variant274"), "variant274")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 888, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 888, + 0 + ] + } + }); } if (!eq(tFromJs("variant275"), "variant275")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 889, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 889, + 0 + ] + } + }); } if (!eq(tFromJs("variant276"), "variant276")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 890, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 890, + 0 + ] + } + }); } if (!eq(tFromJs("variant277"), "variant277")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 891, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 891, + 0 + ] + } + }); } if (!eq(tFromJs("variant278"), "variant278")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 892, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 892, + 0 + ] + } + }); } if (!eq(tFromJs("variant279"), "variant279")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 893, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 893, + 0 + ] + } + }); } if (!eq(tFromJs("variant280"), "variant280")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 894, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 894, + 0 + ] + } + }); } if (!eq(tFromJs("variant281"), "variant281")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 895, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 895, + 0 + ] + } + }); } if (!eq(tFromJs("variant282"), "variant282")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 896, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 896, + 0 + ] + } + }); } if (!eq(tFromJs("variant283"), "variant283")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 897, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 897, + 0 + ] + } + }); } if (!eq(tFromJs("variant284"), "variant284")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 898, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 898, + 0 + ] + } + }); } if (!eq(tFromJs("variant285"), "variant285")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 899, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 899, + 0 + ] + } + }); } if (!eq(tFromJs("variant286"), "variant286")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 900, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 900, + 0 + ] + } + }); } if (!eq(tFromJs("variant287"), "variant287")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 901, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 901, + 0 + ] + } + }); } if (!eq(tFromJs("variant288"), "variant288")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 902, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 902, + 0 + ] + } + }); } if (!eq(tFromJs("variant289"), "variant289")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 903, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 903, + 0 + ] + } + }); } if (!eq(tFromJs("variant290"), "variant290")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 904, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 904, + 0 + ] + } + }); } if (!eq(tFromJs("variant291"), "variant291")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 905, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 905, + 0 + ] + } + }); } if (!eq(tFromJs("variant292"), "variant292")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 906, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 906, + 0 + ] + } + }); } if (!eq(tFromJs("variant293"), "variant293")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 907, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 907, + 0 + ] + } + }); } if (!eq(tFromJs("variant294"), "variant294")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 908, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 908, + 0 + ] + } + }); } if (!eq(tFromJs("variant295"), "variant295")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 909, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 909, + 0 + ] + } + }); } if (!eq(tFromJs("variant296"), "variant296")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 910, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 910, + 0 + ] + } + }); } if (!eq(tFromJs("variant297"), "variant297")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 911, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 911, + 0 + ] + } + }); } if (!eq(tFromJs("variant298"), "variant298")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 912, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 912, + 0 + ] + } + }); } if (!eq(tFromJs("variant299"), "variant299")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 913, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 913, + 0 + ] + } + }); } if (!eq(tFromJs("xx"), undefined)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "big_polyvar_test.res", - 914, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "big_polyvar_test.res", + 914, + 0 + ] + } + }); } exports.tToJs = tToJs; diff --git a/jscomp/test/bs_MapInt_test.js b/jscomp/test/bs_MapInt_test.js index 4934a8aaf3..f076fc6a75 100644 --- a/jscomp/test/bs_MapInt_test.js +++ b/jscomp/test/bs_MapInt_test.js @@ -13,13 +13,13 @@ function should(b) { function test() { let m; - for(let i = 0; i <= 999999; ++i){ + for (let i = 0; i <= 999999; ++i) { m = Belt_MapInt.set(m, i, i); } - for(let i$1 = 0; i$1 <= 999999; ++i$1){ + for (let i$1 = 0; i$1 <= 999999; ++i$1) { should(Belt_MapInt.get(m, i$1) !== undefined); } - for(let i$2 = 0; i$2 <= 999999; ++i$2){ + for (let i$2 = 0; i$2 <= 999999; ++i$2) { m = Belt_MapInt.remove(m, i$2); } should(Belt_MapInt.isEmpty(m)); diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index c2abc8919b..00f3f1dda6 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -135,15 +135,15 @@ let v$1 = [ if (!Belt_Array.set(v$1, 0, 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_array_test.res", - 51, - 6 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_array_test.res", + 51, + 6 + ] + } + }); } b("File \"bs_array_test.res\", line 48, characters 4-11", Belt_Array.getExn(v$1, 0) === 0); @@ -155,15 +155,15 @@ let v$2 = [ if (!Belt_Array.set(v$2, 1, 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_array_test.res", - 59, - 6 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_array_test.res", + 59, + 6 + ] + } + }); } b("File \"bs_array_test.res\", line 56, characters 4-11", Belt_Array.getExn(v$2, 1) === 0); @@ -279,20 +279,20 @@ function addone(x) { function makeMatrixExn(sx, sy, init) { if (!(sx >= 0 && sy >= 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_array_test.res", - 116, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_array_test.res", + 116, + 2 + ] + } + }); } let res = new Array(sx); - for(let x = 0; x < sx; ++x){ + for (let x = 0; x < sx; ++x) { let initY = new Array(sy); - for(let y = 0; y < sy; ++y){ + for (let y = 0; y < sy; ++y) { initY[y] = init; } res[x] = initY; diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index e44cd0452e..04a18931f9 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -84,13 +84,13 @@ Belt_HashMap.mergeMany(v$1, Belt_Array.zip(u$1, u$1)); eqx("File \"bs_hashmap_test.res\", line 49, characters 6-13", v$1.size, 100001); -for(let i = 0; i <= 1000; ++i){ +for (let i = 0; i <= 1000; ++i) { Belt_HashMap.remove(v$1, i); } eqx("File \"bs_hashmap_test.res\", line 53, characters 6-13", v$1.size, 99000); -for(let i$1 = 0; i$1 <= 2000; ++i$1){ +for (let i$1 = 0; i$1 <= 2000; ++i$1) { Belt_HashMap.remove(v$1, i$1); } diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index 3abb87e389..36dbe3366d 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -61,13 +61,13 @@ Belt_HashSetInt.mergeMany(v$1, u$1); eq("File \"bs_hashset_int_test.res\", line 32, characters 5-12", v$1.size, 100001); -for(let i = 0; i <= 1000; ++i){ +for (let i = 0; i <= 1000; ++i) { Belt_HashSetInt.remove(v$1, i); } eq("File \"bs_hashset_int_test.res\", line 36, characters 5-12", v$1.size, 99000); -for(let i$1 = 0; i$1 <= 2000; ++i$1){ +for (let i$1 = 0; i$1 <= 2000; ++i$1) { Belt_HashSetInt.remove(v$1, i$1); } @@ -79,11 +79,11 @@ let u1 = Belt_HashSetInt.copy(u0); eq("File \"bs_hashset_int_test.res\", line 49, characters 5-12", Belt_HashSetInt.toArray(u0), Belt_HashSetInt.toArray(u1)); -for(let i$2 = 0; i$2 <= 2000; ++i$2){ +for (let i$2 = 0; i$2 <= 2000; ++i$2) { Belt_HashSetInt.remove(u1, i$2); } -for(let i$3 = 0; i$3 <= 1000; ++i$3){ +for (let i$3 = 0; i$3 <= 1000; ++i$3) { Belt_HashSetInt.remove(u0, i$3); } diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index 3d5f260957..ab3f5d2f58 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -55,7 +55,7 @@ function f(i) { eq("File \"bs_list_test.res\", line 27, characters 18-25", Belt_List.getExn(u, i), Math.imul(i, i)); } -for(let i = 0; i <= 4; ++i){ +for (let i = 0; i <= 4; ++i) { f(i); } diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index 0f22228a21..7a481f76e4 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -71,7 +71,7 @@ Belt_Map.getId(m2); let m_dict = Belt_Map.getId(m); -for(let i = 0; i <= 100000; ++i){ +for (let i = 0; i <= 100000; ++i) { data = Belt_MapDict.set(data, i, i, m_dict.cmp); } @@ -96,7 +96,7 @@ let cmp = m_dict$1.cmp; let data$2; -for(let i$1 = 0; i$1 <= 100000; ++i$1){ +for (let i$1 = 0; i$1 <= 100000; ++i$1) { data$2 = Belt_SetDict.add(data$2, i$1, cmp); } diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index 16d171bb1f..484e86f318 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -51,7 +51,7 @@ b("File \"bs_mutable_set_test.res\", line 28, characters 8-15", 1 === Belt_inter Belt_MutableSetInt.add(u, 3); -for(let i = 0 ,i_finish = r.length; i < i_finish; ++i){ +for (let i = 0, i_finish = r.length; i < i_finish; ++i) { Belt_MutableSetInt.remove(u, r[i]); } @@ -69,7 +69,7 @@ eq("File \"bs_mutable_set_test.res\", line 38, characters 9-16", Belt_internalAV b("File \"bs_mutable_set_test.res\", line 39, characters 8-15", !Belt_MutableSetInt.isEmpty(u)); -for(let i$1 = 0; i$1 <= 3; ++i$1){ +for (let i$1 = 0; i$1 <= 3; ++i$1) { Belt_MutableSetInt.remove(u, i$1); } @@ -421,7 +421,7 @@ let v$1 = { data: undefined }; -for(let i$2 = 0; i$2 <= 100000; ++i$2){ +for (let i$2 = 0; i$2 <= 100000; ++i$2) { Belt_MutableSetInt.add(v$1, i$2); } @@ -455,7 +455,7 @@ eq("File \"bs_mutable_set_test.res\", line 203, characters 5-12", Belt_internalA let u$3 = Array_data_util.randomRange(50000, 80000); -for(let i$3 = 0 ,i_finish$1 = u$3.length; i$3 < i_finish$1; ++i$3){ +for (let i$3 = 0, i_finish$1 = u$3.length; i$3 < i_finish$1; ++i$3) { Belt_MutableSetInt.remove(v$3, i$3); } @@ -463,7 +463,7 @@ eq("File \"bs_mutable_set_test.res\", line 210, characters 5-12", Belt_internalA let vv = Array_data_util.randomRange(0, 100000); -for(let i$4 = 0 ,i_finish$2 = vv.length; i$4 < i_finish$2; ++i$4){ +for (let i$4 = 0, i_finish$2 = vv.length; i$4 < i_finish$2; ++i$4) { Belt_MutableSetInt.remove(v$3, Caml_array.get(vv, i$4)); } @@ -493,7 +493,7 @@ eq("File \"bs_mutable_set_test.res\", line 227, characters 5-12", Belt_internalA let vv$1 = Array_data_util.randomRange(1, 28); -for(let i$5 = 0 ,i_finish$3 = vv$1.length; i$5 < i_finish$3; ++i$5){ +for (let i$5 = 0, i_finish$3 = vv$1.length; i$5 < i_finish$3; ++i$5) { Belt_MutableSetInt.remove(v$4, Caml_array.get(vv$1, i$5)); } @@ -610,7 +610,7 @@ let cc$1 = Belt_MutableSetInt.keep(v$5, (function (x) { return x % 8 !== 0; })); -for(let i$6 = 0; i$6 <= 200; ++i$6){ +for (let i$6 = 0; i$6 <= 200; ++i$6) { Belt_MutableSetInt.remove(v$5, i$6); } diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 33a00591d1..338cec9700 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -59,7 +59,7 @@ b("File \"bs_poly_mutable_set_test.res\", line 23, characters 4-11", 1 === Belt_ Belt_MutableSet.add(u, 3); -for(let i = 0 ,i_finish = r.length; i < i_finish; ++i){ +for (let i = 0, i_finish = r.length; i < i_finish; ++i) { Belt_MutableSet.remove(u, r[i]); } @@ -77,7 +77,7 @@ eq("File \"bs_poly_mutable_set_test.res\", line 33, characters 5-12", Belt_inter b("File \"bs_poly_mutable_set_test.res\", line 34, characters 4-11", !Belt_MutableSet.isEmpty(u)); -for(let i$1 = 0; i$1 <= 3; ++i$1){ +for (let i$1 = 0; i$1 <= 3; ++i$1) { Belt_MutableSet.remove(u, i$1); } diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index a57ca4a829..cb4358d47e 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -26,8 +26,7 @@ function does_raise(f, q) { try { f(q); return false; - } - catch (exn){ + } catch (exn) { return true; } } @@ -45,28 +44,28 @@ let q = { if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), []) && q.length === 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 25, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 25, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 1), q)), [1]) && q.length === 1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 26, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 26, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)), [ @@ -74,15 +73,15 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)) 2 ]) && q.length === 2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 27, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 27, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)), [ @@ -91,15 +90,15 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)) 3 ]) && q.length === 3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 28, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 28, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 4), q)), [ @@ -109,28 +108,28 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 4), q)) 4 ]) && q.length === 4)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 29, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 29, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 30, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 30, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ @@ -139,28 +138,28 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ 4 ]) && q.length === 3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 31, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 31, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 32, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 32, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ @@ -168,80 +167,80 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ 4 ]) && q.length === 2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 33, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 33, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 34, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 34, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [4]) && q.length === 1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 35, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 35, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q) !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 36, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 36, + 2 + ] + } + }); } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), []) && q.length === 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 37, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 37, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.popExn, q)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 38, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 38, + 2 + ] + } + }); } let q$1 = { @@ -252,67 +251,67 @@ let q$1 = { if (Belt_MutableQueue.popExn((Belt_MutableQueue.add(q$1, 1), q$1)) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 43, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 43, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.popExn, q$1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 44, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 44, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn((Belt_MutableQueue.add(q$1, 2), q$1)) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 45, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 45, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.popExn, q$1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 46, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 46, + 2 + ] + } + }); } if (q$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 47, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 47, + 2 + ] + } + }); } let q$2 = { @@ -323,145 +322,145 @@ let q$2 = { if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q$2, 1), q$2)) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 52, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 52, + 2 + ] + } + }); } if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q$2, 2), q$2)) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 53, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 53, + 2 + ] + } + }); } if (Belt_MutableQueue.peekExn((Belt_MutableQueue.add(q$2, 3), q$2)) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 54, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 54, + 2 + ] + } + }); } if (Belt_MutableQueue.peekExn(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 55, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 55, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 56, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 56, + 2 + ] + } + }); } if (Belt_MutableQueue.peekExn(q$2) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 57, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 57, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q$2) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 58, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 58, + 2 + ] + } + }); } if (Belt_MutableQueue.peekExn(q$2) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 59, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 59, + 2 + ] + } + }); } if (Belt_MutableQueue.popExn(q$2) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 60, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 60, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.peekExn, q$2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 61, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 61, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.peekExn, q$2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 62, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 62, + 2 + ] + } + }); } let q$3 = { @@ -470,7 +469,7 @@ let q$3 = { last: undefined }; -for(let i = 1; i <= 10; ++i){ +for (let i = 1; i <= 10; ++i) { Belt_MutableQueue.add(q$3, i); } @@ -478,28 +477,28 @@ Belt_MutableQueue.clear(q$3); if (q$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 71, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 71, + 2 + ] + } + }); } if (!does_raise(Belt_MutableQueue.popExn, q$3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 72, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 72, + 2 + ] + } + }); } if (!Caml_obj.equal(q$3, { @@ -508,30 +507,30 @@ if (!Caml_obj.equal(q$3, { last: undefined })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 73, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 73, + 2 + ] + } + }); } Belt_MutableQueue.add(q$3, 42); if (Belt_MutableQueue.popExn(q$3) !== 42) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 75, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 75, + 2 + ] + } + }); } let q1 = { @@ -540,7 +539,7 @@ let q1 = { last: undefined }; -for(let i$1 = 1; i$1 <= 10; ++i$1){ +for (let i$1 = 1; i$1 <= 10; ++i$1) { Belt_MutableQueue.add(q1, i$1); } @@ -559,15 +558,15 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1), [ 10 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 84, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 84, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2), [ @@ -583,71 +582,71 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2), [ 10 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 85, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 85, + 2 + ] + } + }); } if (q1.length !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 86, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 86, + 2 + ] + } + }); } if (q2.length !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 87, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 87, + 2 + ] + } + }); } -for(let i$2 = 1; i$2 <= 10; ++i$2){ +for (let i$2 = 1; i$2 <= 10; ++i$2) { if (Belt_MutableQueue.popExn(q1) !== i$2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 89, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 89, + 4 + ] + } + }); } } -for(let i$3 = 1; i$3 <= 10; ++i$3){ +for (let i$3 = 1; i$3 <= 10; ++i$3) { if (Belt_MutableQueue.popExn(q2) !== i$3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 92, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 92, + 4 + ] + } + }); } } @@ -660,98 +659,98 @@ let q$4 = { if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 98, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 98, + 2 + ] + } + }); } -for(let i$4 = 1; i$4 <= 10; ++i$4){ +for (let i$4 = 1; i$4 <= 10; ++i$4) { Belt_MutableQueue.add(q$4, i$4); if (q$4.length !== i$4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 101, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 101, + 4 + ] + } + }); } if (q$4.length === 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 102, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 102, + 4 + ] + } + }); } } -for(let i$5 = 10; i$5 >= 1; --i$5){ +for (let i$5 = 10; i$5 >= 1; --i$5) { if (q$4.length !== i$5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 105, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 105, + 4 + ] + } + }); } if (q$4.length === 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 106, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 106, + 4 + ] + } + }); } Belt_MutableQueue.popExn(q$4); } if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 109, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 109, + 2 + ] + } + }); } if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 110, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 110, + 2 + ] + } + }); } let q$5 = { @@ -760,7 +759,7 @@ let q$5 = { last: undefined }; -for(let i$6 = 1; i$6 <= 10; ++i$6){ +for (let i$6 = 1; i$6 <= 10; ++i$6) { Belt_MutableQueue.add(q$5, i$6); } @@ -771,15 +770,15 @@ let i$7 = { Belt_MutableQueue.forEach(q$5, (function (j) { if (i$7.contents !== j) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 120, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 120, + 4 + ] + } + }); } i$7.contents = i$7.contents + 1 | 0; })); @@ -798,108 +797,108 @@ let q2$1 = { if (q1$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 127, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 127, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$1), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 128, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 128, + 2 + ] + } + }); } if (q2$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 129, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 129, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$1), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 130, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 130, + 2 + ] + } + }); } Belt_MutableQueue.transfer(q1$1, q2$1); if (q1$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 132, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 132, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$1), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 133, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 133, + 2 + ] + } + }); } if (q2$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 134, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 134, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$1), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 135, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 135, + 2 + ] + } + }); } let q1$2 = { @@ -914,21 +913,21 @@ let q2$2 = { last: undefined }; -for(let i$8 = 1; i$8 <= 4; ++i$8){ +for (let i$8 = 1; i$8 <= 4; ++i$8) { Belt_MutableQueue.add(q1$2, i$8); } if (q1$2.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 143, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 143, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$2), [ @@ -938,82 +937,82 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$2), [ 4 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 144, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 144, + 2 + ] + } + }); } if (q2$2.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 145, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 145, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$2), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 146, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 146, + 2 + ] + } + }); } Belt_MutableQueue.transfer(q1$2, q2$2); if (q1$2.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 148, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 148, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$2), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 149, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 149, + 2 + ] + } + }); } if (q2$2.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 150, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 150, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$2), [ @@ -1023,15 +1022,15 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$2), [ 4 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 151, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 151, + 2 + ] + } + }); } let q1$3 = { @@ -1046,47 +1045,47 @@ let q2$3 = { last: undefined }; -for(let i$9 = 5; i$9 <= 8; ++i$9){ +for (let i$9 = 5; i$9 <= 8; ++i$9) { Belt_MutableQueue.add(q2$3, i$9); } if (q1$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 159, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 159, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$3), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 160, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 160, + 2 + ] + } + }); } if (q2$3.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 161, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 161, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ @@ -1096,56 +1095,56 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ 8 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 162, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 162, + 2 + ] + } + }); } Belt_MutableQueue.transfer(q1$3, q2$3); if (q1$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 164, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 164, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$3), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 165, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 165, + 2 + ] + } + }); } if (q2$3.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 166, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 166, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ @@ -1155,15 +1154,15 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ 8 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 167, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 167, + 2 + ] + } + }); } let q1$4 = { @@ -1178,25 +1177,25 @@ let q2$4 = { last: undefined }; -for(let i$10 = 1; i$10 <= 4; ++i$10){ +for (let i$10 = 1; i$10 <= 4; ++i$10) { Belt_MutableQueue.add(q1$4, i$10); } -for(let i$11 = 5; i$11 <= 8; ++i$11){ +for (let i$11 = 5; i$11 <= 8; ++i$11) { Belt_MutableQueue.add(q2$4, i$11); } if (q1$4.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 178, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 178, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$4), [ @@ -1206,28 +1205,28 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$4), [ 4 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 179, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 179, + 2 + ] + } + }); } if (q2$4.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 180, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 180, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), [ @@ -1237,43 +1236,43 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), [ 8 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 181, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 181, + 2 + ] + } + }); } Belt_MutableQueue.transfer(q1$4, q2$4); if (q1$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 183, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 183, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$4), [])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 184, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 184, + 2 + ] + } + }); } let v = [ @@ -1289,28 +1288,28 @@ let v = [ if (q2$4.length !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 186, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 186, + 2 + ] + } + }); } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 187, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 187, + 2 + ] + } + }); } if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { @@ -1319,15 +1318,15 @@ if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { return x - y | 0; }))) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 189, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 189, + 2 + ] + } + }); } console.log("OK"); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index 80039fd7d5..b3eb0f0a2a 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -80,7 +80,7 @@ let l; let r; -for(let i$1 = 100; i$1 <= 1500; ++i$1){ +for (let i$1 = 100; i$1 <= 1500; ++i$1) { if (i$1 % 3 === 0) { l = Belt_SetInt.add(l, i$1); } else { diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index 4a59183ec0..793432b9f3 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -29,17 +29,17 @@ function inOrder(v) { first: undefined, last: undefined }; - while(current !== undefined) { + while (current !== undefined) { let v$1 = current; Belt_MutableStack.push(s, v$1); current = v$1.left; }; - while(s.root !== undefined) { + while (s.root !== undefined) { current = Belt_MutableStack.popUndefined(s); let v$2 = current; Belt_MutableQueue.add(q, v$2.value); current = v$2.right; - while(current !== undefined) { + while (current !== undefined) { let v$3 = current; Belt_MutableStack.push(s, v$3); current = v$3.left; @@ -58,7 +58,7 @@ function inOrder3(v) { first: undefined, last: undefined }; - while(current !== undefined) { + while (current !== undefined) { let v$1 = current; Belt_MutableStack.push(s, v$1); current = v$1.left; @@ -66,7 +66,7 @@ function inOrder3(v) { Belt_MutableStack.dynamicPopIter(s, (function (popped) { Belt_MutableQueue.add(q, popped.value); let current = popped.right; - while(current !== undefined) { + while (current !== undefined) { let v = current; Belt_MutableStack.push(s, v); current = v.left; @@ -86,7 +86,7 @@ function inOrder2(v) { first: undefined, last: undefined }; - while(todo) { + while (todo) { if (cursor !== undefined) { let v$1 = cursor; Belt_MutableStack.push(s, v$1); @@ -114,7 +114,7 @@ let test1 = n(Caml_option.some(n(Caml_option.some(n(undefined, undefined, 4)), C function pushAllLeft(st1, s1) { let current = st1; - while(current !== undefined) { + while (current !== undefined) { let v = current; Belt_MutableStack.push(s1, v); current = v.left; diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index 71888e3cba..8c5c3c9701 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -50,7 +50,7 @@ let suites_1 = { "buffer", (function (param) { let v = Buffer.create(30); - for(let i = 0; i <= 10; ++i){ + for (let i = 0; i <= 10; ++i) { Buffer.add_string(v, String(i)); } return { diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 1fe8a2fb37..2df1c2ab5b 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -13,8 +13,7 @@ try { }), (function (x) { return x + 2 | 0; })); -} -catch (raw_exn){ +} catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); function_equal_test = exn.RE_EXN_ID === "Invalid_argument" && exn._1 === "equal: functional value" ? true : false; } diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index 06f028068e..a3f98dfeb4 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -41,15 +41,15 @@ function convert(s) { return x$1; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "chn_test.res", - 17, - 14 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "chn_test.res", + 17, + 14 + ] + } + }); }))); } diff --git a/jscomp/test/compare_test.js b/jscomp/test/compare_test.js index 723dc38139..4b4c6e86ea 100644 --- a/jscomp/test/compare_test.js +++ b/jscomp/test/compare_test.js @@ -5,45 +5,40 @@ function compare(x, y) { switch (x) { case "A" : - return y === "A"; + return y === "A"; case "B" : - return y === "B"; + return y === "B"; case "C" : - return y === "C"; - + return y === "C"; } } function compare2(x, y) { switch (x) { case "A" : - switch (y) { - case "A" : - return true; - case "B" : - case "C" : - return false; - - } + switch (y) { + case "A" : + return true; + case "B" : + case "C" : + return false; + } case "B" : - switch (y) { - case "B" : - return true; - case "A" : - case "C" : - return false; - - } + switch (y) { + case "B" : + return true; + case "A" : + case "C" : + return false; + } case "C" : - switch (y) { - case "A" : - case "B" : - return false; - case "C" : - return true; - - } - + switch (y) { + case "A" : + case "B" : + return false; + case "C" : + return true; + } } } diff --git a/jscomp/test/complete_parmatch_test.js b/jscomp/test/complete_parmatch_test.js index 1801659e00..6abcb4081f 100644 --- a/jscomp/test/complete_parmatch_test.js +++ b/jscomp/test/complete_parmatch_test.js @@ -5,11 +5,11 @@ function f(x) { switch (x) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index ac9d60a393..cdd266d2cb 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -15,7 +15,7 @@ function fib(x) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -38,7 +38,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -62,20 +62,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -86,32 +86,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 5120844c09..89e5f7a681 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -4,7 +4,7 @@ function f() { let n = 0; - while((function () { + while ((function () { let fib = function (x) { if (x === 0 || x === 1) { return 1; @@ -20,7 +20,7 @@ function f() { } function ff() { - while((function () { + while ((function () { let b = 9; return (3 + b | 0) > 10; })()) { diff --git a/jscomp/test/const_defs_test.js b/jscomp/test/const_defs_test.js index 4c529ee379..2e2bb57544 100644 --- a/jscomp/test/const_defs_test.js +++ b/jscomp/test/const_defs_test.js @@ -6,11 +6,11 @@ let u = 3; function f() { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "hi" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "hi" + } + }); } exports.u = u; diff --git a/jscomp/test/const_test.js b/jscomp/test/const_test.js index f0116628ce..e36d5b3ad9 100644 --- a/jscomp/test/const_test.js +++ b/jscomp/test/const_test.js @@ -17,12 +17,11 @@ function fff(x) { }; switch (x$1.TAG) { case "A" : - return x; + return x; case "B" : - return 1; + return 1; case "C" : - return 2; - + return 2; } } diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 8939bea0dd..31fe97de7a 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -10,7 +10,7 @@ function test() { contents: 0 }; let f = function (_n, _acc) { - while(true) { + while (true) { let acc = _acc; let n = _n; if (n === 0) { @@ -37,7 +37,7 @@ function test_closure() { let arr = Caml_array.make(6, (function (x) { return x; })); - for(let i = 0; i <= 5; ++i){ + for (let i = 0; i <= 5; ++i) { Caml_array.set(arr, i, (function (param) { return i; })); @@ -55,7 +55,7 @@ function test_closure2() { let arr = Caml_array.make(6, (function (x) { return x; })); - for(let i = 0; i <= 5; ++i){ + for (let i = 0; i <= 5; ++i) { let j = i + i | 0; Caml_array.set(arr, i, (function (param) { return j; diff --git a/jscomp/test/custom_error_test.js b/jscomp/test/custom_error_test.js index e126b6f346..0e19bcac08 100644 --- a/jscomp/test/custom_error_test.js +++ b/jscomp/test/custom_error_test.js @@ -8,16 +8,15 @@ function test_js_error() { let e; try { e = JSON.parse(" {\"x\" : }"); - } - catch (raw_err){ + } catch (raw_err) { let err = Caml_js_exceptions.internalToOCamlException(raw_err); if (err.RE_EXN_ID === Js_exn.$$Error) { console.log(err._1.stack); return; } throw new Error(err.RE_EXN_ID, { - cause: err - }); + cause: err + }); } return e; } @@ -25,18 +24,17 @@ function test_js_error() { function test_js_error2() { try { return JSON.parse(" {\"x\" : }"); - } - catch (raw_e){ + } catch (raw_e) { let e = Caml_js_exceptions.internalToOCamlException(raw_e); if (e.RE_EXN_ID === Js_exn.$$Error) { console.log(e._1.stack); throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } } @@ -44,16 +42,15 @@ function example1() { let v; try { v = JSON.parse(" {\"x\" }"); - } - catch (raw_err){ + } catch (raw_err) { let err = Caml_js_exceptions.internalToOCamlException(raw_err); if (err.RE_EXN_ID === Js_exn.$$Error) { console.log(err._1.stack); return; } throw new Error(err.RE_EXN_ID, { - cause: err - }); + cause: err + }); } return v; } @@ -61,15 +58,14 @@ function example1() { function example2() { try { return JSON.parse(" {\"x\"}"); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Js_exn.$$Error) { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/defunctor_make_test.js b/jscomp/test/defunctor_make_test.js index 75b6eca17b..1e0ac446ce 100644 --- a/jscomp/test/defunctor_make_test.js +++ b/jscomp/test/defunctor_make_test.js @@ -45,11 +45,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l._3; let ld = l._2; @@ -62,11 +62,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr._0), lr._1, lr._2, create(lr._3, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -80,11 +80,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r._3; let rd = r._2; @@ -97,11 +97,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl._0), rl._1, rl._2, create(rl._3, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, compare, x_) { diff --git a/jscomp/test/demo_int_map.js b/jscomp/test/demo_int_map.js index 34ee5f4df4..50052476dc 100644 --- a/jscomp/test/demo_int_map.js +++ b/jscomp/test/demo_int_map.js @@ -31,11 +31,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -48,11 +48,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -66,11 +66,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -83,11 +83,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, param) { @@ -137,14 +137,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = x - param.v | 0; if (c === 0) { @@ -157,10 +157,10 @@ function find(x, _param) { function test() { let m = "Empty"; - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { m = add(i, i, m); } - for(let i$1 = 0; i$1 <= 1000000; ++i$1){ + for (let i$1 = 0; i$1 <= 1000000; ++i$1) { find(i$1, m); } } diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index 03af90cb46..2148270da4 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -14,7 +14,7 @@ function fib(x) { function sum(n) { let v = 0; - for(let i = 0; i <= n; ++i){ + for (let i = 0; i <= n; ++i) { v = v + i | 0; } return v; diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index f7ad48dad5..be5e5b3cb0 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -14,7 +14,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f$1(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f$1(a[i]); } return r; @@ -29,14 +29,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f$1(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f$1(i); } return res; @@ -47,7 +47,7 @@ function fold_left(f, x, a) { return f(x, y); }; let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f$1(r, a[i]); } return r; diff --git a/jscomp/test/equal_exception_test.js b/jscomp/test/equal_exception_test.js index 082585d43c..263778a862 100644 --- a/jscomp/test/equal_exception_test.js +++ b/jscomp/test/equal_exception_test.js @@ -14,73 +14,72 @@ let v = "gso"; function is_equal() { if (Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0) !== /* 'a' */97) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 4, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 4, + 2 + ] + } + }); } if (Bytes.make(3, /* 'a' */97)[0] !== /* 'a' */97) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 5, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 5, + 2 + ] + } + }); } let u = Bytes.make(3, /* 'a' */97); u[0] = /* 'b' */98; if (u[0] !== /* 'b' */98) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 8, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 8, + 2 + ] + } + }); } if (Caml_string.get(v, 0) === /* 'g' */103) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 9, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 9, + 2 + ] + } + }); } function is_exception() { try { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); - } - catch (raw_exn){ + cause: { + RE_EXN_ID: "Not_found" + } + }); + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -92,22 +91,21 @@ function is_normal_exception(_x) { }; try { throw new Error(v.RE_EXN_ID, { - cause: v - }); - } - catch (raw_exn){ + cause: v + }); + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === A) { if (exn._1 === 3) { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -115,12 +113,11 @@ function is_arbitrary_exception() { let A = /* @__PURE__ */Caml_exceptions.create("A"); try { throw new Error(A, { - cause: { - RE_EXN_ID: A - } - }); - } - catch (exn){ + cause: { + RE_EXN_ID: A + } + }); + } catch (exn) { return; } } @@ -169,28 +166,28 @@ if (Caml_obj.equal(e, { RE_EXN_ID: Not_found }) !== false) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 50, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 50, + 0 + ] + } + }); } if (Not_found === "Not_found" !== false) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "equal_exception_test.res", - 51, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "equal_exception_test.res", + 51, + 0 + ] + } + }); } Mt.from_suites("exception", suites); diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index e46937b21b..70c918c055 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -19,8 +19,7 @@ function appf(g, x) { let A = /* @__PURE__ */Caml_exceptions.create("A"); try { return g(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Local) { return 3; @@ -63,8 +62,7 @@ let f; try { f = (function () {throw (new Error ("x"))} ()); -} -catch (raw_x){ +} catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); f = x.RE_EXN_ID === A ? x._1 : 2; } @@ -73,8 +71,7 @@ let ff; try { ff = (function () {throw 3} ()); -} -catch (raw_x$1){ +} catch (raw_x$1) { let x$1 = Caml_js_exceptions.internalToOCamlException(raw_x$1); ff = x$1.RE_EXN_ID === A ? x$1._1 : 2; } @@ -83,8 +80,7 @@ let fff; try { fff = (function () {throw 2} ()); -} -catch (raw_x$2){ +} catch (raw_x$2) { let x$2 = Caml_js_exceptions.internalToOCamlException(raw_x$2); fff = x$2.RE_EXN_ID === A ? x$2._1 : 2; } @@ -93,22 +89,21 @@ let a0; try { a0 = (function (){throw 2} ()); -} -catch (raw_x$3){ +} catch (raw_x$3) { let x$3 = Caml_js_exceptions.internalToOCamlException(raw_x$3); if (x$3.RE_EXN_ID === A || x$3.RE_EXN_ID === Js_exn.$$Error) { a0 = x$3._1; } else { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "exception_raise_test.res", - 104, - 7 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "exception_raise_test.res", + 104, + 7 + ] + } + }); } } @@ -116,8 +111,7 @@ let a1; try { a1 = (function (){throw 2} ()); -} -catch (raw_e){ +} catch (raw_e) { a1 = Caml_js_exceptions.internalToOCamlException(raw_e); } @@ -125,8 +119,7 @@ let a2; try { a2 = (function (){throw (new Error("x"))} ()); -} -catch (raw_e$1){ +} catch (raw_e$1) { a2 = Caml_js_exceptions.internalToOCamlException(raw_e$1); } @@ -164,15 +157,15 @@ let suites = { }; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "exception_raise_test.res", - 127, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "exception_raise_test.res", + 127, + 15 + ] + } + }); }) ], tl: /* [] */0 @@ -190,20 +183,18 @@ function eq(loc, x, y) { try { ((()=>{throw 2})()); -} -catch (raw_e$2){ +} catch (raw_e$2) { let e = Caml_js_exceptions.internalToOCamlException(raw_e$2); eq("File \"exception_raise_test.res\", line 137, characters 10-17", Caml_js_exceptions.as_js_exn(e) !== undefined, true); } try { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); -} -catch (raw_e$3){ + cause: { + RE_EXN_ID: "Not_found" + } + }); +} catch (raw_e$3) { let e$1 = Caml_js_exceptions.internalToOCamlException(raw_e$3); eq("File \"exception_raise_test.res\", line 141, characters 10-17", Caml_js_exceptions.as_js_exn(e$1) !== undefined, false); } @@ -212,21 +203,19 @@ function fff0(x, g) { let val; try { val = x(); - } - catch (exn){ + } catch (exn) { return 1; } return g(); } function input_lines(ic, _acc) { - while(true) { + while (true) { let acc = _acc; let line; try { line = input_line(ic); - } - catch (exn){ + } catch (exn) { return List.rev(acc); } _acc = { diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index 3c0843c748..403e7a2b7f 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -40,8 +40,7 @@ function test_js_error4() { try { JSON.parse(" {\"x\"}"); return 1; - } - catch (raw_e){ + } catch (raw_e) { let e = Caml_js_exceptions.internalToOCamlException(raw_e); if (e.RE_EXN_ID === "Not_found") { return 2; @@ -68,15 +67,14 @@ function test_js_error4() { function f(g) { try { return g(); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return 1; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/exception_value_test.js b/jscomp/test/exception_value_test.js index a48c45483f..dee7400ffb 100644 --- a/jscomp/test/exception_value_test.js +++ b/jscomp/test/exception_value_test.js @@ -7,34 +7,34 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function f() { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function assert_f(x) { if (x <= 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "exception_value_test.res", - 4, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "exception_value_test.res", + 4, + 11 + ] + } + }); } return 3; } function hh() { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let A = /* @__PURE__ */Caml_exceptions.create("Exception_value_test.A"); @@ -51,33 +51,31 @@ let u = { function test_not_found(f, param) { try { return f(); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return 2; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function test_js_error2() { try { return JSON.parse(" {\"x\" : }"); - } - catch (raw_e){ + } catch (raw_e) { let e = Caml_js_exceptions.internalToOCamlException(raw_e); if (e.RE_EXN_ID === Js_exn.$$Error) { console.log(e._1.stack); throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } } @@ -85,8 +83,7 @@ function test_js_error3() { try { JSON.parse(" {\"x\"}"); return 1; - } - catch (e){ + } catch (e) { return 0; } } diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index de2c274cb2..d3793e0f0c 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -10,7 +10,7 @@ function reverse_range(a, i, len) { if (len === 0) { return; } - for(let k = 0 ,k_finish = (len - 1 | 0) / 2 | 0; k <= k_finish; ++k){ + for (let k = 0, k_finish = (len - 1 | 0) / 2 | 0; k <= k_finish; ++k) { let t = a[i + k | 0]; a[i + k | 0] = a[((i + len | 0) - 1 | 0) - k | 0]; a[((i + len | 0) - 1 | 0) - k | 0] = t; @@ -27,7 +27,7 @@ function reverse(a) { return []; } let b = $$Array.copy(a); - for(let i = 0; i < b_len; ++i){ + for (let i = 0; i < b_len; ++i) { b[i] = a[(b_len - 1 | 0) - i | 0]; } return b; @@ -41,7 +41,7 @@ function reverse_of_list(x) { let a = Caml_array.make(len, x.hd); let _i = 0; let _x = x.tl; - while(true) { + while (true) { let x$1 = _x; let i = _i; if (!x$1) { @@ -58,7 +58,7 @@ function filter(f, a) { let arr_len = a.length; let _acc = /* [] */0; let _i = 0; - while(true) { + while (true) { let i = _i; let acc = _acc; if (i === arr_len) { @@ -82,7 +82,7 @@ function filter_map(f, a) { let arr_len = a.length; let _acc = /* [] */0; let _i = 0; - while(true) { + while (true) { let i = _i; let acc = _acc; if (i === arr_len) { @@ -106,11 +106,11 @@ function filter_map(f, a) { function range(from, to_) { if (from > to_) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_array_test.range" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_array_test.range" + } + }); } return $$Array.init((to_ - from | 0) + 1 | 0, (function (i) { return i + from | 0; @@ -121,11 +121,11 @@ function map2i(f, a, b) { let len = a.length; if (len !== b.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_array_test.map2i" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_array_test.map2i" + } + }); } return $$Array.mapi((function (i, a) { return f(i, a, b[i]); @@ -133,7 +133,7 @@ function map2i(f, a, b) { } function tolist_aux(a, f, _i, _res) { - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -168,7 +168,7 @@ function of_list_map(f, a) { let arr = Caml_array.make(len, hd); let _i = 1; let _x = tl; - while(true) { + while (true) { let x = _x; let i = _i; if (!x) { @@ -184,7 +184,7 @@ function of_list_map(f, a) { function rfind_with_index(arr, cmp, v) { let len = arr.length; let _i = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i < 0) { return i; @@ -215,7 +215,7 @@ function rfind_and_split(arr, cmp, v) { function find_with_index(arr, cmp, v) { let len = arr.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= len) { return -1; @@ -246,7 +246,7 @@ function find_and_split(arr, cmp, v) { function exists(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -264,7 +264,7 @@ function is_empty(arr) { } function unsafe_loop(_index, len, p, xs, ys) { - while(true) { + while (true) { let index = _index; if (index >= len) { return true; diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index 6e333d5bf1..d011a861d0 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -23,7 +23,7 @@ function eq(loc, x, y) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -46,7 +46,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -70,20 +70,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -94,32 +94,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } @@ -134,26 +132,25 @@ function starts_with(xs, prefix, p) { return false; } try { - for(let i = 0; i < len2; ++i){ + for (let i = 0; i < len2; ++i) { if (!p(Caml_bytes.get(xs, i), Caml_bytes.get(prefix, i))) { throw new Error(H, { - cause: { - RE_EXN_ID: H - } - }); + cause: { + RE_EXN_ID: H + } + }); } } return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === H) { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index b4df9c0f72..e443d10358 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -34,7 +34,7 @@ function path_as_directory(x) { function absolute_path(s) { let s$1 = Filename.is_relative(s) ? Filename.concat(CamlinternalLazy.force(cwd), s) : s; let aux = function (_s) { - while(true) { + while (true) { let s = _s; let base = Filename.basename(s); let dir = Filename.dirname(s); @@ -59,36 +59,34 @@ function chop_extension(locOpt, name) { let loc = locOpt !== undefined ? locOpt : ""; try { return Filename.chop_extension(name); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Invalid_argument") { let s = "Filename.chop_extension ( " + loc + " : " + name + " )"; throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function chop_extension_if_any(fname) { try { return Filename.chop_extension(fname); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Invalid_argument") { return fname; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -100,7 +98,7 @@ function relative_path(file_or_dir_1, file_or_dir_2) { let dir1 = Ext_string_test.split(undefined, relevant_dir1, os_path_separator_char); let dir2 = Ext_string_test.split(undefined, relevant_dir2, os_path_separator_char); let go = function (_dir1, _dir2) { - while(true) { + while (true) { let dir2 = _dir2; let dir1 = _dir1; if (dir1 && dir2 && dir1.hd === dir2.hd) { @@ -144,16 +142,16 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { })) + (node_sep + Filename.basename(file2)); } let skip = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= len) { let s = "invalid path: " + file2; throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); } let curr_char = file2.codePointAt(i); if (!(curr_char === os_path_separator_char || curr_char === /* '.' */46)) { @@ -167,7 +165,7 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { } function find_root_filename(_cwd, filename) { - while(true) { + while (true) { let cwd = _cwd; if (Caml_sys.sys_file_exists(Filename.concat(cwd, filename))) { return cwd; @@ -179,11 +177,11 @@ function find_root_filename(_cwd, filename) { } let s = filename + " not found from " + cwd; throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); }; } @@ -221,7 +219,7 @@ function combine(p1, p2) { function split_aux(p) { let _p = p; let _acc = /* [] */0; - while(true) { + while (true) { let acc = _acc; let p$1 = _p; let dir = Filename.dirname(p$1); @@ -254,7 +252,7 @@ function rel_normalized_absolute_path(from, to_) { } let _xss = match[1]; let _yss = match$1[1]; - while(true) { + while (true) { let yss = _yss; let xss = _xss; if (!xss) { @@ -291,7 +289,7 @@ function normalize_absolute_path(x) { } }; let normalize_list = function (_acc, _paths) { - while(true) { + while (true) { let paths = _paths; let acc = _acc; if (!paths) { @@ -322,7 +320,7 @@ function normalize_absolute_path(x) { if (rev_paths) { let _acc = rev_paths.hd; let _rev_paths = rev_paths.tl; - while(true) { + while (true) { let rev_paths$1 = _rev_paths; let acc = _acc; if (!rev_paths$1) { @@ -357,11 +355,11 @@ if (Sys.unix) { } else { let s = "Unknown OS : " + Sys.os_type; throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); } let $slash$slash = Filename.concat; diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index f502e1c310..34f7d88f78 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -7,7 +7,7 @@ let Caml_option = require("../../lib/js/caml_option.js"); let Ext_string_test = require("./ext_string_test.js"); function filter_map(f, _xs) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; @@ -30,7 +30,7 @@ function excludes(p, l) { contents: false }; let aux = function (_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -70,7 +70,7 @@ function exclude_with_fact(p, l) { contents: undefined }; let aux = function (_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -106,7 +106,7 @@ function exclude_with_fact2(p1, p2, l) { contents: undefined }; let aux = function (_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -141,7 +141,7 @@ function exclude_with_fact2(p1, p2, l) { } function same_length(_xs, _ys) { - while(true) { + while (true) { let ys = _ys; let xs = _xs; if (!xs) { @@ -162,7 +162,7 @@ function same_length(_xs, _ys) { function filter_mapi(f, xs) { let aux = function (_i, _xs) { - while(true) { + while (true) { let xs = _xs; let i = _i; if (!xs) { @@ -185,7 +185,7 @@ function filter_mapi(f, xs) { } function filter_map2(f, _xs, _ys) { - while(true) { + while (true) { let ys = _ys; let xs = _xs; if (xs) { @@ -204,27 +204,27 @@ function filter_map2(f, _xs, _ys) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.filter_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.filter_map2" + } + }); } if (!ys) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.filter_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.filter_map2" + } + }); }; } function filter_map2i(f, xs, ys) { let aux = function (_i, _xs, _ys) { - while(true) { + while (true) { let ys = _ys; let xs = _xs; let i = _i; @@ -245,28 +245,28 @@ function filter_map2i(f, xs, ys) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.filter_map2i" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.filter_map2i" + } + }); } if (!ys) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.filter_map2i" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.filter_map2i" + } + }); }; }; return aux(0, xs, ys); } function rev_map_append(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -285,7 +285,7 @@ function flat_map2(f, lx, ly) { let _acc = /* [] */0; let _lx = lx; let _ly = ly; - while(true) { + while (true) { let ly$1 = _ly; let lx$1 = _lx; let acc = _acc; @@ -297,26 +297,26 @@ function flat_map2(f, lx, ly) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.flat_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.flat_map2" + } + }); } if (ly$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.flat_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.flat_map2" + } + }); } return List.rev(acc); }; } function flat_map_aux(f, _acc, append, _lx) { - while(true) { + while (true) { let lx = _lx; let acc = _acc; if (!lx) { @@ -351,11 +351,11 @@ function map2_last(f, l1, l2) { } else { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2_last" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2_last" + } + }); } } if (l2) { @@ -366,21 +366,21 @@ function map2_last(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2_last" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2_last" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2_last" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2_last" + } + }); } function map_last(f, l1) { @@ -414,30 +414,30 @@ function fold_right2_last(f, l1, l2, accu) { } else { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } } if (l2) { return f(false, last1, l2.hd, fold_right2_last(f, l1$1, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } @@ -451,11 +451,11 @@ function take(n, l) { let arr_length = arr.length; if (arr_length < n) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.take" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.take" + } + }); } return [ $$Array.to_list($$Array.sub(arr, 0, n)), @@ -482,7 +482,7 @@ function try_take(n, l) { } function length_compare(_l, _n) { - while(true) { + while (true) { let n = _n; let l = _l; if (n < 0) { @@ -502,7 +502,7 @@ function length_compare(_l, _n) { } function length_larger_than_n(n, _xs, _ys) { - while(true) { + while (true) { let ys = _ys; let xs = _xs; if (!ys) { @@ -520,7 +520,7 @@ function length_larger_than_n(n, _xs, _ys) { function exclude_tail(x) { let _acc = /* [] */0; let _x = x; - while(true) { + while (true) { let x$1 = _x; let acc = _acc; if (x$1) { @@ -540,11 +540,11 @@ function exclude_tail(x) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.exclude_tail" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.exclude_tail" + } + }); }; } @@ -589,27 +589,27 @@ function stable_group(cmp, lst) { } function drop(_n, _h) { - while(true) { + while (true) { let h = _h; let n = _n; if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.drop" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.drop" + } + }); } if (n === 0) { return h; } if (h === /* [] */0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.drop" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.drop" + } + }); } _h = List.tl(h); _n = n - 1 | 0; @@ -618,7 +618,7 @@ function drop(_n, _h) { } function find_first_not(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -633,7 +633,7 @@ function find_first_not(p, _x) { } function for_all_opt(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -656,7 +656,7 @@ function fold(f, l, init) { function rev_map_acc(acc, f, l) { let _accu = acc; let _x = l; - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -691,7 +691,7 @@ function rev_iter(f, xs) { } function for_all2_no_exn(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -714,7 +714,7 @@ function for_all2_no_exn(p, _l1, _l2) { } function find_no_exn(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -729,7 +729,7 @@ function find_no_exn(p, _x) { } function find_opt(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -747,7 +747,7 @@ function split_map(f, xs) { let _bs = /* [] */0; let _cs = /* [] */0; let _xs = xs; - while(true) { + while (true) { let xs$1 = _xs; let cs = _cs; let bs = _bs; @@ -779,11 +779,11 @@ function reduce_from_right(fn, lst) { }), match.hd, match.tl); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.reduce" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.reduce" + } + }); } function reduce_from_left(fn, lst) { @@ -791,11 +791,11 @@ function reduce_from_left(fn, lst) { return List.fold_left(fn, lst.hd, lst.tl); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.reduce_from_left" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.reduce_from_left" + } + }); } function create_ref_empty() { @@ -810,11 +810,11 @@ function ref_top(x) { return match.hd; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.ref_top" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.ref_top" + } + }); } function ref_empty(x) { @@ -840,17 +840,17 @@ function ref_pop(refs) { return match.hd; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.ref_pop" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.ref_pop" + } + }); } function rev_except_last(xs) { let _acc = /* [] */0; let _xs = xs; - while(true) { + while (true) { let xs$1 = _xs; let acc = _acc; if (xs$1) { @@ -870,11 +870,11 @@ function rev_except_last(xs) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.rev_except_last" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.rev_except_last" + } + }); }; } @@ -885,7 +885,7 @@ function sort_via_array(cmp, lst) { } function last(_xs) { - while(true) { + while (true) { let xs = _xs; if (xs) { let tl = xs.tl; @@ -896,16 +896,16 @@ function last(_xs) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_list_test.last" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_list_test.last" + } + }); }; } function assoc_by_string(def, k, _lst) { - while(true) { + while (true) { let lst = _lst; if (lst) { let match = lst.hd; @@ -919,20 +919,20 @@ function assoc_by_string(def, k, _lst) { return Caml_option.valFromOption(def); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ext_list_test.res", - 472, - 14 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ext_list_test.res", + 472, + 14 + ] + } + }); }; } function assoc_by_int(def, k, _lst) { - while(true) { + while (true) { let lst = _lst; if (lst) { let match = lst.hd; @@ -946,15 +946,15 @@ function assoc_by_int(def, k, _lst) { return Caml_option.valFromOption(def); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ext_list_test.res", - 487, - 14 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ext_list_test.res", + 487, + 14 + ] + } + }); }; } diff --git a/jscomp/test/ext_pervasives_test.js b/jscomp/test/ext_pervasives_test.js index 87cf58893c..5527fdf735 100644 --- a/jscomp/test/ext_pervasives_test.js +++ b/jscomp/test/ext_pervasives_test.js @@ -9,12 +9,11 @@ function $$finally(v, action, f) { let e; try { e = f(v); - } - catch (e$1){ + } catch (e$1) { action(v); throw new Error(e$1.RE_EXN_ID, { - cause: e$1 - }); + cause: e$1 + }); } action(v); return e; @@ -25,7 +24,7 @@ function is_pos_pow(n) { try { let _c = 0; let _n = n; - while(true) { + while (true) { let n$1 = _n; let c = _c; if (n$1 <= 0) { @@ -40,20 +39,19 @@ function is_pos_pow(n) { continue; } throw new Error(E, { - cause: { - RE_EXN_ID: E - } - }); + cause: { + RE_EXN_ID: E + } + }); }; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === E) { return -1; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -62,7 +60,7 @@ function is_pos_pow_2(n) { try { let _c = 0; let _n = n; - while(true) { + while (true) { let n$1 = _n; let c = _c; if (n$1 <= 0) { @@ -77,26 +75,25 @@ function is_pos_pow_2(n) { continue; } throw new Error(E, { - cause: { - RE_EXN_ID: E - } - }); + cause: { + RE_EXN_ID: E + } + }); }; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === E) { return -1; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function hash_variant(s) { let accu = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { accu = Math.imul(223, accu) + Caml_string.get(s, i) | 0; } accu = accu & 2147483647; diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index 9939699352..c73d6f37a0 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -16,7 +16,7 @@ function split_by(keep_emptyOpt, is_delim, str) { let _acc = /* [] */0; let _last_pos = len; let _pos = len - 1 | 0; - while(true) { + while (true) { let pos = _pos; let last_pos = _last_pos; let acc = _acc; @@ -54,7 +54,7 @@ function split_by(keep_emptyOpt, is_delim, str) { function trim(s) { let i = 0; let j = s.length; - while((function () { + while ((function () { let tmp = false; if (i < j) { let u = s.codePointAt(i); @@ -65,7 +65,7 @@ function trim(s) { i = i + 1 | 0; }; let k = j - 1 | 0; - while((function () { + while ((function () { let tmp = false; if (k >= i) { let u = s.codePointAt(k); @@ -105,7 +105,7 @@ function starts_with(s, beg) { return false; } let i = 0; - while(i < beg_len && s.codePointAt(i) === beg.codePointAt(i)) { + while (i < beg_len && s.codePointAt(i) === beg.codePointAt(i)) { i = i + 1 | 0; }; return i === beg_len; @@ -119,7 +119,7 @@ function ends_with_index(s, end_) { } let _j = s_finish; let _k = s_beg; - while(true) { + while (true) { let k = _k; let j = _j; if (k < 0) { @@ -154,7 +154,7 @@ function check_any_suffix_case(s, suffixes) { function check_any_suffix_case_then_chop(s, suffixes) { let _suffixes = suffixes; - while(true) { + while (true) { let suffixes$1 = _suffixes; if (!suffixes$1) { return; @@ -170,7 +170,7 @@ function check_any_suffix_case_then_chop(s, suffixes) { function escaped(s) { let needs_escape = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= s.length) { return false; @@ -201,7 +201,7 @@ function escaped(s) { } function unsafe_for_all_range(s, _start, finish, p) { - while(true) { + while (true) { let start = _start; if (start > finish) { return true; @@ -218,11 +218,11 @@ function for_all_range(s, start, finish, p) { let len = s.length; if (start < 0 || finish >= len) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_string_test.for_all_range" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_string_test.for_all_range" + } + }); } return unsafe_for_all_range(s, start, finish, p); } @@ -238,7 +238,7 @@ function is_empty(s) { function repeat(n, s) { let len = s.length; let res = Caml_bytes.create(Math.imul(n, len)); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { $$String.blit(s, 0, res, Math.imul(i, len), len); } return Bytes.to_string(res); @@ -247,7 +247,7 @@ function repeat(n, s) { function unsafe_is_sub(sub, i, s, j, len) { if ((j + len | 0) <= s.length) { let _k = 0; - while(true) { + while (true) { let k = _k; if (k === len) { return true; @@ -271,26 +271,25 @@ function find(startOpt, sub, s) { let s_len = s.length; let i = start; try { - while((i + n | 0) <= s_len) { + while ((i + n | 0) <= s_len) { if (unsafe_is_sub(sub, 0, s, i, n)) { throw new Error(Local_exit, { - cause: { - RE_EXN_ID: Local_exit - } - }); + cause: { + RE_EXN_ID: Local_exit + } + }); } i = i + 1 | 0; }; return -1; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Local_exit) { return i; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -302,15 +301,15 @@ function non_overlap_count(sub, s) { let sub_len = sub.length; if (sub.length === 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_string_test.non_overlap_count" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_string_test.non_overlap_count" + } + }); } let _acc = 0; let _off = 0; - while(true) { + while (true) { let off = _off; let acc = _acc; let i = find(off, sub, s); @@ -327,26 +326,25 @@ function rfind(sub, s) { let n = sub.length; let i = s.length - n | 0; try { - while(i >= 0) { + while (i >= 0) { if (unsafe_is_sub(sub, 0, s, i, n)) { throw new Error(Local_exit, { - cause: { - RE_EXN_ID: Local_exit - } - }); + cause: { + RE_EXN_ID: Local_exit + } + }); } i = i - 1 | 0; }; return -1; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Local_exit) { return i; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -357,17 +355,17 @@ function tail_from(s, x) { } let s$1 = "Ext_string_test.tail_from " + (s + (" : " + String(x))); throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s$1 - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s$1 + } + }); } function digits_of_str(s, offset, x) { let _i = 0; let _acc = 0; - while(true) { + while (true) { let acc = _acc; let i = _i; if (i >= x) { @@ -387,7 +385,7 @@ function starts_with_and_number(s, offset, beg) { return -1; } let i = offset; - while(i < finish_delim && s.codePointAt(i) === beg.codePointAt(i - offset | 0)) { + while (i < finish_delim && s.codePointAt(i) === beg.codePointAt(i - offset | 0)) { i = i + 1 | 0; }; if (i === finish_delim) { @@ -402,7 +400,7 @@ function equal(x, y) { } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return i; @@ -416,7 +414,7 @@ function rindex_rec(s, _i, c) { } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -524,7 +522,7 @@ function is_valid_source_name(name) { } function unsafe_no_char(x, ch, _i, last_idx) { - while(true) { + while (true) { let i = _i; if (i > last_idx) { return true; @@ -538,7 +536,7 @@ function unsafe_no_char(x, ch, _i, last_idx) { } function unsafe_no_char_idx(x, ch, _i, last_idx) { - while(true) { + while (true) { let i = _i; if (i > last_idx) { return -1; @@ -555,11 +553,11 @@ function no_char(x, ch, i, len) { let str_len = x.length; if (i < 0 || i >= str_len || len >= str_len) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Ext_string_test.no_char" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Ext_string_test.no_char" + } + }); } return unsafe_no_char(x, ch, i, len); } diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index a8bfbe5080..dbebc62d58 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -25,15 +25,15 @@ function to_int(x) { return x._2; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "extensible_variant_test.res", - 16, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "extensible_variant_test.res", + 16, + 9 + ] + } + }); } let suites_0 = [ diff --git a/jscomp/test/fib.js b/jscomp/test/fib.js index 1bb77507c2..40074bd13e 100644 --- a/jscomp/test/fib.js +++ b/jscomp/test/fib.js @@ -14,7 +14,7 @@ function fib2(n) { let _a = 1; let _b = 1; let _i = 0; - while(true) { + while (true) { let i = _i; let b = _b; let a = _a; @@ -31,7 +31,7 @@ function fib2(n) { function fib3(n) { let a = 1; let b = 1; - for(let i = 1; i <= n; ++i){ + for (let i = 1; i <= n; ++i) { let tmp = a; a = b; b = b + tmp | 0; diff --git a/jscomp/test/flattern_order_test.js b/jscomp/test/flattern_order_test.js index f2878f47ea..f89f8bd401 100644 --- a/jscomp/test/flattern_order_test.js +++ b/jscomp/test/flattern_order_test.js @@ -3,7 +3,7 @@ function even(_n) { - while(true) { + while (true) { let n = _n; if (n === 0) { return true; diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index c2d2426b27..8ce92b71c2 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -6,15 +6,15 @@ let Caml_obj = require("../../lib/js/caml_obj.js"); let Caml_array = require("../../lib/js/caml_array.js"); function sub(_tr, _k) { - while(true) { + while (true) { let k = _k; let tr = _tr; if (typeof tr !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (k === 1) { return tr._0; @@ -41,10 +41,10 @@ function update(tr, k, w) { }; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = tr._2; let l = tr._1; @@ -77,10 +77,10 @@ function update(tr, k, w) { function $$delete(tr, n) { if (typeof tr !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (n === 1) { return "Lf"; @@ -126,10 +126,10 @@ function loext(tr, w) { function lorem(tr) { if (typeof tr !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = tr._1; if (typeof l === "object") { @@ -145,15 +145,15 @@ function lorem(tr) { return "Lf"; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "flexible_array_test.res", - 80, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "flexible_array_test.res", + 80, + 9 + ] + } + }); } let empty = [ @@ -170,11 +170,11 @@ function get(param, i) { return sub(param[0], i + 1 | 0); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.get" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.get" + } + }); } function set(param, i, v) { @@ -186,11 +186,11 @@ function set(param, i, v) { ]; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.set" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.set" + } + }); } function push_front(param, v) { @@ -209,11 +209,11 @@ function pop_front(param) { ]; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.pop_front" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.pop_front" + } + }); } function push_back(param, v) { @@ -233,16 +233,16 @@ function pop_back(param) { ]; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.pop_back" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.pop_back" + } + }); } function filter_from(i, p, s) { let u = empty; - for(let i$1 = i ,i_finish = length(s); i$1 < i_finish; ++i$1){ + for (let i$1 = i, i_finish = length(s); i$1 < i_finish; ++i$1) { let ele = get(s, i$1); if (p(ele)) { u = push_back(u, ele); @@ -254,10 +254,10 @@ function filter_from(i, p, s) { function append(a, b) { let empty$1 = empty; - for(let i = 0 ,i_finish = length(a); i < i_finish; ++i){ + for (let i = 0, i_finish = length(a); i < i_finish; ++i) { empty$1 = push_back(empty$1, get(a, i)); } - for(let i$1 = 0 ,i_finish$1 = length(b); i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = length(b); i$1 < i_finish$1; ++i$1) { empty$1 = push_back(empty$1, get(b, i$1)); } return empty$1; @@ -280,7 +280,7 @@ function sort(s) { function of_array(arr) { let v = empty; - for(let i = 0 ,i_finish = arr.length; i < i_finish; ++i){ + for (let i = 0, i_finish = arr.length; i < i_finish; ++i) { v = push_back(v, Caml_array.get(arr, i)); } return v; @@ -324,15 +324,15 @@ if (!$eq$tilde(sort(u), [ 6 ])) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "flexible_array_test.res", - 184, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "flexible_array_test.res", + 184, + 2 + ] + } + }); } let v = $$Array.init(500, (function (i) { diff --git a/jscomp/test/floatarray_test.js b/jscomp/test/floatarray_test.js index bc248ec6d9..1a799f592d 100644 --- a/jscomp/test/floatarray_test.js +++ b/jscomp/test/floatarray_test.js @@ -18,7 +18,7 @@ function eq(loc, x, y) { let v = Caml_array.make_float(5); -for(let i = 0; i <= 4; ++i){ +for (let i = 0; i <= 4; ++i) { v[i] = 0; } diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 167938029a..55b6cf0e27 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -14,7 +14,7 @@ function for_3(x) { }; }), x); - for(let i = 0 ,i_finish = x.length; i < i_finish; ++i){ + for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); Caml_array.set(arr, i, (function () { v.contents = v.contents + j | 0; @@ -35,7 +35,7 @@ function for_4(x) { }; }), x); - for(let i = 0 ,i_finish = x.length; i < i_finish; ++i){ + for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); let k = (j << 1); Caml_array.set(arr, i, (function () { @@ -57,7 +57,7 @@ function for_5(x, u) { }; }), x); - for(let i = 0 ,i_finish = x.length; i < i_finish; ++i){ + for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = Math.imul((u << 1), u); Caml_array.set(arr, i, (function () { v.contents = v.contents + k | 0; @@ -86,12 +86,12 @@ function for_6(x, u) { }; let inspect_3 = -1; v4.contents = v4.contents + 1 | 0; - for(let j = 0; j <= 1; ++j){ + for (let j = 0; j <= 1; ++j) { v5.contents = v5.contents + 1 | 0; let v2 = { contents: 0 }; - for(let i = 0 ,i_finish = x.length; i < i_finish; ++i){ + for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; @@ -119,8 +119,8 @@ function for_7() { let arr = Caml_array.make(21, (function () { })); - for(let i = 0; i <= 6; ++i){ - for(let j = 0; j <= 2; ++j){ + for (let i = 0; i <= 6; ++i) { + for (let j = 0; j <= 2; ++j) { Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function () { v.contents = (v.contents + i | 0) + j | 0; })); @@ -139,9 +139,9 @@ function for_8() { let arr = Caml_array.make(21, (function () { })); - for(let i = 0; i <= 6; ++i){ + for (let i = 0; i <= 6; ++i) { let k = (i << 1); - for(let j = 0; j <= 2; ++j){ + for (let j = 0; j <= 2; ++j) { let h = i + j | 0; Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function () { v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; @@ -176,12 +176,12 @@ function for_9() { let arr2 = Caml_array.make(2, (function () { })); - for(let i = 0; i <= 1; ++i){ + for (let i = 0; i <= 1; ++i) { let v$1 = { contents: 0 }; v$1.contents = v$1.contents + i | 0; - for(let j = 0; j <= 1; ++j){ + for (let j = 0; j <= 1; ++j) { v$1.contents = v$1.contents + 1 | 0; collect(v$1.contents); Caml_array.set(arr, (i << 1) + j | 0, (function () { diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 0a047d4d17..ad61a8bb8d 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -4,7 +4,7 @@ let Mt = require("./mt.js"); function tst() { - for(let i = (console.log("hi"), 0) ,i_finish = (console.log("hello"), 3); i <= i_finish; ++i){ + for (let i = (console.log("hi"), 0), i_finish = (console.log("hello"), 3); i <= i_finish; ++i) { } } @@ -13,7 +13,7 @@ function test2() { let v = 0; v = 3; v = 10; - for(let i = 0; i <= 1; ++i){ + for (let i = 0; i <= 1; ++i) { } return v; diff --git a/jscomp/test/format_regression.js b/jscomp/test/format_regression.js index 6af98ac543..c89043c8cd 100644 --- a/jscomp/test/format_regression.js +++ b/jscomp/test/format_regression.js @@ -4,58 +4,58 @@ function peek_queue(param) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "format_regression.res", - 10, - 22 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "format_regression.res", + 10, + 22 + ] + } + }); } function int_of_size(param) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "format_regression.res", - 11, - 23 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "format_regression.res", + 11, + 23 + ] + } + }); } function take_queue(param) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "format_regression.res", - 12, - 22 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "format_regression.res", + 12, + 22 + ] + } + }); } function format_pp_token(param, param$1, param$2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "format_regression.res", - 13, - 35 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "format_regression.res", + 13, + 35 + ] + } + }); } function advance_loop(state) { - while(true) { + while (true) { let match = peek_queue(state.pp_queue); let size = match.elem_size; let size$1 = int_of_size(size); diff --git a/jscomp/test/fun_pattern_match.js b/jscomp/test/fun_pattern_match.js index a7f1adbd17..e2cab8232f 100644 --- a/jscomp/test/fun_pattern_match.js +++ b/jscomp/test/fun_pattern_match.js @@ -23,15 +23,15 @@ function f3(param, param$1) { rhs === "Uninitialized"; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "fun_pattern_match.res", - 33, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "fun_pattern_match.res", + 33, + 9 + ] + } + }); } function f4(param, param$1) { @@ -46,15 +46,15 @@ function f4(param, param$1) { rhs === "Uninitialized"; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "fun_pattern_match.res", - 39, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "fun_pattern_match.res", + 39, + 9 + ] + } + }); } let x = { diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 7e3df94193..0638104f8c 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -35,20 +35,19 @@ let lexer = Genlex.make_lexer({ function to_list(s) { let _acc = /* [] */0; - while(true) { + while (true) { let acc = _acc; let v; try { v = Stream.next(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stream.Failure) { return List.rev(acc); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } _acc = { hd: v, diff --git a/jscomp/test/gpr_1150.js b/jscomp/test/gpr_1150.js index 82b56b2d74..d8286103da 100644 --- a/jscomp/test/gpr_1150.js +++ b/jscomp/test/gpr_1150.js @@ -216,15 +216,15 @@ function f(children) { } if (children$15.tl) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_1150.res", - 100, - 62 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_1150.res", + 100, + 62 + ] + } + }); } return [ a0, diff --git a/jscomp/test/gpr_1245_test.js b/jscomp/test/gpr_1245_test.js index 3ad00c8c05..e1e0e9044b 100644 --- a/jscomp/test/gpr_1245_test.js +++ b/jscomp/test/gpr_1245_test.js @@ -41,15 +41,14 @@ function a1(f) { let E = /* @__PURE__ */Caml_exceptions.create("E"); try { return f(); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === E) { return 1; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/gpr_1438.js b/jscomp/test/gpr_1438.js index 1007c0d56d..9d8750c886 100644 --- a/jscomp/test/gpr_1438.js +++ b/jscomp/test/gpr_1438.js @@ -5,18 +5,16 @@ function actionKey(key, a, b, c, d, e) { switch (key) { case 98 : - return c; + return c; case 106 : - return d; + return d; case 107 : - return e; + return e; case 116 : - return b; + return b; case 99 : case 118 : - return a; - default: - + return a; } return function (param) { diff --git a/jscomp/test/gpr_1698_test.js b/jscomp/test/gpr_1698_test.js index 65b7394091..70186a2079 100644 --- a/jscomp/test/gpr_1698_test.js +++ b/jscomp/test/gpr_1698_test.js @@ -3,30 +3,29 @@ function is_number(_expr) { - while(true) { + while (true) { let expr = _expr; switch (expr.TAG) { case "Val" : - if (expr._0.TAG === "Natural") { - return true; - } else { - return false; - } + if (expr._0.TAG === "Natural") { + return true; + } else { + return false; + } case "Neg" : - _expr = expr._0; - continue; + _expr = expr._0; + continue; case "Sum" : case "Pow" : case "Frac" : case "Gcd" : - return false; - + return false; } }; } function compare(context, state, _a, _b) { - while(true) { + while (true) { let b = _b; let a = _a; let exit = 0; @@ -39,93 +38,90 @@ function compare(context, state, _a, _b) { let exit$3 = 0; switch (a.TAG) { case "Val" : - switch (b.TAG) { - case "Val" : - return 111; - case "Neg" : - exit$3 = 5; - break; - case "Sum" : - exit$2 = 4; - break; - case "Frac" : - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_1698_test.res", - 41, - 9 - ] - } - }); - case "Pow" : - case "Gcd" : - exit = 1; - break; - - } - break; + switch (b.TAG) { + case "Val" : + return 111; + case "Neg" : + exit$3 = 5; + break; + case "Sum" : + exit$2 = 4; + break; + case "Frac" : + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_1698_test.res", + 41, + 9 + ] + } + }); + case "Pow" : + case "Gcd" : + exit = 1; + break; + } + break; case "Neg" : - _a = a._0; - continue; + _a = a._0; + continue; case "Sum" : case "Pow" : - exit$3 = 5; - break; + exit$3 = 5; + break; case "Frac" : - switch (b.TAG) { - case "Val" : - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_1698_test.res", - 41, - 9 - ] - } - }); - case "Neg" : - exit$3 = 5; - break; - case "Sum" : - exit$2 = 4; - break; - case "Frac" : - na = a._0; - da = a._1; - nb = b._0; - db = b._1; - exit = 2; - break; - case "Pow" : - case "Gcd" : - exit = 1; - break; - - } - break; + switch (b.TAG) { + case "Val" : + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_1698_test.res", + 41, + 9 + ] + } + }); + case "Neg" : + exit$3 = 5; + break; + case "Sum" : + exit$2 = 4; + break; + case "Frac" : + na = a._0; + da = a._1; + nb = b._0; + db = b._1; + exit = 2; + break; + case "Pow" : + case "Gcd" : + exit = 1; + break; + } + break; case "Gcd" : - switch (b.TAG) { - case "Neg" : - exit$3 = 5; - break; - case "Sum" : - exit$2 = 4; - break; - case "Gcd" : - na = a._0; - da = a._1; - nb = b._0; - db = b._1; - exit = 2; - break; - default: - exit$1 = 3; - } - break; - + switch (b.TAG) { + case "Neg" : + exit$3 = 5; + break; + case "Sum" : + exit$2 = 4; + break; + case "Gcd" : + na = a._0; + da = a._1; + nb = b._0; + db = b._1; + exit = 2; + break; + default: + exit$1 = 3; + } + break; } if (exit$3 === 5) { if (b.TAG === "Neg") { @@ -154,34 +150,32 @@ function compare(context, state, _a, _b) { if (exit$1 === 3) { switch (a.TAG) { case "Sum" : - exit = 1; - break; + exit = 1; + break; case "Pow" : - return -1; + return -1; case "Val" : case "Frac" : case "Gcd" : - return 1; - + return 1; } } switch (exit) { case 1 : - switch (b.TAG) { - case "Pow" : - return 1; - default: - return -1; - } + switch (b.TAG) { + case "Pow" : + return 1; + default: + return -1; + } case 2 : - let denom = compare(context, state, da, db); - if (denom !== 0) { - return denom; - } - _b = nb; - _a = na; - continue; - + let denom = compare(context, state, da, db); + if (denom !== 0) { + return denom; + } + _b = nb; + _a = na; + continue; } }; } diff --git a/jscomp/test/gpr_1701_test.js b/jscomp/test/gpr_1701_test.js index e122b7c346..81226bbfca 100644 --- a/jscomp/test/gpr_1701_test.js +++ b/jscomp/test/gpr_1701_test.js @@ -10,22 +10,21 @@ let Foo = /* @__PURE__ */Caml_exceptions.create("Gpr_1701_test.Foo"); function test(n) { if (n === 0) { throw new Error(Foo, { - cause: { - RE_EXN_ID: Foo - } - }); + cause: { + RE_EXN_ID: Foo + } + }); } try { return test(n - 1 | 0); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Foo) { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -33,20 +32,19 @@ test(100); function read_lines(inc) { let _acc = /* [] */0; - while(true) { + while (true) { let acc = _acc; let l; try { l = input_line(inc); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "End_of_file") { l = undefined; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } if (l === undefined) { @@ -62,20 +60,19 @@ function read_lines(inc) { function read_lines2(inc) { let _acc = /* [] */0; - while(true) { + while (true) { let acc = _acc; let l; try { l = input_line(inc); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "End_of_file") { return List.rev(acc); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } _acc = { hd: l, @@ -93,15 +90,14 @@ function read_lines3(inc) { hd: l, tl: acc }); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "End_of_file") { return List.rev(acc); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; return loop(/* [] */0); @@ -110,8 +106,7 @@ function read_lines3(inc) { function fff(f, x) { try { return fff(f, x); - } - catch (exn){ + } catch (exn) { return x + 1 | 0; } } diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index e5a68ca3a2..070945f187 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -35,8 +35,7 @@ let a0; try { Caml_int32.div(0, 0); a0 = 0; -} -catch (exn){ +} catch (exn) { a0 = 1; } @@ -45,8 +44,7 @@ let a1; try { Caml_int32.mod_(0, 0); a1 = 0; -} -catch (exn$1){ +} catch (exn$1) { a1 = 1; } @@ -55,8 +53,7 @@ let a4; try { Caml_int32.div(0, 0); a4 = 0; -} -catch (exn$2){ +} catch (exn$2) { a4 = 1; } @@ -65,8 +62,7 @@ let a5; try { Caml_int32.mod_(0, 0); a5 = 0; -} -catch (exn$3){ +} catch (exn$3) { a5 = 1; } @@ -75,8 +71,7 @@ let a6; try { Caml_int64.div(Caml_int64.zero, Caml_int64.zero); a6 = 0; -} -catch (exn$4){ +} catch (exn$4) { a6 = 1; } @@ -85,8 +80,7 @@ let a7; try { Caml_int64.mod_(Caml_int64.zero, Caml_int64.zero); a7 = 0; -} -catch (exn$5){ +} catch (exn$5) { a7 = 1; } diff --git a/jscomp/test/gpr_1946_test.js b/jscomp/test/gpr_1946_test.js index 69de7169e9..f57d17a937 100644 --- a/jscomp/test/gpr_1946_test.js +++ b/jscomp/test/gpr_1946_test.js @@ -30,7 +30,7 @@ let h = { }; function f(id) { - while(false) { + while (false) { }; return id; diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index 6d6b817ecd..9740acfc1a 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -33,20 +33,19 @@ let y; try { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "boo" - } - }); -} -catch (raw_msg){ + cause: { + RE_EXN_ID: "Failure", + _1: "boo" + } + }); +} catch (raw_msg) { let msg = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg.RE_EXN_ID === "Failure") { y = msg._1; } else { throw new Error(msg.RE_EXN_ID, { - cause: msg - }); + cause: msg + }); } } @@ -56,20 +55,19 @@ let exit = 0; try { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "boo" - } - }); -} -catch (raw_msg$1){ + cause: { + RE_EXN_ID: "Failure", + _1: "boo" + } + }); +} catch (raw_msg$1) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg$1); if (msg$1.RE_EXN_ID === "Failure") { x = msg$1._1; } else { throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } diff --git a/jscomp/test/gpr_2413_test.js b/jscomp/test/gpr_2413_test.js index bd7a3f24c9..02d6c20738 100644 --- a/jscomp/test/gpr_2413_test.js +++ b/jscomp/test/gpr_2413_test.js @@ -5,17 +5,16 @@ function f(x) { switch (x.TAG) { case "A" : - let a = x._0; - if (a.TAG === "P") { - let a$1 = a._0; - return a$1 + a$1 | 0; - } - let a$2 = a._0; - return a$2 - a$2 | 0; + let a = x._0; + if (a.TAG === "P") { + let a$1 = a._0; + return a$1 + a$1 | 0; + } + let a$2 = a._0; + return a$2 - a$2 | 0; case "B" : case "C" : - break; - + break; } let a$3 = x._0._0; return Math.imul(a$3, a$3); diff --git a/jscomp/test/gpr_2642_test.js b/jscomp/test/gpr_2642_test.js index 8ba0039e05..1d5d3b9b66 100644 --- a/jscomp/test/gpr_2642_test.js +++ b/jscomp/test/gpr_2642_test.js @@ -3,21 +3,20 @@ function isfree(id, _x) { - while(true) { + while (true) { let x = _x; switch (x.TAG) { case "Pident" : - return id === x._0; + return id === x._0; case "Pdot" : - _x = x._0; - continue; + _x = x._0; + continue; case "Papply" : - if (isfree(id, x._0)) { - return true; - } - _x = x._1; - continue; - + if (isfree(id, x._0)) { + return true; + } + _x = x._1; + continue; } }; } diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index c7fceff492..9cad19d945 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -47,15 +47,15 @@ let bbbb = f3(); if (!bbbb) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_2682_test.res", - 52, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_2682_test.res", + 52, + 0 + ] + } + }); } exports.sum = sum; diff --git a/jscomp/test/gpr_2931_test.js b/jscomp/test/gpr_2931_test.js index 4061622889..a5746e30eb 100644 --- a/jscomp/test/gpr_2931_test.js +++ b/jscomp/test/gpr_2931_test.js @@ -18,16 +18,14 @@ function eq(loc, x, y) { function fake_c2(a_type, b_type) { switch (a_type) { case "number" : - if (b_type === "number") { - return 33; - } - break; + if (b_type === "number") { + return 33; + } + break; case "string" : - return 1; + return 1; case "undefined" : - return -1; - default: - + return -1; } if (b_type === "undefined") { return 1; diff --git a/jscomp/test/gpr_3209_test.js b/jscomp/test/gpr_3209_test.js index 170f470e27..8351c2e193 100644 --- a/jscomp/test/gpr_3209_test.js +++ b/jscomp/test/gpr_3209_test.js @@ -8,7 +8,7 @@ function f9(x) { case "T60" : case "T61" : case "T62" : - return 1; + return 1; default: return 3; } @@ -16,7 +16,7 @@ function f9(x) { switch (x.TAG) { case "T64" : case "T65" : - return 2; + return 2; default: return 3; } diff --git a/jscomp/test/gpr_3697_test.js b/jscomp/test/gpr_3697_test.js index 884b7b1a50..4e52d927dc 100644 --- a/jscomp/test/gpr_3697_test.js +++ b/jscomp/test/gpr_3697_test.js @@ -13,7 +13,7 @@ function fix() { } function unfixLeak(_f) { - while(true) { + while (true) { let f = _f; _f = CamlinternalLazy.force(f._0); continue; @@ -21,7 +21,7 @@ function unfixLeak(_f) { } function unfix(p) { - while(true) { + while (true) { let h = p.contents; p.contents = CamlinternalLazy.force(h._0); }; diff --git a/jscomp/test/gpr_3877_test.js b/jscomp/test/gpr_3877_test.js index ee26bf3c5e..2e8759406b 100644 --- a/jscomp/test/gpr_3877_test.js +++ b/jscomp/test/gpr_3877_test.js @@ -22,28 +22,28 @@ let b = "bad response"; if (a !== "good response") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_3877_test.res", - 26, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_3877_test.res", + 26, + 0 + ] + } + }); } if (b !== "bad response") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_3877_test.res", - 27, - 0 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_3877_test.res", + 27, + 0 + ] + } + }); } exports.test = test; diff --git a/jscomp/test/gpr_3980_test.js b/jscomp/test/gpr_3980_test.js index b0de4b2bef..3509224e47 100644 --- a/jscomp/test/gpr_3980_test.js +++ b/jscomp/test/gpr_3980_test.js @@ -8,44 +8,44 @@ let match = 1; if (match !== undefined) { if (match !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_3980_test.res", - 15, - 7 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_3980_test.res", + 15, + 7 + ] + } + }); } let match$1 = 1; if (match$1 !== 1) { if (match$1 !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_3980_test.res", - 13, - 9 - ] - } - }); - } - Js_math.floor(1); - } - -} else { - throw new Error("Assert_failure", { cause: { RE_EXN_ID: "Assert_failure", _1: [ "gpr_3980_test.res", - 15, - 7 + 13, + 9 ] } }); + } + Js_math.floor(1); + } + +} else { + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_3980_test.res", + 15, + 7 + ] + } + }); } /* Not a pure module */ diff --git a/jscomp/test/gpr_405_test.js b/jscomp/test/gpr_405_test.js index de96727ae0..fc7a5c6494 100644 --- a/jscomp/test/gpr_405_test.js +++ b/jscomp/test/gpr_405_test.js @@ -14,15 +14,14 @@ function Make(funarg) { let find_default = function (htbl, x) { try { return H.find(htbl, x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; let min_cutset = function (gr, first_node) { @@ -39,27 +38,27 @@ function Make(funarg) { let step2 = function (top, rest_of_stack) { if (find_default(already_processed, top)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_405_test.res", - 40, - 6 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_405_test.res", + 40, + 6 + ] + } + }); } if (find_default(on_the_stack, top)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_405_test.res", - 41, - 6 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_405_test.res", + 41, + 6 + ] + } + }); } H.add(on_the_stack, top, true); H.add(n_labels, top, counter.contents); @@ -69,7 +68,7 @@ function Make(funarg) { let _successors = funarg.succ(gr, top); let _top = top; let _rest_of_stack = rest_of_stack; - while(true) { + while (true) { let rest_of_stack$1 = _rest_of_stack; let top$1 = _top; let successors = _successors; @@ -98,11 +97,11 @@ function Make(funarg) { } if (H.find(l_labels, top$1) > H.find(n_labels, top$1)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Graph.Mincut: graph not reducible" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Graph.Mincut: graph not reducible" + } + }); } if (!rest_of_stack$1) { return cut_set.contents; diff --git a/jscomp/test/gpr_4069_test.js b/jscomp/test/gpr_4069_test.js index 6f99c9ae1b..2bfd0e23e8 100644 --- a/jscomp/test/gpr_4069_test.js +++ b/jscomp/test/gpr_4069_test.js @@ -14,11 +14,11 @@ function fxx(v) { let match = v(); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'd' */100; } diff --git a/jscomp/test/gpr_4280_test.js b/jscomp/test/gpr_4280_test.js index 216ce2193d..ace40e3643 100644 --- a/jscomp/test/gpr_4280_test.js +++ b/jscomp/test/gpr_4280_test.js @@ -20,14 +20,14 @@ let u = { }; function div(children, param) { - for(let i = 0; i <= 1; ++i){ + for (let i = 0; i <= 1; ++i) { u.contents = 300; console.log("nonline"); } } function string(s) { - for(let i = 0; i <= 1; ++i){ + for (let i = 0; i <= 1; ++i) { u.contents = 200; console.log("no"); } diff --git a/jscomp/test/gpr_4632.js b/jscomp/test/gpr_4632.js index 070edd1752..ec0408651d 100644 --- a/jscomp/test/gpr_4632.js +++ b/jscomp/test/gpr_4632.js @@ -22,15 +22,15 @@ let T0 = { }; throw new Error("Match_failure", { - cause: { - RE_EXN_ID: "Match_failure", - _1: [ - "gpr_4632.res", - 12, - 6 - ] - } - }); + cause: { + RE_EXN_ID: "Match_failure", + _1: [ + "gpr_4632.res", + 12, + 6 + ] + } +}); exports.T0 = T0; exports.T1 = T1; diff --git a/jscomp/test/gpr_4639_test.js b/jscomp/test/gpr_4639_test.js index 410c13daeb..881fe37bf2 100644 --- a/jscomp/test/gpr_4639_test.js +++ b/jscomp/test/gpr_4639_test.js @@ -8,13 +8,13 @@ function x(url) { } switch (url.hd) { case "login" : - if (url.tl) { - return "start"; - } else { - return "login"; - } - case "start" : + if (url.tl) { return "start"; + } else { + return "login"; + } + case "start" : + return "start"; default: return "start"; } diff --git a/jscomp/test/gpr_5557.js b/jscomp/test/gpr_5557.js index 550804df76..0ca3201b67 100644 --- a/jscomp/test/gpr_5557.js +++ b/jscomp/test/gpr_5557.js @@ -7,15 +7,15 @@ function isA(c) { return true; } throw new Error("Match_failure", { - cause: { - RE_EXN_ID: "Match_failure", - _1: [ - "gpr_5557.res", - 5, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Match_failure", + _1: [ + "gpr_5557.res", + 5, + 2 + ] + } + }); } let h = /* 'a' */97; diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index 5a84b19c17..ce8f9934ef 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -8,7 +8,7 @@ let delayed = { }) }; -for(let i = 1; i <= 2; ++i){ +for (let i = 1; i <= 2; ++i) { let f = function (n, x) { if (x !== 0) { let prev = delayed.contents; @@ -22,15 +22,15 @@ for(let i = 1; i <= 2; ++i){ return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_858_unit2_test.res", - 6, - 13 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_858_unit2_test.res", + 6, + 13 + ] + } + }); }; f(0, i); } diff --git a/jscomp/test/gpr_974_test.js b/jscomp/test/gpr_974_test.js index ad28504aef..0c7ede290d 100644 --- a/jscomp/test/gpr_974_test.js +++ b/jscomp/test/gpr_974_test.js @@ -6,41 +6,41 @@ let Caml_option = require("../../lib/js/caml_option.js"); if (!Caml_obj.equal(Caml_option.nullable_to_opt(""), "")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_974_test.res", - 2, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_974_test.res", + 2, + 2 + ] + } + }); } if (!Caml_obj.equal(Caml_option.undefined_to_opt(""), "")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_974_test.res", - 3, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_974_test.res", + 3, + 2 + ] + } + }); } if (!Caml_obj.equal(Caml_option.null_to_opt(""), "")) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "gpr_974_test.res", - 4, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "gpr_974_test.res", + 4, + 2 + ] + } + }); } /* Not a pure module */ diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index b8056514fd..46834c894a 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -30,14 +30,14 @@ function eq(loc, x, y) { } function f(x) { - for(let i = 0; i <= 100; ++i){ + for (let i = 0; i <= 100; ++i) { console.log("."); } return -x | 0; } function int32_f(x) { - for(let i = 0; i <= 100; ++i){ + for (let i = 0; i <= 100; ++i) { console.log("."); } return -x | 0; diff --git a/jscomp/test/gray_code_test.js b/jscomp/test/gray_code_test.js index 0a570823d7..1e3a14edcd 100644 --- a/jscomp/test/gray_code_test.js +++ b/jscomp/test/gray_code_test.js @@ -11,7 +11,7 @@ function gray_encode(b) { function gray_decode(n) { let _p = n; let _n = (n >>> 1); - while(true) { + while (true) { let n$1 = _n; let p = _p; if (n$1 === 0) { @@ -27,7 +27,7 @@ function bool_string(len, n) { let s = Bytes.make(len, /* '0' */48); let _i = len - 1 | 0; let _n = n; - while(true) { + while (true) { let n$1 = _n; let i = _i; if ((n$1 & 1) === 1) { diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index 979cf206eb..c772bd678d 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -32,10 +32,10 @@ function f() { function g(count) { let tbl = Hashtbl.create(undefined, 17); - for(let i = 0; i <= count; ++i){ + for (let i = 0; i <= count; ++i) { Hashtbl.replace(tbl, (i << 1), String(i)); } - for(let i$1 = 0; i$1 <= count; ++i$1){ + for (let i$1 = 0; i$1 <= count; ++i$1) { Hashtbl.replace(tbl, (i$1 << 1), String(i$1)); } let v = to_list(tbl); diff --git a/jscomp/test/inline_edge_cases.js b/jscomp/test/inline_edge_cases.js index 1f00a2cd36..8631edf009 100644 --- a/jscomp/test/inline_edge_cases.js +++ b/jscomp/test/inline_edge_cases.js @@ -3,7 +3,7 @@ function test3(_n) { - while(true) { + while (true) { let n = _n; if (n === 0) { return (n + 5 | 0) + 4 | 0; @@ -14,7 +14,7 @@ function test3(_n) { } function test2(_n) { - while(true) { + while (true) { let n = _n; if (n === 0) { return test3(n) + 3 | 0; @@ -25,11 +25,11 @@ function test2(_n) { } function test0(_n) { - while(true) { + while (true) { let n = _n; if (n === 0) { let _n$1 = n; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 === 0) { return test2(n$1) + 2 | 0; diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index cbf6192f59..8acb03a28d 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -44,11 +44,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l._3; let ld = l._2; @@ -61,11 +61,11 @@ function Make(Ord) { return create(create(ll, lv, ld, lr._0), lr._1, lr._2, create(lr._3, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -79,11 +79,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r._3; let rd = r._2; @@ -96,11 +96,11 @@ function Make(Ord) { return create(create(l, x, d, rl._0), rl._1, rl._2, create(rl._3, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (x) { if (typeof x !== "object") { @@ -141,14 +141,14 @@ function Make(Ord) { } }; let find = function (x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Ord.compare(x, x_._1); if (c === 0) { @@ -159,7 +159,7 @@ function Make(Ord) { }; }; let mem = function (x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -173,14 +173,14 @@ function Make(Ord) { }; }; let min_binding = function (_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -194,14 +194,14 @@ function Make(Ord) { }; }; let max_binding = function (_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = x._3; if (typeof r !== "object") { @@ -217,11 +217,11 @@ function Make(Ord) { let remove_min_binding = function (x) { if (typeof x !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -255,7 +255,7 @@ function Make(Ord) { } }; let iter = function (f, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return; @@ -300,7 +300,7 @@ function Make(Ord) { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -312,7 +312,7 @@ function Make(Ord) { }; }; let for_all = function (p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return true; @@ -328,7 +328,7 @@ function Make(Ord) { }; }; let exists = function (p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; @@ -442,15 +442,15 @@ function Make(Ord) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map2_test.res", - 359, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map2_test.res", + 359, + 11 + ] + } + }); } let v2 = s2._1; let match$1 = split(v2, s1); @@ -500,7 +500,7 @@ function Make(Ord) { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -520,7 +520,7 @@ function Make(Ord) { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -549,7 +549,7 @@ function Make(Ord) { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -581,7 +581,7 @@ function Make(Ord) { } }; let bindings_aux = function (_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (typeof x !== "object") { @@ -680,11 +680,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l._3; let ld = l._2; @@ -697,11 +697,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr._0), lr._1, lr._2, create(lr._3, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -715,11 +715,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r._3; let rd = r._2; @@ -732,11 +732,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl._0), rl._1, rl._2, create(rl._3, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty(x) { @@ -780,14 +780,14 @@ function add(x, data, x_) { } function find(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, x_._1); if (c === 0) { @@ -799,7 +799,7 @@ function find(x, _x_) { } function mem(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -814,14 +814,14 @@ function mem(x, _x_) { } function min_binding(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -836,14 +836,14 @@ function min_binding(_x) { } function max_binding(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = x._3; if (typeof r !== "object") { @@ -860,11 +860,11 @@ function max_binding(_x) { function remove_min_binding(x) { if (typeof x !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -900,7 +900,7 @@ function remove(x, x_) { } function iter(f, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return; @@ -948,7 +948,7 @@ function mapi(f, x) { } function fold(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -961,7 +961,7 @@ function fold(f, _m, _accu) { } function for_all(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return true; @@ -978,7 +978,7 @@ function for_all(p, _x) { } function exists(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; @@ -1099,15 +1099,15 @@ function merge(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map2_test.res", - 359, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map2_test.res", + 359, + 11 + ] + } + }); } let v2 = s2._1; let match$1 = split(v2, s1); @@ -1160,7 +1160,7 @@ function partition(p, x) { } function cons_enum(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -1181,7 +1181,7 @@ function cons_enum(_m, _e) { function compare(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1211,7 +1211,7 @@ function compare(cmp, m1, m2) { function equal(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1245,7 +1245,7 @@ function cardinal(x) { } function bindings_aux(_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (typeof x !== "object") { @@ -1373,11 +1373,11 @@ function bal$1(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l._3; let ld = l._2; @@ -1390,11 +1390,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(ll, lv, ld, lr._0), lr._1, lr._2, create$1(lr._3, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -1408,11 +1408,11 @@ function bal$1(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r._3; let rd = r._2; @@ -1425,11 +1425,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(l, x, d, rl._0), rl._1, rl._2, create$1(rl._3, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty$1(x) { @@ -1473,14 +1473,14 @@ function add$1(x, data, x_) { } function find$1(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.string_compare(x, x_._1); if (c === 0) { @@ -1492,7 +1492,7 @@ function find$1(x, _x_) { } function mem$1(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -1507,14 +1507,14 @@ function mem$1(x, _x_) { } function min_binding$1(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -1529,14 +1529,14 @@ function min_binding$1(_x) { } function max_binding$1(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = x._3; if (typeof r !== "object") { @@ -1553,11 +1553,11 @@ function max_binding$1(_x) { function remove_min_binding$1(x) { if (typeof x !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -1593,7 +1593,7 @@ function remove$1(x, x_) { } function iter$1(f, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return; @@ -1641,7 +1641,7 @@ function mapi$1(f, x) { } function fold$1(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -1654,7 +1654,7 @@ function fold$1(f, _m, _accu) { } function for_all$1(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return true; @@ -1671,7 +1671,7 @@ function for_all$1(p, _x) { } function exists$1(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; @@ -1792,15 +1792,15 @@ function merge$1(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map2_test.res", - 359, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map2_test.res", + 359, + 11 + ] + } + }); } let v2 = s2._1; let match$1 = split$1(v2, s1); @@ -1853,7 +1853,7 @@ function partition$1(p, x) { } function cons_enum$1(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -1874,7 +1874,7 @@ function cons_enum$1(_m, _e) { function compare$1(cmp, m1, m2) { let _e1 = cons_enum$1(m1, "End"); let _e2 = cons_enum$1(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1904,7 +1904,7 @@ function compare$1(cmp, m1, m2) { function equal$1(cmp, m1, m2) { let _e1 = cons_enum$1(m1, "End"); let _e2 = cons_enum$1(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1938,7 +1938,7 @@ function cardinal$1(x) { } function bindings_aux$1(_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (typeof x !== "object") { diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index f79ef8e5ea..842d8a800a 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -34,15 +34,15 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map_demo.res", - 41, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map_demo.res", + 41, + 15 + ] + } + }); } let lr = l._3; let ld = l._2; @@ -55,15 +55,15 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr._0), lr._1, lr._2, create(lr._3, x, d, r)); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map_demo.res", - 47, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map_demo.res", + 47, + 19 + ] + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -77,15 +77,15 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map_demo.res", - 55, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map_demo.res", + 55, + 15 + ] + } + }); } let rr = r._3; let rd = r._2; @@ -98,15 +98,15 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl._0), rl._1, rl._2, create(rl._3, rv, rd, rr)); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_map_demo.res", - 61, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_map_demo.res", + 61, + 19 + ] + } + }); } function add(x, data, tree) { @@ -170,14 +170,14 @@ let m = List.fold_left((function (acc, param) { }); function find(px, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(px, x._1); if (c === 0) { diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 8c9c73ae01..1a2655903f 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -34,11 +34,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l._3; let ld = l._2; @@ -51,11 +51,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr._0), lr._1, lr._2, create(lr._3, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -69,11 +69,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r._3; let rd = r._2; @@ -86,11 +86,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl._0), rl._1, rl._2, create(rl._3, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, x_) { @@ -126,14 +126,14 @@ function add(x, data, x_) { } function find(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, x_._1); if (c === 0) { diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index a9a339501c..28e795d78f 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -68,15 +68,15 @@ if (A0 === A0) { tmp = 3; } else { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_record_test.res", - 47, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_record_test.res", + 47, + 9 + ] + } + }); } eq("File \"inline_record_test.res\", line 44, characters 2-9", tmp, 3); @@ -101,7 +101,7 @@ let v5 = { z: 0 }; -for(let i = 0; i <= 10; ++i){ +for (let i = 0; i <= 10; ++i) { ff(v4); ff(v5); } @@ -112,15 +112,15 @@ if (v4.TAG === "A0") { tmp$1 = v4.x; } else { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_record_test.res", - 74, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_record_test.res", + 74, + 9 + ] + } + }); } eq("File \"inline_record_test.res\", line 71, characters 2-9", tmp$1, 11); @@ -129,15 +129,15 @@ let tmp$2; if (v5.TAG === "A0") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_record_test.res", - 83, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_record_test.res", + 83, + 9 + ] + } + }); } tmp$2 = v5.z; @@ -162,7 +162,7 @@ function ff0(x) { } -for(let i$1 = 0; i$1 <= 10; ++i$1){ +for (let i$1 = 0; i$1 <= 10; ++i$1) { ff0(v6); } @@ -172,15 +172,15 @@ if (v6.RE_EXN_ID === A4) { tmp$3 = v6.x; } else { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "inline_record_test.res", - 108, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "inline_record_test.res", + 108, + 9 + ] + } + }); } eq("File \"inline_record_test.res\", line 105, characters 2-9", tmp$3, 11); diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index f67cdb3232..2eefed637f 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -11,7 +11,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { return current_dir_name; } else { let _n = name.length - 1 | 0; - while(true) { + while (true) { let n = _n; if (n < 0) { return $$String.sub(name, 0, 1); @@ -19,7 +19,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { if (!is_dir_sep(name, n)) { let _n$1 = n; let p = n + 1 | 0; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 < 0) { return $$String.sub(name, 0, p); diff --git a/jscomp/test/int64_string_bench.js b/jscomp/test/int64_string_bench.js index 0d1de13d39..aba68c3263 100644 --- a/jscomp/test/int64_string_bench.js +++ b/jscomp/test/int64_string_bench.js @@ -11,7 +11,7 @@ let u = Caml_int64.sub(Int64.max_int, [ 200000 ]); -for(let i = 0; i <= 100000; ++i){ +for (let i = 0; i <= 100000; ++i) { Caml_int64.to_string(u); } @@ -26,7 +26,7 @@ let u$1 = [ 30000000 ]; -for(let i$1 = 0; i$1 <= 100000; ++i$1){ +for (let i$1 = 0; i$1 <= 100000; ++i$1) { Caml_int64.to_string(u$1); } @@ -41,7 +41,7 @@ let u$2 = Caml_int64.add(Int64.min_int, [ 100 ]); -for(let i$2 = 0; i$2 <= 100000; ++i$2){ +for (let i$2 = 0; i$2 <= 100000; ++i$2) { Caml_int64.to_string(u$2); } diff --git a/jscomp/test/int64_string_test.js b/jscomp/test/int64_string_test.js index 049b421fe2..2d59d31d7d 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -55,15 +55,15 @@ f([ 2764472320 ], "1000000000000000"); -for(let i = 0; i <= 8; ++i){ +for (let i = 0; i <= 8; ++i) { eq("File \"int64_string_test.res\", line 22, characters 4-11", Caml_int64.to_string(Caml_int64.add(Int64.min_int, Caml_int64.of_int32(i))), "-922337203685477580" + String(8 - i | 0)); } -for(let i$1 = 0; i$1 <= 8; ++i$1){ +for (let i$1 = 0; i$1 <= 8; ++i$1) { eq("File \"int64_string_test.res\", line 32, characters 4-11", Caml_int64.to_string(Caml_int64.add(Int64.min_int, Caml_int64.of_int32(100 + i$1 | 0))), "-922337203685477570" + String(8 - i$1 | 0)); } -for(let i$2 = 0; i$2 <= 8; ++i$2){ +for (let i$2 = 0; i$2 <= 8; ++i$2) { eq("File \"int64_string_test.res\", line 42, characters 4-11", Caml_int64.to_string(Caml_int64.add(Int64.min_int, Caml_int64.of_int32(1000000 + i$2 | 0))), "-922337203685377580" + String(8 - i$2 | 0)); } @@ -72,7 +72,7 @@ let u = [ 4294957295 ]; -for(let i$3 = 0; i$3 <= 6; ++i$3){ +for (let i$3 = 0; i$3 <= 6; ++i$3) { eq("File \"int64_string_test.res\", line 56, characters 4-11", Caml_int64.to_string(Caml_int64.add(u, Caml_int64.of_int32(Math.imul(i$3, 10000)))), "90071992547" + (String(3 + i$3 | 0) + "0991")); } @@ -81,7 +81,7 @@ let v$1 = [ 4294917297 ]; -for(let i$4 = 0; i$4 <= 9; ++i$4){ +for (let i$4 = 0; i$4 <= 9; ++i$4) { eq("File \"int64_string_test.res\", line 67, characters 4-11", Caml_int64.to_string(Caml_int64.add(v$1, Caml_int64.of_int32(Math.imul(i$4, 10000)))), "-90071992547" + (String(9 - i$4 | 0) + "0991")); } @@ -1308,20 +1308,6 @@ Belt_List.forEach(random_data, (function (u) { if (u) { if (u.tl) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "int64_string_test.res", - 191, - 9 - ] - } - }); - } - let match = u.hd; - return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); - } - throw new Error("Assert_failure", { cause: { RE_EXN_ID: "Assert_failure", _1: [ @@ -1331,6 +1317,20 @@ Belt_List.forEach(random_data, (function (u) { ] } }); + } + let match = u.hd; + return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); + } + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "int64_string_test.res", + 191, + 9 + ] + } + }); })); eq("File \"int64_string_test.res\", line 195, characters 3-10", Caml_int64.to_string([ diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 9106dc41ab..1e80a73778 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -822,7 +822,7 @@ let shift_right_logical_suites = [ ]; function fib(_n, _a, _b) { - while(true) { + while (true) { let b = _b; let a = _a; let n = _n; @@ -837,7 +837,7 @@ function fib(_n, _a, _b) { } function fac(_n, _acc) { - while(true) { + while (true) { let acc = _acc; let n = _n; if (n === 0) { diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index bf32e0b592..837abb1369 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -27,10 +27,10 @@ function f(H) { function g(H, count) { let tbl = H.create(17); - for(let i = 0; i <= count; ++i){ + for (let i = 0; i <= count; ++i) { H.replace(tbl, (i << 1), String(i)); } - for(let i$1 = 0; i$1 <= count; ++i$1){ + for (let i$1 = 0; i$1 <= count; ++i$1) { H.replace(tbl, (i$1 << 1), String(i$1)); } let v = H.fold((function (k, v, acc) { diff --git a/jscomp/test/int_map.js b/jscomp/test/int_map.js index 4e161c5c06..25b7da89be 100644 --- a/jscomp/test/int_map.js +++ b/jscomp/test/int_map.js @@ -44,11 +44,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -61,11 +61,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -79,11 +79,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -96,11 +96,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty(param) { @@ -158,14 +158,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, param.v); if (c === 0) { @@ -177,21 +177,21 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -218,7 +218,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -228,7 +228,7 @@ function find_first_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -255,21 +255,21 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -296,7 +296,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -306,7 +306,7 @@ function find_last_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -333,7 +333,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -348,7 +348,7 @@ function find_opt(x, _param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -363,14 +363,14 @@ function mem(x, _param) { } function min_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -385,7 +385,7 @@ function min_binding(_param) { } function min_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -403,14 +403,14 @@ function min_binding_opt(_param) { } function max_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -425,7 +425,7 @@ function max_binding(_param) { } function max_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -445,11 +445,11 @@ function max_binding_opt(_param) { function remove_min_binding(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -555,7 +555,7 @@ function update(x, f, param) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -603,7 +603,7 @@ function mapi(f, param) { } function fold(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -616,7 +616,7 @@ function fold(f, _m, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -633,7 +633,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -754,15 +754,15 @@ function merge$1(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -854,7 +854,7 @@ function partition(p, param) { } function cons_enum(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -875,7 +875,7 @@ function cons_enum(_m, _e) { function compare(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -905,7 +905,7 @@ function compare(cmp, m1, m2) { function equal(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -939,7 +939,7 @@ function cardinal(param) { } function bindings_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index 7658f197d3..e8c7c42cee 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -7,7 +7,7 @@ let Caml_string = require("../../lib/js/caml_string.js"); function hash_variant(s) { let accu = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { accu = Math.imul(223, accu) + Caml_string.get(s, i) & 2147483647; } if (accu > 1073741823) { @@ -19,7 +19,7 @@ function hash_variant(s) { function hash_variant2(s) { let accu = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { accu = Math.imul(223, accu) + Caml_string.get(s, i) | 0; } accu = accu & 2147483647; diff --git a/jscomp/test/int_switch_test.js b/jscomp/test/int_switch_test.js index caff715926..2a0e0e9b34 100644 --- a/jscomp/test/int_switch_test.js +++ b/jscomp/test/int_switch_test.js @@ -23,11 +23,11 @@ function f(x) { let match = x(); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } @@ -37,11 +37,11 @@ function f22(x) { let match = x(); switch (match) { case 1 : - return /* 'a' */97; + return /* 'a' */97; case 2 : - return /* 'b' */98; + return /* 'b' */98; case 3 : - return /* 'c' */99; + return /* 'c' */99; default: return /* 'x' */120; } @@ -51,14 +51,13 @@ function f33(x) { let match = x(); switch (match) { case "A" : - return /* 'a' */97; + return /* 'a' */97; case "B" : - return /* 'b' */98; + return /* 'b' */98; case "C" : - return /* 'c' */99; + return /* 'c' */99; case "D" : - return /* 'x' */120; - + return /* 'x' */120; } } diff --git a/jscomp/test/internal_unused_test.js b/jscomp/test/internal_unused_test.js index 968d42b9ce..006038bf8a 100644 --- a/jscomp/test/internal_unused_test.js +++ b/jscomp/test/internal_unused_test.js @@ -9,10 +9,10 @@ let A = /* @__PURE__ */Caml_exceptions.create("Internal_unused_test.P1.A"); function f() { throw new Error(A, { - cause: { - RE_EXN_ID: A - } - }); + cause: { + RE_EXN_ID: A + } + }); } let c = 5; diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index 0d08a67689..4f0fa303d2 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -61,8 +61,7 @@ let e; try { e = JSON.parse(" {\"x\"}"); exit = 1; -} -catch (raw_x){ +} catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === Js_exn.$$Error) { add_test("File \"js_exception_catch_test.res\", line 18, characters 37-44", (function () { @@ -73,8 +72,8 @@ catch (raw_x){ })); } else { throw new Error(x.RE_EXN_ID, { - cause: x - }); + cause: x + }); } } @@ -97,8 +96,7 @@ function test(f) { try { f(); return "No_error"; - } - catch (raw_e){ + } catch (raw_e) { let e = Caml_js_exceptions.internalToOCamlException(raw_e); if (e.RE_EXN_ID === "Not_found") { return "Not_found"; @@ -136,89 +134,89 @@ eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(functi eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(function () { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }), "Not_found"); eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(function () { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "x" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "x" + } + }); }), "Invalid_argument"); eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(function () { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "" + } + }); }), "Invalid_any"); eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(function () { throw new Error(A, { - cause: { - RE_EXN_ID: A, - _1: 2 - } - }); + cause: { + RE_EXN_ID: A, + _1: 2 + } + }); }), "A2"); eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(function () { throw new Error(A, { - cause: { - RE_EXN_ID: A, - _1: 3 - } - }); + cause: { + RE_EXN_ID: A, + _1: 3 + } + }); }), "A_any"); eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(function () { throw new Error(B, { - cause: { - RE_EXN_ID: B - } - }); + cause: { + RE_EXN_ID: B + } + }); }), "B"); eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(function () { throw new Error(C, { - cause: { - RE_EXN_ID: C, - _1: 1, - _2: 2 - } - }); + cause: { + RE_EXN_ID: C, + _1: 1, + _2: 2 + } + }); }), "C"); eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(function () { throw new Error(C, { - cause: { - RE_EXN_ID: C, - _1: 0, - _2: 2 - } - }); + cause: { + RE_EXN_ID: C, + _1: 0, + _2: 2 + } + }); }), "C_any"); eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(function () { throw new Error(new Error("x").RE_EXN_ID, { - cause: new Error("x") - }); + cause: new Error("x") + }); }), "Js_error"); eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(function () { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "x" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "x" + } + }); }), "Any"); Mt.from_pair_suites("Js_exception_catch_test", suites.contents); diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index 92bd902fb2..98d00e1596 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -98,29 +98,29 @@ add_test("File \"js_json_test.res\", line 22, characters 11-18", (function () { let ty3 = Js_json.classify(x); if (typeof ty3 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ] + } + }); } if (ty3.TAG === "JSONNumber") { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ] + } + }); }); return { TAG: "Ok", @@ -238,9 +238,9 @@ function test(v) { } switch (ty) { case "JSONFalse" : - return eq("File \"js_json_test.res\", line 99, characters 24-31", false, v); + return eq("File \"js_json_test.res\", line 99, characters 24-31", false, v); case "JSONTrue" : - return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); + return eq("File \"js_json_test.res\", line 98, characters 23-30", true, v); default: return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function () { return { @@ -260,15 +260,15 @@ function option_get(x) { return Caml_option.valFromOption(x); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 111, - 12 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 111, + 12 + ] + } + }); } let dict = {}; @@ -371,116 +371,108 @@ function eq_at_i(loc, json, i, kind, expected) { let ty$1 = Js_json.classify(Caml_array.get(ty._0, i)); switch (kind) { case "String" : - if (typeof ty$1 !== "object") { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } else if (ty$1.TAG === "JSONString") { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } + if (typeof ty$1 !== "object") { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } else if (ty$1.TAG === "JSONString") { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } case "Number" : - if (typeof ty$1 !== "object") { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } else if (ty$1.TAG === "JSONNumber") { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } + if (typeof ty$1 !== "object") { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } else if (ty$1.TAG === "JSONNumber") { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } case "Object" : - if (typeof ty$1 !== "object") { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } else if (ty$1.TAG === "JSONObject") { - return eq(loc, ty$1._0, expected); - } else { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } + if (typeof ty$1 !== "object") { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } else if (ty$1.TAG === "JSONObject") { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } case "Array" : - if (typeof ty$1 !== "object") { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } else if (ty$1.TAG === "JSONArray") { - return eq(loc, ty$1._0, expected); - } else { + if (typeof ty$1 !== "object") { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } else if (ty$1.TAG === "JSONArray") { + return eq(loc, ty$1._0, expected); + } else { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } + case "Boolean" : + if (typeof ty$1 === "object") { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } + switch (ty$1) { + case "JSONFalse" : + return eq(loc, false, expected); + case "JSONTrue" : + return eq(loc, true, expected); + default: return add_test(loc, (function () { return { TAG: "Ok", _0: false }; })); - } - case "Boolean" : - if (typeof ty$1 === "object") { + } + case "Null" : + if (typeof ty$1 !== "object") { + if (ty$1 === "JSONNull") { return add_test(loc, (function () { return { TAG: "Ok", - _0: false + _0: true }; })); - } - switch (ty$1) { - case "JSONFalse" : - return eq(loc, false, expected); - case "JSONTrue" : - return eq(loc, true, expected); - default: - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } - case "Null" : - if (typeof ty$1 !== "object") { - if (ty$1 === "JSONNull") { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: true - }; - })); - } else { - return add_test(loc, (function () { - return { - TAG: "Ok", - _0: false - }; - })); - } } else { return add_test(loc, (function () { return { @@ -489,7 +481,14 @@ function eq_at_i(loc, json, i, kind, expected) { }; })); } - + } else { + return add_test(loc, (function () { + return { + TAG: "Ok", + _0: false + }; + })); + } } } @@ -639,8 +638,7 @@ try { _0: false }; })); -} -catch (exn){ +} catch (exn) { add_test("File \"js_json_test.res\", line 281, characters 17-24", (function () { return { TAG: "Ok", diff --git a/jscomp/test/jsoo_400_test.js b/jscomp/test/jsoo_400_test.js index f88c3ce847..378d6d338c 100644 --- a/jscomp/test/jsoo_400_test.js +++ b/jscomp/test/jsoo_400_test.js @@ -8,8 +8,7 @@ function u() { let n; try { n = "123".length; - } - catch (exn){ + } catch (exn) { return 42; } return Caml_int32.div(3, 0); diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index 217632df99..7d56dbcdeb 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -61,19 +61,19 @@ let f006 = CamlinternalLazy.from_fun(function () { let f007 = CamlinternalLazy.from_fun(function () { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }); function f$1() { console.log("hi"); throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let f008 = CamlinternalLazy.from_fun(function () { @@ -217,10 +217,10 @@ Mt.from_pair_suites("Lazy_test", { TAG: "Ok", _0: !Lazy.is_val(CamlinternalLazy.from_fun(function () { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); })) }; }) diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index 9154961b61..d3db327772 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -38,15 +38,14 @@ function does_raise(f, q) { try { f(q); return false; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Queue.Empty) { return true; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -58,15 +57,15 @@ let q = { if (!(to_list(q) === /* [] */0 && q.length === 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 30, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 30, + 2 + ] + } + }); } Queue.add(1, q); @@ -76,15 +75,15 @@ if (!(Caml_obj.equal(to_list(q), { tl: /* [] */0 }) && q.length === 1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 32, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 32, + 2 + ] + } + }); } Queue.add(2, q); @@ -97,15 +96,15 @@ if (!(Caml_obj.equal(to_list(q), { } }) && q.length === 2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 34, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 34, + 2 + ] + } + }); } Queue.add(3, q); @@ -121,15 +120,15 @@ if (!(Caml_obj.equal(to_list(q), { } }) && q.length === 3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 36, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 36, + 2 + ] + } + }); } Queue.add(4, q); @@ -148,28 +147,28 @@ if (!(Caml_obj.equal(to_list(q), { } }) && q.length === 4)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 38, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 38, + 2 + ] + } + }); } if (Queue.take(q) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 39, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 39, + 2 + ] + } + }); } if (!(Caml_obj.equal(to_list(q), { @@ -183,28 +182,28 @@ if (!(Caml_obj.equal(to_list(q), { } }) && q.length === 3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 40, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 40, + 2 + ] + } + }); } if (Queue.take(q) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 41, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 41, + 2 + ] + } + }); } if (!(Caml_obj.equal(to_list(q), { @@ -215,28 +214,28 @@ if (!(Caml_obj.equal(to_list(q), { } }) && q.length === 2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 42, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 42, + 2 + ] + } + }); } if (Queue.take(q) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 43, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 43, + 2 + ] + } + }); } if (!(Caml_obj.equal(to_list(q), { @@ -244,54 +243,54 @@ if (!(Caml_obj.equal(to_list(q), { tl: /* [] */0 }) && q.length === 1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 44, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 44, + 2 + ] + } + }); } if (Queue.take(q) !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 45, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 45, + 2 + ] + } + }); } if (!(to_list(q) === /* [] */0 && q.length === 0)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 46, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 46, + 2 + ] + } + }); } if (!does_raise(Queue.take, q)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 47, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 47, + 2 + ] + } + }); } let q$1 = { @@ -304,69 +303,69 @@ Queue.add(1, q$1); if (Queue.take(q$1) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 53, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 53, + 2 + ] + } + }); } if (!does_raise(Queue.take, q$1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 54, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 54, + 2 + ] + } + }); } Queue.add(2, q$1); if (Queue.take(q$1) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 56, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 56, + 2 + ] + } + }); } if (!does_raise(Queue.take, q$1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 57, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 57, + 2 + ] + } + }); } if (q$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 58, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 58, + 2 + ] + } + }); } let q$2 = { @@ -379,149 +378,149 @@ Queue.add(1, q$2); if (Queue.peek(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 64, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 64, + 2 + ] + } + }); } Queue.add(2, q$2); if (Queue.peek(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 66, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 66, + 2 + ] + } + }); } Queue.add(3, q$2); if (Queue.peek(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 68, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 68, + 2 + ] + } + }); } if (Queue.peek(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 69, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 69, + 2 + ] + } + }); } if (Queue.take(q$2) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 70, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 70, + 2 + ] + } + }); } if (Queue.peek(q$2) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 71, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 71, + 2 + ] + } + }); } if (Queue.take(q$2) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 72, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 72, + 2 + ] + } + }); } if (Queue.peek(q$2) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 73, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 73, + 2 + ] + } + }); } if (Queue.take(q$2) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 74, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 74, + 2 + ] + } + }); } if (!does_raise(Queue.peek, q$2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 75, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 75, + 2 + ] + } + }); } if (!does_raise(Queue.peek, q$2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 76, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 76, + 2 + ] + } + }); } let q$3 = { @@ -530,7 +529,7 @@ let q$3 = { last: "Nil" }; -for(let i = 1; i <= 10; ++i){ +for (let i = 1; i <= 10; ++i) { Queue.add(i, q$3); } @@ -538,28 +537,28 @@ Queue.clear(q$3); if (q$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 85, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 85, + 2 + ] + } + }); } if (!does_raise(Queue.take, q$3)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 86, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 86, + 2 + ] + } + }); } if (!Caml_obj.equal(q$3, { @@ -568,30 +567,30 @@ if (!Caml_obj.equal(q$3, { last: "Nil" })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 87, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 87, + 2 + ] + } + }); } Queue.add(42, q$3); if (Queue.take(q$3) !== 42) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 89, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 89, + 2 + ] + } + }); } let q1 = { @@ -600,7 +599,7 @@ let q1 = { last: "Nil" }; -for(let i$1 = 1; i$1 <= 10; ++i$1){ +for (let i$1 = 1; i$1 <= 10; ++i$1) { Queue.add(i$1, q1); } @@ -638,15 +637,15 @@ if (!Caml_obj.equal(to_list(q1), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 98, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 98, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2), { @@ -681,71 +680,71 @@ if (!Caml_obj.equal(to_list(q2), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 99, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 99, + 2 + ] + } + }); } if (q1.length !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 100, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 100, + 2 + ] + } + }); } if (q2.length !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 101, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 101, + 2 + ] + } + }); } -for(let i$2 = 1; i$2 <= 10; ++i$2){ +for (let i$2 = 1; i$2 <= 10; ++i$2) { if (Queue.take(q1) !== i$2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 103, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 103, + 4 + ] + } + }); } } -for(let i$3 = 1; i$3 <= 10; ++i$3){ +for (let i$3 = 1; i$3 <= 10; ++i$3) { if (Queue.take(q2) !== i$3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 106, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 106, + 4 + ] + } + }); } } @@ -758,98 +757,98 @@ let q$4 = { if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 112, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 112, + 2 + ] + } + }); } -for(let i$4 = 1; i$4 <= 10; ++i$4){ +for (let i$4 = 1; i$4 <= 10; ++i$4) { Queue.add(i$4, q$4); if (q$4.length !== i$4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 115, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 115, + 4 + ] + } + }); } if (q$4.length === 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 116, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 116, + 4 + ] + } + }); } } -for(let i$5 = 10; i$5 >= 1; --i$5){ +for (let i$5 = 10; i$5 >= 1; --i$5) { if (q$4.length !== i$5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 119, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 119, + 4 + ] + } + }); } if (q$4.length === 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 120, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 120, + 4 + ] + } + }); } Queue.take(q$4); } if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 123, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 123, + 2 + ] + } + }); } if (q$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 124, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 124, + 2 + ] + } + }); } let q$5 = { @@ -858,7 +857,7 @@ let q$5 = { last: "Nil" }; -for(let i$6 = 1; i$6 <= 10; ++i$6){ +for (let i$6 = 1; i$6 <= 10; ++i$6) { Queue.add(i$6, q$5); } @@ -869,15 +868,15 @@ let i$7 = { Queue.iter((function (j) { if (i$7.contents !== j) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 134, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 134, + 4 + ] + } + }); } i$7.contents = i$7.contents + 1 | 0; }), q$5); @@ -896,108 +895,108 @@ let q2$1 = { if (q1$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 141, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 141, + 2 + ] + } + }); } if (to_list(q1$1) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 142, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 142, + 2 + ] + } + }); } if (q2$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 143, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 143, + 2 + ] + } + }); } if (to_list(q2$1) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 144, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 144, + 2 + ] + } + }); } Queue.transfer(q1$1, q2$1); if (q1$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 146, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 146, + 2 + ] + } + }); } if (to_list(q1$1) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 147, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 147, + 2 + ] + } + }); } if (q2$1.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 148, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 148, + 2 + ] + } + }); } if (to_list(q2$1) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 149, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 149, + 2 + ] + } + }); } let q1$2 = { @@ -1012,21 +1011,21 @@ let q2$2 = { last: "Nil" }; -for(let i$8 = 1; i$8 <= 4; ++i$8){ +for (let i$8 = 1; i$8 <= 4; ++i$8) { Queue.add(i$8, q1$2); } if (q1$2.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 157, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 157, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q1$2), { @@ -1043,82 +1042,82 @@ if (!Caml_obj.equal(to_list(q1$2), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 158, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 158, + 2 + ] + } + }); } if (q2$2.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 159, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 159, + 2 + ] + } + }); } if (to_list(q2$2) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 160, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 160, + 2 + ] + } + }); } Queue.transfer(q1$2, q2$2); if (q1$2.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 162, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 162, + 2 + ] + } + }); } if (to_list(q1$2) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 163, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 163, + 2 + ] + } + }); } if (q2$2.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 164, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 164, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2$2), { @@ -1135,15 +1134,15 @@ if (!Caml_obj.equal(to_list(q2$2), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 165, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 165, + 2 + ] + } + }); } let q1$3 = { @@ -1158,47 +1157,47 @@ let q2$3 = { last: "Nil" }; -for(let i$9 = 5; i$9 <= 8; ++i$9){ +for (let i$9 = 5; i$9 <= 8; ++i$9) { Queue.add(i$9, q2$3); } if (q1$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 173, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 173, + 2 + ] + } + }); } if (to_list(q1$3) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 174, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 174, + 2 + ] + } + }); } if (q2$3.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 175, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 175, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2$3), { @@ -1215,56 +1214,56 @@ if (!Caml_obj.equal(to_list(q2$3), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 176, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 176, + 2 + ] + } + }); } Queue.transfer(q1$3, q2$3); if (q1$3.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 178, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 178, + 2 + ] + } + }); } if (to_list(q1$3) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 179, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 179, + 2 + ] + } + }); } if (q2$3.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 180, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 180, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2$3), { @@ -1281,15 +1280,15 @@ if (!Caml_obj.equal(to_list(q2$3), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 181, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 181, + 2 + ] + } + }); } let q1$4 = { @@ -1304,25 +1303,25 @@ let q2$4 = { last: "Nil" }; -for(let i$10 = 1; i$10 <= 4; ++i$10){ +for (let i$10 = 1; i$10 <= 4; ++i$10) { Queue.add(i$10, q1$4); } -for(let i$11 = 5; i$11 <= 8; ++i$11){ +for (let i$11 = 5; i$11 <= 8; ++i$11) { Queue.add(i$11, q2$4); } if (q1$4.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 192, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 192, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q1$4), { @@ -1339,28 +1338,28 @@ if (!Caml_obj.equal(to_list(q1$4), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 193, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 193, + 2 + ] + } + }); } if (q2$4.length !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 194, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 194, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2$4), { @@ -1377,56 +1376,56 @@ if (!Caml_obj.equal(to_list(q2$4), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 195, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 195, + 2 + ] + } + }); } Queue.transfer(q1$4, q2$4); if (q1$4.length !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 197, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 197, + 2 + ] + } + }); } if (to_list(q1$4) !== /* [] */0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 198, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 198, + 2 + ] + } + }); } if (q2$4.length !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 199, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 199, + 2 + ] + } + }); } if (!Caml_obj.equal(to_list(q2$4), { @@ -1455,15 +1454,15 @@ if (!Caml_obj.equal(to_list(q2$4), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 200, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 200, + 2 + ] + } + }); } console.log("OK"); diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index a797923bc7..a539680a85 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -11,7 +11,7 @@ function f() { contents: 0 }; let n = 10; - while(true) { + while (true) { if (v.contents > n) { return acc.contents; } diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index 31ef48ae2c..c070c6c521 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -34,11 +34,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -51,11 +51,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -69,11 +69,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -86,11 +86,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, param) { @@ -140,14 +140,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, param.v); if (c === 0) { @@ -215,11 +215,11 @@ function bal$1(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -232,11 +232,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(ll, lv, ld, lr.l), lr.v, lr.d, create$1(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -250,11 +250,11 @@ function bal$1(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -267,11 +267,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(l, x, d, rl.l), rl.v, rl.d, create$1(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add$1(x, data, param) { @@ -321,14 +321,14 @@ function add$1(x, data, param) { } function find$1(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.string_compare(x, param.v); if (c === 0) { diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index 3979650d1f..defd198b77 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -52,11 +52,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -69,11 +69,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -87,11 +87,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -104,11 +104,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty(param) { @@ -166,14 +166,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, param.v); if (c === 0) { @@ -185,21 +185,21 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -226,7 +226,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -236,7 +236,7 @@ function find_first_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -263,21 +263,21 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -304,7 +304,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -314,7 +314,7 @@ function find_last_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -341,7 +341,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -356,7 +356,7 @@ function find_opt(x, _param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -371,14 +371,14 @@ function mem(x, _param) { } function min_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -393,7 +393,7 @@ function min_binding(_param) { } function min_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -411,14 +411,14 @@ function min_binding_opt(_param) { } function max_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -433,7 +433,7 @@ function max_binding(_param) { } function max_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -453,11 +453,11 @@ function max_binding_opt(_param) { function remove_min_binding(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -563,7 +563,7 @@ function update(x, f, param) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -611,7 +611,7 @@ function mapi(f, param) { } function fold(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -624,7 +624,7 @@ function fold(f, _m, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -641,7 +641,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -762,15 +762,15 @@ function merge$1(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -862,7 +862,7 @@ function partition(p, param) { } function cons_enum(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -883,7 +883,7 @@ function cons_enum(_m, _e) { function compare$1(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -913,7 +913,7 @@ function compare$1(cmp, m1, m2) { function equal(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -947,7 +947,7 @@ function cardinal(param) { } function bindings_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1046,11 +1046,11 @@ function bal$1(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -1063,11 +1063,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(ll, lv, ld, lr.l), lr.v, lr.d, create$1(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -1081,11 +1081,11 @@ function bal$1(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -1098,11 +1098,11 @@ function bal$1(l, x, d, r) { return create$1(create$1(l, x, d, rl.l), rl.v, rl.d, create$1(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty$1(param) { @@ -1160,14 +1160,14 @@ function add$1(x, data, param) { } function find$1(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.string_compare(x, param.v); if (c === 0) { @@ -1179,21 +1179,21 @@ function find$1(x, _param) { } function find_first$1(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -1220,7 +1220,7 @@ function find_first$1(f, _param) { } function find_first_opt$1(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1230,7 +1230,7 @@ function find_first_opt$1(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -1257,21 +1257,21 @@ function find_first_opt$1(f, _param) { } function find_last$1(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -1298,7 +1298,7 @@ function find_last$1(f, _param) { } function find_last_opt$1(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1308,7 +1308,7 @@ function find_last_opt$1(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -1335,7 +1335,7 @@ function find_last_opt$1(f, _param) { } function find_opt$1(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1350,7 +1350,7 @@ function find_opt$1(x, _param) { } function mem$1(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1365,14 +1365,14 @@ function mem$1(x, _param) { } function min_binding$1(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1387,7 +1387,7 @@ function min_binding$1(_param) { } function min_binding_opt$1(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1405,14 +1405,14 @@ function min_binding_opt$1(_param) { } function max_binding$1(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -1427,7 +1427,7 @@ function max_binding$1(_param) { } function max_binding_opt$1(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1447,11 +1447,11 @@ function max_binding_opt$1(_param) { function remove_min_binding$1(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1557,7 +1557,7 @@ function update$1(x, f, param) { } function iter$1(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1605,7 +1605,7 @@ function mapi$1(f, param) { } function fold$1(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -1618,7 +1618,7 @@ function fold$1(f, _m, _accu) { } function for_all$1(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1635,7 +1635,7 @@ function for_all$1(p, _param) { } function exists$1(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1756,15 +1756,15 @@ function merge$3(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split$1(v2, s1); @@ -1856,7 +1856,7 @@ function partition$1(p, param) { } function cons_enum$1(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -1877,7 +1877,7 @@ function cons_enum$1(_m, _e) { function compare$2(cmp, m1, m2) { let _e1 = cons_enum$1(m1, "End"); let _e2 = cons_enum$1(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1907,7 +1907,7 @@ function compare$2(cmp, m1, m2) { function equal$1(cmp, m1, m2) { let _e1 = cons_enum$1(m1, "End"); let _e2 = cons_enum$1(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1941,7 +1941,7 @@ function cardinal$1(param) { } function bindings_aux$1(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -2141,11 +2141,11 @@ let int_map_suites_1 = { "iteration", (function (param) { let m = "Empty"; - for(let i = 0; i <= 10000; ++i){ + for (let i = 0; i <= 10000; ++i) { m = add$1(String(i), String(i), m); } let v = -1; - for(let i$1 = 0; i$1 <= 10000; ++i$1){ + for (let i$1 = 0; i$1 <= 10000; ++i$1) { if (find$1(String(i$1), m) !== String(i$1)) { v = i$1; } diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index 635e2e3132..38059f9871 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -44,577 +44,568 @@ function make_enemy(param) { let dir = param[1]; switch (param[0]) { case "Goomba" : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 14, + 14 + ], "enemies.png", 2, 10, [ + 16, + 16 + ], [ + 0, + 128 + ]); + case "GKoopa" : + if (dir === "Left") { return setup_sprite(undefined, [ - 1, - 1 + 4, + 10 ], [ - 14, - 14 + 11, + 16 ], "enemies.png", 2, 10, [ 16, - 16 + 27 ], [ 0, - 128 + 69 ]); - case "GKoopa" : - if (dir === "Left") { - return setup_sprite(undefined, [ - 4, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 0, - 69 - ]); - } else { - return setup_sprite(undefined, [ - 1, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 32, - 69 - ]); - } - case "RKoopa" : - if (dir === "Left") { - return setup_sprite(undefined, [ - 4, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 0, - 5 - ]); - } else { - return setup_sprite(undefined, [ - 1, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 32, - 5 - ]); - } - case "GKoopaShell" : + } else { return setup_sprite(undefined, [ - 2, - 2 + 1, + 10 ], [ - 12, - 13 - ], "enemies.png", 4, 10, [ + 11, + 16 + ], "enemies.png", 2, 10, [ 16, + 27 + ], [ + 32, + 69 + ]); + } + case "RKoopa" : + if (dir === "Left") { + return setup_sprite(undefined, [ + 4, + 10 + ], [ + 11, 16 + ], "enemies.png", 2, 10, [ + 16, + 27 ], [ 0, - 96 + 5 ]); - case "RKoopaShell" : + } else { return setup_sprite(undefined, [ - 2, - 2 + 1, + 10 ], [ - 12, - 13 - ], "enemies.png", 4, 10, [ - 16, + 11, 16 + ], "enemies.png", 2, 10, [ + 16, + 27 ], [ - 0, - 32 + 32, + 5 ]); - + } + case "GKoopaShell" : + return setup_sprite(undefined, [ + 2, + 2 + ], [ + 12, + 13 + ], "enemies.png", 4, 10, [ + 16, + 16 + ], [ + 0, + 96 + ]); + case "RKoopaShell" : + return setup_sprite(undefined, [ + 2, + 2 + ], [ + 12, + 13 + ], "enemies.png", 4, 10, [ + 16, + 16 + ], [ + 0, + 32 + ]); } } function make_particle(x) { switch (x) { case "GoombaSquish" : - return setup_sprite(undefined, undefined, undefined, "enemies.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 144 - ]); + return setup_sprite(undefined, undefined, undefined, "enemies.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 144 + ]); case "BrickChunkL" : - return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 0, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ + 8, + 8 + ], [ + 0, + 0 + ]); case "BrickChunkR" : - return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 8, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ + 8, + 8 + ], [ + 8, + 0 + ]); case "Score100" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 8 - ], [ - 0, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 8 + ], [ + 0, + 0 + ]); case "Score200" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 9 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 9 + ]); case "Score400" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 18 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 18 + ]); case "Score800" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 27 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 12, + 9 + ], [ + 0, + 27 + ]); case "Score1000" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 0 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 0 + ]); case "Score2000" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 9 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 9 + ]); case "Score4000" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 18 - ]); + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 18 + ]); case "Score8000" : - return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 27 - ]); - + return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ + 14, + 9 + ], [ + 13, + 27 + ]); } } function make_type(typ, dir) { switch (typ.TAG) { case "SPlayer" : - let pt = typ._0; - let spr_type = [ - typ._1, - dir - ]; - if (pt === "BigM") { - let typ$1 = spr_type[0]; - if (spr_type[1] === "Left") { - switch (typ$1) { - case "Standing" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 16, - 5 - ]); - case "Jumping" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 48, - 6 - ]); - case "Running" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 4, 10, [ - 16, - 27 - ], [ - 0, - 37 - ]); - case "Crouching" : - return setup_sprite(undefined, [ - 2, - 10 - ], [ - 13, - 17 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 32, - 5 - ]); - - } - } else { - switch (typ$1) { - case "Standing" : - return setup_sprite(undefined, [ - 1, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 16, - 69 - ]); - case "Jumping" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 26 - ], [ - 48, - 70 - ]); - case "Running" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 4, 10, [ - 16, - 27 - ], [ - 0, - 101 - ]); - case "Crouching" : - return setup_sprite(undefined, [ - 2, - 10 - ], [ - 13, - 17 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 32, - 69 - ]); - - } + let pt = typ._0; + let spr_type = [ + typ._1, + dir + ]; + if (pt === "BigM") { + let typ$1 = spr_type[0]; + if (spr_type[1] === "Left") { + switch (typ$1) { + case "Standing" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 16, + 5 + ]); + case "Jumping" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 12, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 26 + ], [ + 48, + 6 + ]); + case "Running" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 4, 10, [ + 16, + 27 + ], [ + 0, + 37 + ]); + case "Crouching" : + return setup_sprite(undefined, [ + 2, + 10 + ], [ + 13, + 17 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 32, + 5 + ]); } } else { - let typ$2 = spr_type[0]; - if (spr_type[1] === "Left") { - switch (typ$2) { - case "Standing" : - return setup_sprite(undefined, [ - 3, - 1 - ], [ - 11, - 15 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 0 - ]); - case "Jumping" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 15 - ], "mario-small.png", 2, 10, [ - 16, - 16 - ], [ - 16, - 16 - ]); - case "Running" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 15 - ], "mario-small.png", 3, 5, [ - 16, - 16 - ], [ - 16, - 0 - ]); - case "Crouching" : - return setup_sprite(undefined, [ - 1, - 5 - ], [ - 14, - 10 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 64 - ]); - - } - } else { - switch (typ$2) { - case "Standing" : - return setup_sprite(undefined, [ - 1, - 1 - ], [ - 11, - 15 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 32 - ]); - case "Jumping" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 15 - ], "mario-small.png", 2, 10, [ - 16, - 16 - ], [ - 16, - 48 - ]); - case "Running" : - return setup_sprite(undefined, [ - 2, - 1 - ], [ - 12, - 15 - ], "mario-small.png", 3, 5, [ - 16, - 16 - ], [ - 16, - 32 - ]); - case "Crouching" : - return setup_sprite(undefined, [ - 1, - 5 - ], [ - 14, - 10 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 64 - ]); - - } - } - } - case "SEnemy" : - return make_enemy([ - typ._0, - dir - ]); - case "SItem" : - let x = typ._0; - switch (x) { - case "Mushroom" : + switch (typ$1) { + case "Standing" : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 1, 0, [ + 16, + 26 + ], [ + 16, + 69 + ]); + case "Jumping" : return setup_sprite(undefined, [ 2, - 0 + 1 ], [ 12, - 16 - ], "items.png", 1, 0, [ + 25 + ], "mario-big.png", 1, 0, [ 16, - 16 + 26 + ], [ + 48, + 70 + ]); + case "Running" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 25 + ], "mario-big.png", 4, 10, [ + 16, + 27 ], [ 0, - 0 + 101 ]); - case "FireFlower" : - return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + case "Crouching" : + return setup_sprite(undefined, [ + 2, + 10 + ], [ + 13, + 17 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 32, + 69 + ]); + } + } + } else { + let typ$2 = spr_type[0]; + if (spr_type[1] === "Left") { + switch (typ$2) { + case "Standing" : + return setup_sprite(undefined, [ + 3, + 1 + ], [ + 11, + 15 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 188 + 0 ]); - case "Star" : - return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + case "Jumping" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 15 + ], "mario-small.png", 2, 10, [ 16, 16 ], [ 16, - 48 + 16 ]); - case "Coin" : + case "Running" : return setup_sprite(undefined, [ - 3, - 0 + 2, + 1 ], [ 12, - 16 - ], "items.png", 3, 15, [ + 15 + ], "mario-small.png", 3, 5, [ 16, 16 ], [ - 0, - 80 + 16, + 0 ]); - - } - case "SBlock" : - let x$1 = typ._0; - if (typeof x$1 === "object") { - return setup_sprite(undefined, undefined, undefined, "blocks.png", 4, 15, [ - 16, - 16 - ], [ - 0, - 16 - ]); - } - switch (x$1) { - case "QBlockUsed" : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case "Crouching" : + return setup_sprite(undefined, [ + 1, + 5 + ], [ + 14, + 10 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 32 + 64 ]); - case "Brick" : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 5, 10, [ + } + } else { + switch (typ$2) { + case "Standing" : + return setup_sprite(undefined, [ + 1, + 1 + ], [ + 11, + 15 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 0 + 32 ]); - case "UnBBlock" : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case "Jumping" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 13, + 15 + ], "mario-small.png", 2, 10, [ 16, 16 ], [ - 0, + 16, 48 ]); - case "Cloud" : - return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + case "Running" : + return setup_sprite(undefined, [ + 2, + 1 + ], [ + 12, + 15 + ], "mario-small.png", 3, 5, [ 16, 16 ], [ - 0, - 64 + 16, + 32 ]); - case "Panel" : - return setup_sprite(undefined, undefined, undefined, "panel.png", 3, 15, [ - 26, - 26 + case "Crouching" : + return setup_sprite(undefined, [ + 1, + 5 ], [ - 0, - 0 - ]); - case "Ground" : - return setup_sprite(undefined, undefined, undefined, "ground.png", 1, 0, [ + 14, + 10 + ], "mario-small.png", 1, 0, [ 16, 16 ], [ 0, - 32 + 64 ]); - + } } - + } + case "SEnemy" : + return make_enemy([ + typ._0, + dir + ]); + case "SItem" : + let x = typ._0; + switch (x) { + case "Mushroom" : + return setup_sprite(undefined, [ + 2, + 0 + ], [ + 12, + 16 + ], "items.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 0 + ]); + case "FireFlower" : + return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 188 + ]); + case "Star" : + return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ + 16, + 16 + ], [ + 16, + 48 + ]); + case "Coin" : + return setup_sprite(undefined, [ + 3, + 0 + ], [ + 12, + 16 + ], "items.png", 3, 15, [ + 16, + 16 + ], [ + 0, + 80 + ]); + } + case "SBlock" : + let x$1 = typ._0; + if (typeof x$1 === "object") { + return setup_sprite(undefined, undefined, undefined, "blocks.png", 4, 15, [ + 16, + 16 + ], [ + 0, + 16 + ]); + } + switch (x$1) { + case "QBlockUsed" : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 32 + ]); + case "Brick" : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 5, 10, [ + 16, + 16 + ], [ + 0, + 0 + ]); + case "UnBBlock" : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 48 + ]); + case "Cloud" : + return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 64 + ]); + case "Panel" : + return setup_sprite(undefined, undefined, undefined, "panel.png", 3, 15, [ + 26, + 26 + ], [ + 0, + 0 + ]); + case "Ground" : + return setup_sprite(undefined, undefined, undefined, "ground.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 32 + ]); + } } } @@ -702,11 +693,11 @@ function make_type$1(typ, ctx) { switch (typ) { case "BrickChunkL" : case "BrickChunkR" : - return { - sprite: make_particle$1(typ, ctx), - rot: 0, - lifetime: 300 - }; + return { + sprite: make_particle$1(typ, ctx), + rot: 0, + lifetime: 300 + }; default: return { sprite: make_particle$1(typ, ctx), @@ -817,26 +808,25 @@ function make_player() { function make_type$2(x) { switch (x.TAG) { case "SPlayer" : - return make_player(); + return make_player(); case "SEnemy" : - let x$1 = x._0; - switch (x$1) { - case "GKoopaShell" : - case "RKoopaShell" : - return setup_obj(undefined, 3, undefined); - default: - return setup_obj(undefined, undefined, undefined); - } - case "SItem" : - let x$2 = x._0; - if (x$2 === "Coin") { - return setup_obj(false, undefined, undefined); - } else { + let x$1 = x._0; + switch (x$1) { + case "GKoopaShell" : + case "RKoopaShell" : + return setup_obj(undefined, 3, undefined); + default: return setup_obj(undefined, undefined, undefined); - } + } + case "SItem" : + let x$2 = x._0; + if (x$2 === "Coin") { + return setup_obj(false, undefined, undefined); + } else { + return setup_obj(undefined, undefined, undefined); + } case "SBlock" : - return setup_obj(false, undefined, undefined); - + return setup_obj(false, undefined, undefined); } } @@ -886,35 +876,34 @@ function spawn(spawnable, context, param) { let spr = match[0]; switch (spawnable.TAG) { case "SPlayer" : - return { - TAG: "Player", - _0: spawnable._0, - _1: spr, - _2: obj - }; + return { + TAG: "Player", + _0: spawnable._0, + _1: spr, + _2: obj + }; case "SEnemy" : - set_vel_to_speed(obj); - return { - TAG: "Enemy", - _0: spawnable._0, - _1: spr, - _2: obj - }; + set_vel_to_speed(obj); + return { + TAG: "Enemy", + _0: spawnable._0, + _1: spr, + _2: obj + }; case "SItem" : - return { - TAG: "Item", - _0: spawnable._0, - _1: spr, - _2: obj - }; + return { + TAG: "Item", + _0: spawnable._0, + _1: spr, + _2: obj + }; case "SBlock" : - return { - TAG: "Block", - _0: spawnable._0, - _1: spr, - _2: obj - }; - + return { + TAG: "Block", + _0: spawnable._0, + _1: spr, + _2: obj + }; } } @@ -963,42 +952,41 @@ function update_player(player, keys, context) { let lr_acc = player.vel.x * 0.2; switch (extra) { case "CLeft" : - if (!player.crouch) { - if (player.vel.x > - player.params.speed) { - player.vel.x = player.vel.x - (0.4 - lr_acc); - } - player.dir = "Left"; - return; - } else { - return; + if (!player.crouch) { + if (player.vel.x > - player.params.speed) { + player.vel.x = player.vel.x - (0.4 - lr_acc); } + player.dir = "Left"; + return; + } else { + return; + } case "CRight" : - if (!player.crouch) { - if (player.vel.x < player.params.speed) { - player.vel.x = player.vel.x + (0.4 + lr_acc); - } - player.dir = "Right"; - return; - } else { - return; + if (!player.crouch) { + if (player.vel.x < player.params.speed) { + player.vel.x = player.vel.x + (0.4 + lr_acc); } + player.dir = "Right"; + return; + } else { + return; + } case "CUp" : - if (!player.jumping && player.grounded) { - player.jumping = true; - player.grounded = false; - player.vel.y = Caml.float_max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6); - return; - } else { - return; - } + if (!player.jumping && player.grounded) { + player.jumping = true; + player.grounded = false; + player.vel.y = Caml.float_max(player.vel.y - (5.7 + Math.abs(player.vel.x) * 0.25), -6); + return; + } else { + return; + } case "CDown" : - if (!player.jumping && player.grounded) { - player.crouch = true; - return; - } else { - return; - } - + if (!player.jumping && player.grounded) { + player.crouch = true; + return; + } else { + return; + } } }), keys); let v = player.vel.x * 0.9; @@ -1098,17 +1086,16 @@ function collide_block(check_xOpt, dir, obj) { let check_x = check_xOpt !== undefined ? check_xOpt : true; switch (dir) { case "North" : - obj.vel.y = -0.001; - return; + obj.vel.y = -0.001; + return; case "South" : - obj.vel.y = 0; - obj.grounded = true; - obj.jumping = false; - return; + obj.vel.y = 0; + obj.grounded = true; + obj.jumping = false; + return; case "East" : case "West" : - break; - + break; } if (check_x) { obj.vel.x = 0; @@ -1133,46 +1120,45 @@ function reverse_left_right(obj) { function evolve_enemy(player_dir, typ, spr, obj, context) { switch (typ) { case "Goomba" : - obj.kill = true; - return; + obj.kill = true; + return; case "GKoopa" : - let match = make$2(undefined, obj.dir, { - TAG: "SEnemy", - _0: "GKoopaShell" - }, context, [ - obj.pos.x, - obj.pos.y - ]); - let new_obj = match[1]; - let new_spr = match[0]; - normalize_pos(new_obj.pos, spr.params, new_spr.params); - return { - TAG: "Enemy", - _0: "GKoopaShell", - _1: new_spr, - _2: new_obj - }; + let match = make$2(undefined, obj.dir, { + TAG: "SEnemy", + _0: "GKoopaShell" + }, context, [ + obj.pos.x, + obj.pos.y + ]); + let new_obj = match[1]; + let new_spr = match[0]; + normalize_pos(new_obj.pos, spr.params, new_spr.params); + return { + TAG: "Enemy", + _0: "GKoopaShell", + _1: new_spr, + _2: new_obj + }; case "RKoopa" : - let match$1 = make$2(undefined, obj.dir, { - TAG: "SEnemy", - _0: "RKoopaShell" - }, context, [ - obj.pos.x, - obj.pos.y - ]); - let new_obj$1 = match$1[1]; - let new_spr$1 = match$1[0]; - normalize_pos(new_obj$1.pos, spr.params, new_spr$1.params); - return { - TAG: "Enemy", - _0: "RKoopaShell", - _1: new_spr$1, - _2: new_obj$1 - }; + let match$1 = make$2(undefined, obj.dir, { + TAG: "SEnemy", + _0: "RKoopaShell" + }, context, [ + obj.pos.x, + obj.pos.y + ]); + let new_obj$1 = match$1[1]; + let new_spr$1 = match$1[0]; + normalize_pos(new_obj$1.pos, spr.params, new_spr$1.params); + return { + TAG: "Enemy", + _0: "RKoopaShell", + _1: new_spr$1, + _2: new_obj$1 + }; case "GKoopaShell" : case "RKoopaShell" : - break; - + break; } obj.dir = player_dir; if (obj.vel.x !== 0) { @@ -1261,28 +1247,26 @@ function col_bypass(c1, c2) { let ctypes; switch (c1.TAG) { case "Player" : - ctypes = c2.TAG === "Enemy" ? c1._2.invuln > 0 : false; - break; + ctypes = c2.TAG === "Enemy" ? c1._2.invuln > 0 : false; + break; case "Enemy" : - ctypes = c2.TAG === "Item" ? true : false; - break; + ctypes = c2.TAG === "Item" ? true : false; + break; case "Item" : - switch (c2.TAG) { - case "Enemy" : - case "Item" : - ctypes = true; - break; - case "Player" : - case "Block" : - ctypes = false; - break; - - } - break; + switch (c2.TAG) { + case "Enemy" : + case "Item" : + ctypes = true; + break; + case "Player" : + case "Block" : + ctypes = false; + break; + } + break; case "Block" : - ctypes = false; - break; - + ctypes = false; + break; } if (o1.kill || o2.kill) { return true; @@ -1327,95 +1311,94 @@ function check_collision(c1, c2) { function kill(collid, ctx) { switch (collid.TAG) { case "Player" : - return /* [] */0; + return /* [] */0; case "Enemy" : - let o = collid._2; - let pos_0 = o.pos.x; - let pos_1 = o.pos.y; - let pos = [ - pos_0, - pos_1 - ]; - let score = o.score > 0 ? ({ - hd: make_score(o.score, pos, ctx), - tl: /* [] */0 - }) : /* [] */0; - let remains; - remains = collid._0 === "Goomba" ? ({ - hd: make$1(undefined, undefined, "GoombaSquish", pos, ctx), - tl: /* [] */0 - }) : /* [] */0; - return Pervasives.$at(score, remains); + let o = collid._2; + let pos_0 = o.pos.x; + let pos_1 = o.pos.y; + let pos = [ + pos_0, + pos_1 + ]; + let score = o.score > 0 ? ({ + hd: make_score(o.score, pos, ctx), + tl: /* [] */0 + }) : /* [] */0; + let remains; + remains = collid._0 === "Goomba" ? ({ + hd: make$1(undefined, undefined, "GoombaSquish", pos, ctx), + tl: /* [] */0 + }) : /* [] */0; + return Pervasives.$at(score, remains); case "Item" : - let o$1 = collid._2; - if (collid._0 === "Mushroom") { - return { - hd: make_score(o$1.score, [ - o$1.pos.x, - o$1.pos.y - ], ctx), - tl: /* [] */0 - }; - } else { - return /* [] */0; - } - case "Block" : - let o$2 = collid._2; - let tmp = collid._0; - if (typeof tmp === "object") { - return /* [] */0; - } - if (tmp !== "Brick") { - return /* [] */0; - } - let pos_0$1 = o$2.pos.x; - let pos_1$1 = o$2.pos.y; - let pos$1 = [ - pos_0$1, - pos_1$1 - ]; - let p1 = make$1([ - -5, - -5 - ], [ - 0, - 0.2 - ], "BrickChunkL", pos$1, ctx); - let p2 = make$1([ - -3, - -4 - ], [ - 0, - 0.2 - ], "BrickChunkL", pos$1, ctx); - let p3 = make$1([ - 3, - -4 - ], [ - 0, - 0.2 - ], "BrickChunkR", pos$1, ctx); - let p4 = make$1([ - 5, - -5 - ], [ - 0, - 0.2 - ], "BrickChunkR", pos$1, ctx); + let o$1 = collid._2; + if (collid._0 === "Mushroom") { return { - hd: p1, + hd: make_score(o$1.score, [ + o$1.pos.x, + o$1.pos.y + ], ctx), + tl: /* [] */0 + }; + } else { + return /* [] */0; + } + case "Block" : + let o$2 = collid._2; + let tmp = collid._0; + if (typeof tmp === "object") { + return /* [] */0; + } + if (tmp !== "Brick") { + return /* [] */0; + } + let pos_0$1 = o$2.pos.x; + let pos_1$1 = o$2.pos.y; + let pos$1 = [ + pos_0$1, + pos_1$1 + ]; + let p1 = make$1([ + -5, + -5 + ], [ + 0, + 0.2 + ], "BrickChunkL", pos$1, ctx); + let p2 = make$1([ + -3, + -4 + ], [ + 0, + 0.2 + ], "BrickChunkL", pos$1, ctx); + let p3 = make$1([ + 3, + -4 + ], [ + 0, + 0.2 + ], "BrickChunkR", pos$1, ctx); + let p4 = make$1([ + 5, + -5 + ], [ + 0, + 0.2 + ], "BrickChunkR", pos$1, ctx); + return { + hd: p1, + tl: { + hd: p2, tl: { - hd: p2, + hd: p3, tl: { - hd: p3, - tl: { - hd: p4, - tl: /* [] */0 - } + hd: p4, + tl: /* [] */0 } } - }; - + } + }; } } @@ -1502,11 +1485,11 @@ function game_win(ctx) { ctx.font = "20px 'Press Start 2P'"; ctx.fillText("You win!", 180, 128); throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Game over." - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Game over." + } + }); } function game_loss(ctx) { @@ -1517,11 +1500,11 @@ function game_loss(ctx) { ctx.font = "20px 'Press Start 2P'"; ctx.fillText("GAME OVER. You lose!", 60, 128); throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Game over." - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Game over." + } + }); } let Draw = { @@ -1653,461 +1636,450 @@ function process_collision(dir, c1, c2, state) { let o2$2; switch (c1.TAG) { case "Player" : - let o1$3 = c1._2; - let s1$2 = c1._1; - switch (c2.TAG) { - case "Player" : - return [ - undefined, - undefined - ]; - case "Enemy" : - let o2$3 = c2._2; - let s2$2 = c2._1; - let typ$1 = c2._0; - if (dir === "South") { - s1 = s1$2; - o1 = o1$3; - typ = typ$1; - s2 = s2$2; - o2 = o2$3; - exit = 1; - } else { - s1$1 = s1$2; - o1$1 = o1$3; - t2 = typ$1; - s2$1 = s2$2; - o2$1 = o2$3; - exit = 2; - } - break; - case "Item" : - o1$2 = o1$3; - t2$1 = c2._0; - o2$2 = c2._2; - exit = 3; - break; - case "Block" : - let o2$4 = c2._2; - let t = c2._0; - if (dir === "North") { - if (typeof t !== "object") { - switch (t) { - case "Brick" : - if (c1._0 === "BigM") { - collide_block(undefined, dir, o1$3); - dec_health(o2$4); - return [ - undefined, - undefined - ]; - } else { - collide_block(undefined, dir, o1$3); - return [ - undefined, - undefined - ]; - } - case "Panel" : - game_win(state.ctx); - return [ - undefined, - undefined - ]; - default: - collide_block(undefined, dir, o1$3); - return [ - undefined, - undefined - ]; - } - } else { - let updated_block = evolve_block(o2$4, context); - let spawned_item = spawn_above(o1$3.dir, o2$4, t._0, context); - collide_block(undefined, dir, o1$3); - return [ - spawned_item, - updated_block - ]; - } - } else { - let exit$1 = 0; - if (typeof t !== "object") { - if (t === "Panel") { - game_win(state.ctx); + let o1$3 = c1._2; + let s1$2 = c1._1; + switch (c2.TAG) { + case "Player" : + return [ + undefined, + undefined + ]; + case "Enemy" : + let o2$3 = c2._2; + let s2$2 = c2._1; + let typ$1 = c2._0; + if (dir === "South") { + s1 = s1$2; + o1 = o1$3; + typ = typ$1; + s2 = s2$2; + o2 = o2$3; + exit = 1; + } else { + s1$1 = s1$2; + o1$1 = o1$3; + t2 = typ$1; + s2$1 = s2$2; + o2$1 = o2$3; + exit = 2; + } + break; + case "Item" : + o1$2 = o1$3; + t2$1 = c2._0; + o2$2 = c2._2; + exit = 3; + break; + case "Block" : + let o2$4 = c2._2; + let t = c2._0; + if (dir === "North") { + if (typeof t !== "object") { + switch (t) { + case "Brick" : + if (c1._0 === "BigM") { + collide_block(undefined, dir, o1$3); + dec_health(o2$4); return [ undefined, undefined ]; - } - exit$1 = 4; - } else { - exit$1 = 4; - } - if (exit$1 === 4) { - if (dir === "South") { - state.multiplier = 1; + } else { collide_block(undefined, dir, o1$3); return [ undefined, undefined ]; } + case "Panel" : + game_win(state.ctx); + return [ + undefined, + undefined + ]; + default: collide_block(undefined, dir, o1$3); return [ undefined, undefined ]; - } - } - break; - - } - break; + } else { + let updated_block = evolve_block(o2$4, context); + let spawned_item = spawn_above(o1$3.dir, o2$4, t._0, context); + collide_block(undefined, dir, o1$3); + return [ + spawned_item, + updated_block + ]; + } + } else { + let exit$1 = 0; + if (typeof t !== "object") { + if (t === "Panel") { + game_win(state.ctx); + return [ + undefined, + undefined + ]; + } + exit$1 = 4; + } else { + exit$1 = 4; + } + if (exit$1 === 4) { + if (dir === "South") { + state.multiplier = 1; + collide_block(undefined, dir, o1$3); + return [ + undefined, + undefined + ]; + } + collide_block(undefined, dir, o1$3); + return [ + undefined, + undefined + ]; + } + + } + break; + } + break; case "Enemy" : - let o1$4 = c1._2; - let s1$3 = c1._1; - let t1 = c1._0; - switch (c2.TAG) { - case "Player" : - let o1$5 = c2._2; - let s1$4 = c2._1; - if (dir === "North") { - s1 = s1$4; - o1 = o1$5; - typ = t1; - s2 = s1$3; - o2 = o1$4; - exit = 1; - } else { - s1$1 = s1$4; - o1$1 = o1$5; - t2 = t1; - s2$1 = s1$3; - o2$1 = o1$4; - exit = 2; + let o1$4 = c1._2; + let s1$3 = c1._1; + let t1 = c1._0; + switch (c2.TAG) { + case "Player" : + let o1$5 = c2._2; + let s1$4 = c2._1; + if (dir === "North") { + s1 = s1$4; + o1 = o1$5; + typ = t1; + s2 = s1$3; + o2 = o1$4; + exit = 1; + } else { + s1$1 = s1$4; + o1$1 = o1$5; + t2 = t1; + s2$1 = s1$3; + o2$1 = o1$4; + exit = 2; + } + break; + case "Enemy" : + let t2$2 = c2._0; + let s2$3 = c2._1; + let o2$5 = c2._2; + let exit$2 = 0; + switch (t1) { + case "GKoopaShell" : + switch (t2$2) { + case "GKoopaShell" : + case "RKoopaShell" : + exit$2 = 1; + break; + default: + exit$2 = 2; } break; - case "Enemy" : - let t2$2 = c2._0; - let s2$3 = c2._1; - let o2$5 = c2._2; - let exit$2 = 0; - switch (t1) { + case "RKoopaShell" : + switch (t2$2) { case "GKoopaShell" : - switch (t2$2) { - case "GKoopaShell" : - case "RKoopaShell" : - exit$2 = 1; - break; - default: - exit$2 = 2; - } - break; case "RKoopaShell" : - switch (t2$2) { - case "GKoopaShell" : - case "RKoopaShell" : - exit$2 = 1; - break; - default: - exit$2 = 2; - } - break; + exit$2 = 1; + break; default: - switch (t2$2) { - case "GKoopaShell" : - case "RKoopaShell" : - exit$2 = 3; - break; - default: - let exit$3 = 0; - switch (dir) { - case "North" : - case "South" : - return [ - undefined, - undefined - ]; - case "East" : - case "West" : - exit$3 = 4; - break; - - } - if (exit$3 === 4) { - rev_dir(o1$4, t1, s1$3); - rev_dir(o2$5, t2$2, s2$3); - return [ - undefined, - undefined - ]; - } - - } + exit$2 = 2; } - switch (exit$2) { - case 1 : - dec_health(o1$4); - dec_health(o2$5); - return [ - undefined, - undefined - ]; - case 2 : - if (o1$4.vel.x === 0) { - rev_dir(o2$5, t2$2, s2$3); - return [ - undefined, - undefined - ]; - } else { - dec_health(o2$5); - return [ - undefined, - undefined - ]; - } - case 3 : - if (o2$5.vel.x === 0) { - rev_dir(o1$4, t1, s1$3); - return [ - undefined, - undefined - ]; - } else { - dec_health(o1$4); + break; + default: + switch (t2$2) { + case "GKoopaShell" : + case "RKoopaShell" : + exit$2 = 3; + break; + default: + let exit$3 = 0; + switch (dir) { + case "North" : + case "South" : return [ undefined, undefined ]; - } - + case "East" : + case "West" : + exit$3 = 4; + break; + } + if (exit$3 === 4) { + rev_dir(o1$4, t1, s1$3); + rev_dir(o2$5, t2$2, s2$3); + return [ + undefined, + undefined + ]; + } + + } + } + switch (exit$2) { + case 1 : + dec_health(o1$4); + dec_health(o2$5); + return [ + undefined, + undefined + ]; + case 2 : + if (o1$4.vel.x === 0) { + rev_dir(o2$5, t2$2, s2$3); + return [ + undefined, + undefined + ]; + } else { + dec_health(o2$5); + return [ + undefined, + undefined + ]; + } + case 3 : + if (o2$5.vel.x === 0) { + rev_dir(o1$4, t1, s1$3); + return [ + undefined, + undefined + ]; + } else { + dec_health(o1$4); + return [ + undefined, + undefined + ]; } - case "Item" : + } + case "Item" : + return [ + undefined, + undefined + ]; + case "Block" : + let o2$6 = c2._2; + let t2$3 = c2._0; + let exit$4 = 0; + switch (dir) { + case "North" : + case "South" : + collide_block(undefined, dir, o1$4); return [ undefined, undefined ]; - case "Block" : - let o2$6 = c2._2; - let t2$3 = c2._0; - let exit$4 = 0; - switch (dir) { - case "North" : - case "South" : - collide_block(undefined, dir, o1$4); + case "East" : + case "West" : + exit$4 = 4; + break; + } + if (exit$4 === 4) { + let exit$5 = 0; + let typ$2; + switch (t1) { + case "GKoopaShell" : + if (typeof t2$3 !== "object") { + if (t2$3 === "Brick") { + dec_health(o2$6); + reverse_left_right(o1$4); return [ undefined, undefined ]; - case "East" : - case "West" : - exit$4 = 4; - break; - - } - if (exit$4 === 4) { - let exit$5 = 0; - let typ$2; - switch (t1) { - case "GKoopaShell" : - if (typeof t2$3 !== "object") { - if (t2$3 === "Brick") { - dec_health(o2$6); - reverse_left_right(o1$4); - return [ - undefined, - undefined - ]; - } - exit$5 = 5; - } else { - typ$2 = t2$3._0; - exit$5 = 6; - } - break; - case "RKoopaShell" : - if (typeof t2$3 !== "object") { - if (t2$3 === "Brick") { - dec_health(o2$6); - reverse_left_right(o1$4); - return [ - undefined, - undefined - ]; - } - exit$5 = 5; - } else { - typ$2 = t2$3._0; - exit$5 = 6; - } - break; - default: - exit$5 = 5; - } - switch (exit$5) { - case 5 : - rev_dir(o1$4, t1, s1$3); - return [ - undefined, - undefined - ]; - case 6 : - let updated_block$1 = evolve_block(o2$6, context); - let spawned_item$1 = spawn_above(o1$4.dir, o2$6, typ$2, context); - rev_dir(o1$4, t1, s1$3); - return [ - updated_block$1, - spawned_item$1 - ]; - + } + exit$5 = 5; + } else { + typ$2 = t2$3._0; + exit$5 = 6; } - } - break; - - } - break; + break; + case "RKoopaShell" : + if (typeof t2$3 !== "object") { + if (t2$3 === "Brick") { + dec_health(o2$6); + reverse_left_right(o1$4); + return [ + undefined, + undefined + ]; + } + exit$5 = 5; + } else { + typ$2 = t2$3._0; + exit$5 = 6; + } + break; + default: + exit$5 = 5; + } + switch (exit$5) { + case 5 : + rev_dir(o1$4, t1, s1$3); + return [ + undefined, + undefined + ]; + case 6 : + let updated_block$1 = evolve_block(o2$6, context); + let spawned_item$1 = spawn_above(o1$4.dir, o2$6, typ$2, context); + rev_dir(o1$4, t1, s1$3); + return [ + updated_block$1, + spawned_item$1 + ]; + } + } + break; + } + break; case "Item" : - let o2$7 = c1._2; - switch (c2.TAG) { - case "Player" : - o1$2 = c2._2; - t2$1 = c1._0; - o2$2 = o2$7; - exit = 3; - break; - case "Enemy" : - case "Item" : + let o2$7 = c1._2; + switch (c2.TAG) { + case "Player" : + o1$2 = c2._2; + t2$1 = c1._0; + o2$2 = o2$7; + exit = 3; + break; + case "Enemy" : + case "Item" : + return [ + undefined, + undefined + ]; + case "Block" : + switch (dir) { + case "North" : + case "South" : + collide_block(undefined, dir, o2$7); return [ undefined, undefined ]; - case "Block" : - switch (dir) { - case "North" : - case "South" : - collide_block(undefined, dir, o2$7); - return [ - undefined, - undefined - ]; - case "East" : - case "West" : - reverse_left_right(o2$7); - return [ - undefined, - undefined - ]; - - } - - } - break; + case "East" : + case "West" : + reverse_left_right(o2$7); + return [ + undefined, + undefined + ]; + } + } + break; case "Block" : - return [ - undefined, - undefined - ]; - + return [ + undefined, + undefined + ]; } switch (exit) { case 1 : - o1.invuln = 10; - o1.jumping = false; - o1.grounded = true; - switch (typ) { - case "GKoopaShell" : - case "RKoopaShell" : - break; - default: - dec_health(o2); - o1.vel.y = - 4; - if (state.multiplier === 8) { - update_score(state, 800); - o2.score = 800; - return [ - undefined, - evolve_enemy(o1.dir, typ, s2, o2, context) - ]; - } - let score = Math.imul(100, state.multiplier); - update_score(state, score); - o2.score = score; - state.multiplier = (state.multiplier << 1); + o1.invuln = 10; + o1.jumping = false; + o1.grounded = true; + switch (typ) { + case "GKoopaShell" : + case "RKoopaShell" : + break; + default: + dec_health(o2); + o1.vel.y = - 4; + if (state.multiplier === 8) { + update_score(state, 800); + o2.score = 800; return [ undefined, evolve_enemy(o1.dir, typ, s2, o2, context) ]; - } - let r2 = evolve_enemy(o1.dir, typ, s2, o2, context); - o1.vel.y = - 4; - o1.pos.y = o1.pos.y - 5; - return [ - undefined, - r2 - ]; + } + let score = Math.imul(100, state.multiplier); + update_score(state, score); + o2.score = score; + state.multiplier = (state.multiplier << 1); + return [ + undefined, + evolve_enemy(o1.dir, typ, s2, o2, context) + ]; + } + let r2 = evolve_enemy(o1.dir, typ, s2, o2, context); + o1.vel.y = - 4; + o1.pos.y = o1.pos.y - 5; + return [ + undefined, + r2 + ]; case 2 : - switch (t2) { - case "GKoopaShell" : - case "RKoopaShell" : - break; - default: - dec_health(o1$1); - o1$1.invuln = 60; - return [ - undefined, - undefined - ]; - } - let r2$1 = o2$1.vel.x === 0 ? evolve_enemy(o1$1.dir, t2, s2$1, o2$1, context) : (dec_health(o1$1), o1$1.invuln = 60, undefined); - return [ - undefined, - r2$1 - ]; + switch (t2) { + case "GKoopaShell" : + case "RKoopaShell" : + break; + default: + dec_health(o1$1); + o1$1.invuln = 60; + return [ + undefined, + undefined + ]; + } + let r2$1 = o2$1.vel.x === 0 ? evolve_enemy(o1$1.dir, t2, s2$1, o2$1, context) : (dec_health(o1$1), o1$1.invuln = 60, undefined); + return [ + undefined, + r2$1 + ]; case 3 : - let exit$6 = 0; - switch (t2$1) { - case "Mushroom" : - dec_health(o2$2); - if (o1$2.health === 2) { - - } else { - o1$2.health = o1$2.health + 1 | 0; - } - o1$2.vel.x = 0; - o1$2.vel.y = 0; - update_score(state, 1000); - o2$2.score = 1000; - return [ - undefined, - undefined - ]; - case "FireFlower" : - case "Star" : - exit$6 = 4; - break; - case "Coin" : - state.coins = state.coins + 1 | 0; - dec_health(o2$2); - update_score(state, 100); - return [ - undefined, - undefined - ]; - - } - if (exit$6 === 4) { + let exit$6 = 0; + switch (t2$1) { + case "Mushroom" : dec_health(o2$2); + if (o1$2.health === 2) { + + } else { + o1$2.health = o1$2.health + 1 | 0; + } + o1$2.vel.x = 0; + o1$2.vel.y = 0; update_score(state, 1000); + o2$2.score = 1000; return [ undefined, undefined ]; - } - break; - + case "FireFlower" : + case "Star" : + exit$6 = 4; + break; + case "Coin" : + state.coins = state.coins + 1 | 0; + dec_health(o2$2); + update_score(state, 100); + return [ + undefined, + undefined + ]; + } + if (exit$6 === 4) { + dec_health(o2$2); + update_score(state, 1000); + return [ + undefined, + undefined + ]; + } + break; } } @@ -2129,7 +2101,7 @@ function check_collisions(collid, all_collids, state) { let broad = broad_phase(collid, all_collids, state); let _cs = broad; let _acc = /* [] */0; - while(true) { + while (true) { let acc = _acc; let cs = _cs; if (!cs) { @@ -2361,22 +2333,20 @@ function keydown(evt) { if (match >= 41) { switch (match) { case 65 : - pressed_keys.left = true; - break; + pressed_keys.left = true; + break; case 66 : - pressed_keys.bbox = (pressed_keys.bbox + 1 | 0) % 2; - break; + pressed_keys.bbox = (pressed_keys.bbox + 1 | 0) % 2; + break; case 68 : - pressed_keys.right = true; - break; + pressed_keys.right = true; + break; case 83 : - pressed_keys.down = true; - break; + pressed_keys.down = true; + break; case 87 : - pressed_keys.up = true; - break; - default: - + pressed_keys.up = true; + break; } } else if (match >= 32) { switch (match) { @@ -2384,21 +2354,20 @@ function keydown(evt) { case 34 : case 35 : case 36 : - break; + break; case 37 : - pressed_keys.left = true; - break; + pressed_keys.left = true; + break; case 32 : case 38 : - pressed_keys.up = true; - break; + pressed_keys.up = true; + break; case 39 : - pressed_keys.right = true; - break; + pressed_keys.right = true; + break; case 40 : - pressed_keys.down = true; - break; - + pressed_keys.down = true; + break; } } return true; @@ -2432,21 +2401,20 @@ function keyup(evt) { case 34 : case 35 : case 36 : - break; + break; case 37 : - pressed_keys.left = false; - break; + pressed_keys.left = false; + break; case 32 : case 38 : - pressed_keys.up = false; - break; + pressed_keys.up = false; + break; case 39 : - pressed_keys.right = false; - break; + pressed_keys.right = false; + break; case 40 : - pressed_keys.down = false; - break; - + pressed_keys.down = false; + break; } } return true; @@ -2459,7 +2427,7 @@ let Director = { }; function mem_loc(checkloc, _loclist) { - while(true) { + while (true) { let loclist = _loclist; if (!loclist) { return false; @@ -2492,48 +2460,48 @@ function convert_list(lst) { function choose_enemy_typ(typ) { switch (typ) { case 0 : - return "RKoopa"; + return "RKoopa"; case 1 : - return "GKoopa"; + return "GKoopa"; case 2 : - return "Goomba"; + return "Goomba"; default: throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Shouldn't reach here" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Shouldn't reach here" + } + }); } } function choose_sblock_typ(typ) { switch (typ) { case 0 : - return "Brick"; + return "Brick"; case 1 : - return "UnBBlock"; + return "UnBBlock"; case 2 : - return "Cloud"; + return "Cloud"; case 3 : - return { - TAG: "QBlock", - _0: "Mushroom" - }; + return { + TAG: "QBlock", + _0: "Mushroom" + }; case 4 : - return "Ground"; + return "Ground"; default: throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Shouldn't reach here" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Shouldn't reach here" + } + }); } } function avoid_overlap(_lst, currentLst) { - while(true) { + while (true) { let lst = _lst; if (!lst) { return /* [] */0; @@ -2552,7 +2520,7 @@ function avoid_overlap(_lst, currentLst) { } function trim_edges(_lst, blockw, blockh) { - while(true) { + while (true) { let lst = _lst; if (!lst) { return /* [] */0; @@ -2592,7 +2560,7 @@ function generate_clouds(cbx, cby, typ, num) { } function generate_coins(_block_coord) { - while(true) { + while (true) { let block_coord = _block_coord; let place_coin = Random.int(2); if (!block_coord) { @@ -2629,86 +2597,18 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { let middle_block = life_block_chance === 0 ? 3 : stair_typ; switch (prob) { case 0 : - if (blockw - cbx > 2) { - return { - hd: [ - stair_typ, - [ - cbx, - cby - ] - ], - tl: { - hd: [ - middle_block, - [ - cbx + 1, - cby - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx + 2, - cby - ] - ], - tl: /* [] */0 - } - } - }; - } else if (blockw - cbx > 1) { - return { - hd: [ - block_typ, - [ - cbx, - cby - ] - ], - tl: { - hd: [ - block_typ, - [ - cbx + 1, - cby - ] - ], - tl: /* [] */0 - } - }; - } else { - return { - hd: [ - block_typ, - [ - cbx, - cby - ] - ], - tl: /* [] */0 - }; - } - case 1 : - let num_clouds = Random.int(5) + 5 | 0; - if (cby < 5) { - return generate_clouds(cbx, cby, 2, num_clouds); - } else { - return /* [] */0; - } - case 2 : - if (blockh - cby === 1) { - let four_0 = [ + if (blockw - cbx > 2) { + return { + hd: [ stair_typ, [ cbx, cby ] - ]; - let four_1 = { + ], + tl: { hd: [ - stair_typ, + middle_block, [ cbx + 1, cby @@ -2722,102 +2622,71 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { cby ] ], - tl: { - hd: [ - stair_typ, - [ - cbx + 3, - cby - ] - ], - tl: /* [] */0 - } - } - }; - let four = { - hd: four_0, - tl: four_1 - }; - let three_0 = [ - stair_typ, - [ - cbx + 1, - cby - 1 - ] - ]; - let three_1 = { - hd: [ - stair_typ, - [ - cbx + 2, - cby - 1 - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx + 3, - cby - 1 - ] - ], tl: /* [] */0 } - }; - let three = { - hd: three_0, - tl: three_1 - }; - let two_0 = [ - stair_typ, + } + }; + } else if (blockw - cbx > 1) { + return { + hd: [ + block_typ, [ - cbx + 2, - cby - 2 + cbx, + cby ] - ]; - let two_1 = { + ], + tl: { hd: [ - stair_typ, + block_typ, [ - cbx + 3, - cby - 2 + cbx + 1, + cby ] ], tl: /* [] */0 - }; - let two = { - hd: two_0, - tl: two_1 - }; - let one_0 = [ - stair_typ, + } + }; + } else { + return { + hd: [ + block_typ, [ - cbx + 3, - cby - 3 + cbx, + cby ] - ]; - let one = { - hd: one_0, - tl: /* [] */0 - }; - return Pervasives.$at(four, Pervasives.$at(three, Pervasives.$at(two, one))); - } else { - return /* [] */0; - } - case 3 : - if (stair_typ === 0 && blockh - cby > 3) { - let three_0$1 = [ + ], + tl: /* [] */0 + }; + } + case 1 : + let num_clouds = Random.int(5) + 5 | 0; + if (cby < 5) { + return generate_clouds(cbx, cby, 2, num_clouds); + } else { + return /* [] */0; + } + case 2 : + if (blockh - cby === 1) { + let four_0 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + let four_1 = { + hd: [ stair_typ, [ - cbx, + cbx + 1, cby ] - ]; - let three_1$1 = { + ], + tl: { hd: [ stair_typ, [ - cbx + 1, + cbx + 2, cby ] ], @@ -2825,165 +2694,292 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { hd: [ stair_typ, [ - cbx + 2, + cbx + 3, cby ] ], tl: /* [] */0 } - }; - let three$1 = { - hd: three_0$1, - tl: three_1$1 - }; - let two_0$1 = [ + } + }; + let four = { + hd: four_0, + tl: four_1 + }; + let three_0 = [ + stair_typ, + [ + cbx + 1, + cby - 1 + ] + ]; + let three_1 = { + hd: [ stair_typ, [ cbx + 2, - cby + 1 + cby - 1 ] - ]; - let two_1$1 = { + ], + tl: { hd: [ stair_typ, [ cbx + 3, - cby + 1 + cby - 1 ] ], tl: /* [] */0 - }; - let two$1 = { - hd: two_0$1, - tl: two_1$1 - }; - let one_0$1 = [ + } + }; + let three = { + hd: three_0, + tl: three_1 + }; + let two_0 = [ + stair_typ, + [ + cbx + 2, + cby - 2 + ] + ]; + let two_1 = { + hd: [ stair_typ, [ - cbx + 5, - cby + 2 + cbx + 3, + cby - 2 ] - ]; - let one_1 = { - hd: [ - stair_typ, - [ - cbx + 6, - cby + 2 - ] - ], - tl: /* [] */0 - }; - let one$1 = { - hd: one_0$1, - tl: one_1 - }; - return Pervasives.$at(three$1, Pervasives.$at(two$1, one$1)); - } else if (blockh - cby > 2) { - let one_0$2 = [ + ], + tl: /* [] */0 + }; + let two = { + hd: two_0, + tl: two_1 + }; + let one_0 = [ + stair_typ, + [ + cbx + 3, + cby - 3 + ] + ]; + let one = { + hd: one_0, + tl: /* [] */0 + }; + return Pervasives.$at(four, Pervasives.$at(three, Pervasives.$at(two, one))); + } else { + return /* [] */0; + } + case 3 : + if (stair_typ === 0 && blockh - cby > 3) { + let three_0$1 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + let three_1$1 = { + hd: [ stair_typ, [ - cbx, + cbx + 1, cby ] - ]; - let one_1$1 = { + ], + tl: { hd: [ stair_typ, [ - cbx + 1, + cbx + 2, cby ] ], tl: /* [] */0 - }; - let one$2 = { - hd: one_0$2, - tl: one_1$1 - }; - let two_0$2 = [ + } + }; + let three$1 = { + hd: three_0$1, + tl: three_1$1 + }; + let two_0$1 = [ + stair_typ, + [ + cbx + 2, + cby + 1 + ] + ]; + let two_1$1 = { + hd: [ stair_typ, [ cbx + 3, - cby - 1 + cby + 1 ] - ]; - let two_1$2 = { - hd: [ - stair_typ, - [ - cbx + 4, - cby - 1 - ] - ], - tl: /* [] */0 - }; - let two$2 = { - hd: two_0$2, - tl: two_1$2 - }; - let three_0$2 = [ + ], + tl: /* [] */0 + }; + let two$1 = { + hd: two_0$1, + tl: two_1$1 + }; + let one_0$1 = [ + stair_typ, + [ + cbx + 5, + cby + 2 + ] + ]; + let one_1 = { + hd: [ + stair_typ, + [ + cbx + 6, + cby + 2 + ] + ], + tl: /* [] */0 + }; + let one$1 = { + hd: one_0$1, + tl: one_1 + }; + return Pervasives.$at(three$1, Pervasives.$at(two$1, one$1)); + } else if (blockh - cby > 2) { + let one_0$2 = [ + stair_typ, + [ + cbx, + cby + ] + ]; + let one_1$1 = { + hd: [ + stair_typ, + [ + cbx + 1, + cby + ] + ], + tl: /* [] */0 + }; + let one$2 = { + hd: one_0$2, + tl: one_1$1 + }; + let two_0$2 = [ + stair_typ, + [ + cbx + 3, + cby - 1 + ] + ]; + let two_1$2 = { + hd: [ stair_typ, [ cbx + 4, + cby - 1 + ] + ], + tl: /* [] */0 + }; + let two$2 = { + hd: two_0$2, + tl: two_1$2 + }; + let three_0$2 = [ + stair_typ, + [ + cbx + 4, + cby - 2 + ] + ]; + let three_1$2 = { + hd: [ + stair_typ, + [ + cbx + 5, cby - 2 ] - ]; - let three_1$2 = { + ], + tl: { hd: [ stair_typ, [ - cbx + 5, + cbx + 6, cby - 2 ] ], - tl: { - hd: [ - stair_typ, - [ - cbx + 6, - cby - 2 - ] - ], - tl: /* [] */0 - } - }; - let three$2 = { - hd: three_0$2, - tl: three_1$2 - }; - return Pervasives.$at(one$2, Pervasives.$at(two$2, three$2)); - } else { - return { - hd: [ - stair_typ, - [ - cbx, - cby - ] - ], tl: /* [] */0 - }; - } + } + }; + let three$2 = { + hd: three_0$2, + tl: three_1$2 + }; + return Pervasives.$at(one$2, Pervasives.$at(two$2, three$2)); + } else { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: /* [] */0 + }; + } case 4 : - if (cby + 3 - blockh === 2) { - return { + if (cby + 3 - blockh === 2) { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: /* [] */0 + }; + } else if (cby + 3 - blockh === 1) { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ stair_typ, [ cbx, - cby + cby + 1 ] ], tl: /* [] */0 - }; - } else if (cby + 3 - blockh === 1) { - return { + } + }; + } else { + return { + hd: [ + stair_typ, + [ + cbx, + cby + ] + ], + tl: { hd: [ stair_typ, [ cbx, - cby + cby + 1 ] ], tl: { @@ -2991,65 +2987,37 @@ function choose_block_pattern(blockw, blockh, cbx, cby, prob) { stair_typ, [ cbx, - cby + 1 + cby + 2 ] ], tl: /* [] */0 } - }; - } else { - return { - hd: [ - stair_typ, - [ - cbx, - cby - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx, - cby + 1 - ] - ], - tl: { - hd: [ - stair_typ, - [ - cbx, - cby + 2 - ] - ], - tl: /* [] */0 - } - } - }; - } - case 5 : - return { - hd: [ - 3, - [ - cbx, - cby - ] - ], - tl: /* [] */0 + } }; + } + case 5 : + return { + hd: [ + 3, + [ + cbx, + cby + ] + ], + tl: /* [] */0 + }; default: throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Shouldn't reach here" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Shouldn't reach here" + } + }); } } function generate_enemies(blockw, blockh, _cbx, _cby, acc) { - while(true) { + while (true) { let cby = _cby; let cbx = _cbx; if (cbx > blockw - 32) { @@ -3088,7 +3056,7 @@ function generate_enemies(blockw, blockh, _cbx, _cby, acc) { } function generate_block_enemies(_block_coord) { - while(true) { + while (true) { let block_coord = _block_coord; let place_enemy = Random.int(20); let enemy_typ = Random.int(3); @@ -3117,7 +3085,7 @@ function generate_block_enemies(_block_coord) { } function generate_block_locs(blockw, blockh, _cbx, _cby, _acc) { - while(true) { + while (true) { let acc = _acc; let cby = _cby; let cbx = _cbx; @@ -3161,7 +3129,7 @@ function generate_panel(context, blockw, blockh) { } function generate_ground(blockw, blockh, _inc, _acc) { - while(true) { + while (true) { let acc = _acc; let inc = _inc; if (inc > blockw) { @@ -3314,11 +3282,11 @@ function load(param) { } else { console.log("cant find canvas " + canvas_id); throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "fail" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "fail" + } + }); } let context = canvas.getContext("2d"); document.addEventListener("keydown", keydown, true); diff --git a/jscomp/test/miss_colon_test.js b/jscomp/test/miss_colon_test.js index 8d8658bc50..00fe9286d4 100644 --- a/jscomp/test/miss_colon_test.js +++ b/jscomp/test/miss_colon_test.js @@ -3,7 +3,7 @@ function $plus$colon(_f, _g) { - while(true) { + while (true) { let g = _g; let f = _f; if (f.TAG === "Int") { @@ -21,33 +21,32 @@ function $plus$colon(_f, _g) { } switch (g.TAG) { case "Int" : - if (g._0 !== 0) { - return { - TAG: "Add", - _0: f, - _1: g - }; - } else { - return f; - } - case "Add" : - _g = g._1; - _f = $plus$colon(f, g._0); - continue; - case "Var" : - case "Mul" : + if (g._0 !== 0) { return { TAG: "Add", _0: f, _1: g }; - + } else { + return f; + } + case "Add" : + _g = g._1; + _f = $plus$colon(f, g._0); + continue; + case "Var" : + case "Mul" : + return { + TAG: "Add", + _0: f, + _1: g + }; } }; } function $star$colon(_f, _g) { - while(true) { + while (true) { let g = _g; let f = _f; let exit = 0; @@ -88,27 +87,26 @@ function $star$colon(_f, _g) { } switch (g.TAG) { case "Int" : - if (g._0 !== 1) { - return { - TAG: "Mul", - _0: f, - _1: g - }; - } else { - return f; - } - case "Var" : - case "Add" : + if (g._0 !== 1) { return { TAG: "Mul", _0: f, _1: g }; + } else { + return f; + } + case "Var" : + case "Add" : + return { + TAG: "Mul", + _0: f, + _1: g + }; case "Mul" : - _g = g._1; - _f = $star$colon(f, g._0); - continue; - + _g = g._1; + _f = $star$colon(f, g._0); + continue; } }; } @@ -117,12 +115,11 @@ function simplify(x) { switch (x.TAG) { case "Int" : case "Var" : - return x; + return x; case "Add" : - return $plus$colon(simplify(x._0), simplify(x._1)); + return $plus$colon(simplify(x._0), simplify(x._1)); case "Mul" : - return $star$colon(simplify(x._0), simplify(x._1)); - + return $star$colon(simplify(x._0), simplify(x._1)); } } diff --git a/jscomp/test/mock_mt.js b/jscomp/test/mock_mt.js index 70eea7c7fc..e2d271f81b 100644 --- a/jscomp/test/mock_mt.js +++ b/jscomp/test/mock_mt.js @@ -13,72 +13,71 @@ function from_pair_suites(name, suites) { let fn = param[1](); switch (fn.TAG) { case "Eq" : - console.log([ - name, - fn._0, - "eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "eq?", + fn._1 + ]); + return; case "Neq" : - console.log([ - name, - fn._0, - "neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "neq?", + fn._1 + ]); + return; case "StrictEq" : - console.log([ - name, - fn._0, - "strict_eq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_eq?", + fn._1 + ]); + return; case "StrictNeq" : - console.log([ - name, - fn._0, - "strict_neq?", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "strict_neq?", + fn._1 + ]); + return; case "Ok" : - console.log([ - name, - fn._0, - "ok?" - ]); - return; + console.log([ + name, + fn._0, + "ok?" + ]); + return; case "Approx" : - console.log([ - name, - fn._0, - "~", - fn._1 - ]); - return; + console.log([ + name, + fn._0, + "~", + fn._1 + ]); + return; case "ApproxThreshold" : - console.log([ - name, - fn._1, - "~", - fn._2, - " (", - fn._0, - ")" - ]); - return; + console.log([ + name, + fn._1, + "~", + fn._2, + " (", + fn._0, + ")" + ]); + return; case "ThrowAny" : - return; + return; case "Fail" : - console.log("failed"); - return; + console.log("failed"); + return; case "FailWith" : - console.log("failed: " + fn._0); - return; - + console.log("failed: " + fn._0); + return; } }), suites); } diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index 19b896e753..8f4c47e25f 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -52,46 +52,45 @@ function close_enough(thresholdOpt, a, b) { function handleCode(spec) { switch (spec.TAG) { case "Eq" : - Assert.deepEqual(spec._0, spec._1); - return; + Assert.deepEqual(spec._0, spec._1); + return; case "Neq" : - Assert.notDeepEqual(spec._0, spec._1); - return; + Assert.notDeepEqual(spec._0, spec._1); + return; case "StrictEq" : - Assert.strictEqual(spec._0, spec._1); - return; + Assert.strictEqual(spec._0, spec._1); + return; case "StrictNeq" : - Assert.notStrictEqual(spec._0, spec._1); - return; + Assert.notStrictEqual(spec._0, spec._1); + return; case "Ok" : - Assert.ok(spec._0); - return; + Assert.ok(spec._0); + return; case "Approx" : - let b = spec._1; - let a = spec._0; - if (!close_enough(undefined, a, b)) { - Assert.deepEqual(a, b); - return; - } else { - return; - } + let b = spec._1; + let a = spec._0; + if (!close_enough(undefined, a, b)) { + Assert.deepEqual(a, b); + return; + } else { + return; + } case "ApproxThreshold" : - let b$1 = spec._2; - let a$1 = spec._1; - if (!close_enough(spec._0, a$1, b$1)) { - Assert.deepEqual(a$1, b$1); - return; - } else { - return; - } - case "ThrowAny" : - Assert.throws(spec._0); + let b$1 = spec._2; + let a$1 = spec._1; + if (!close_enough(spec._0, a$1, b$1)) { + Assert.deepEqual(a$1, b$1); return; + } else { + return; + } + case "ThrowAny" : + Assert.throws(spec._0); + return; case "Fail" : - return assert_fail("failed"); + return assert_fail("failed"); case "FailWith" : - return assert_fail(spec._0); - + return assert_fail(spec._0); } } diff --git a/jscomp/test/noassert.js b/jscomp/test/noassert.js index 9335aecfc6..249a4ce2fb 100644 --- a/jscomp/test/noassert.js +++ b/jscomp/test/noassert.js @@ -4,15 +4,15 @@ function f() { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "noassert.res", - 1, - 14 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "noassert.res", + 1, + 14 + ] + } + }); } function h() { diff --git a/jscomp/test/number_lexer.js b/jscomp/test/number_lexer.js index abd9c0a68c..3d5a297fb1 100644 --- a/jscomp/test/number_lexer.js +++ b/jscomp/test/number_lexer.js @@ -121,50 +121,50 @@ let __ocaml_lex_tables = { }; function __ocaml_lex_token_rec(l, lexbuf, ___ocaml_lex_state) { - while(true) { + while (true) { let __ocaml_lex_state = ___ocaml_lex_state; let __ocaml_lex_state$1 = Lexing.engine(__ocaml_lex_tables, __ocaml_lex_state, lexbuf); switch (__ocaml_lex_state$1) { case 0 : - l("new line"); - ___ocaml_lex_state = 0; - continue; + l("new line"); + ___ocaml_lex_state = 0; + continue; case 1 : - l("number"); - l(Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 0; - continue; + l("number"); + l(Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 0; + continue; case 2 : - l("ident"); - l(Lexing.lexeme(lexbuf)); - ___ocaml_lex_state = 0; - continue; + l("ident"); + l(Lexing.lexeme(lexbuf)); + ___ocaml_lex_state = 0; + continue; case 3 : - l("+"); - ___ocaml_lex_state = 0; - continue; + l("+"); + ___ocaml_lex_state = 0; + continue; case 4 : - l("-"); - ___ocaml_lex_state = 0; - continue; + l("-"); + ___ocaml_lex_state = 0; + continue; case 5 : - l("*"); - ___ocaml_lex_state = 0; - continue; + l("*"); + ___ocaml_lex_state = 0; + continue; case 6 : - l("/"); - ___ocaml_lex_state = 0; - continue; + l("/"); + ___ocaml_lex_state = 0; + continue; case 7 : - l("("); - ___ocaml_lex_state = 0; - continue; + l("("); + ___ocaml_lex_state = 0; + continue; case 8 : - l(")"); - ___ocaml_lex_state = 0; - continue; + l(")"); + ___ocaml_lex_state = 0; + continue; case 9 : - return l("eof"); + return l("eof"); default: lexbuf.refill_buff(lexbuf); ___ocaml_lex_state = __ocaml_lex_state$1; diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 4ec6be2f10..7bf28c6f0b 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -44,7 +44,7 @@ function eq(loc, x, y) { } function union(_l, _l$p) { - while(true) { + while (true) { let l$p = _l$p; let l = _l; if (!l$p) { @@ -103,7 +103,7 @@ function union(_l, _l$p) { } function inter(_l, _l$p) { - while(true) { + while (true) { let l$p = _l$p; let l = _l; if (!l$p) { @@ -149,7 +149,7 @@ function inter(_l, _l$p) { } function diff(_l, _l$p) { - while(true) { + while (true) { let l$p = _l$p; let l = _l; if (!l$p) { @@ -246,7 +246,7 @@ function offset(o, l) { } function mem(c, _s) { - while(true) { + while (true) { let s = _s; if (!s) { return false; @@ -321,11 +321,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -338,11 +338,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -356,11 +356,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -373,11 +373,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, param) { @@ -522,11 +522,11 @@ function bal$1(l, v, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -538,11 +538,11 @@ function bal$1(l, v, r) { return create$1(create$1(ll, lv, lr.l), lr.v, create$1(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -555,11 +555,11 @@ function bal$1(l, v, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -571,11 +571,11 @@ function bal$1(l, v, r) { return create$1(create$1(l, v, rl.l), rl.v, create$1(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } function add$1(x, param) { @@ -623,7 +623,7 @@ let empty = { function hash(m, accu) { let _l = m.marks; let _accu = hash_combine(Hashtbl.hash(m.pmarks), accu); - while(true) { + while (true) { let accu$1 = _accu; let l = _l; if (!l) { @@ -662,7 +662,7 @@ function marks_set_idx$1(marks, idx) { } function first(f, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -788,33 +788,33 @@ function rename(ids, x) { } switch (l.TAG) { case "Alt" : - return mk_expr(ids, { - TAG: "Alt", - _0: List.map((function (extra) { - return rename(ids, extra); - }), l._0) - }); + return mk_expr(ids, { + TAG: "Alt", + _0: List.map((function (extra) { + return rename(ids, extra); + }), l._0) + }); case "Seq" : - return mk_expr(ids, { - TAG: "Seq", - _0: l._0, - _1: rename(ids, l._1), - _2: rename(ids, l._2) - }); + return mk_expr(ids, { + TAG: "Seq", + _0: l._0, + _1: rename(ids, l._1), + _2: rename(ids, l._2) + }); case "Rep" : - return mk_expr(ids, { - TAG: "Rep", - _0: l._0, - _1: l._1, - _2: rename(ids, l._2) - }); + return mk_expr(ids, { + TAG: "Rep", + _0: l._0, + _1: l._1, + _2: rename(ids, l._2) + }); default: return mk_expr(ids, x.def); } } function equal(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -827,72 +827,68 @@ function equal(_l1, _l2) { let marks1 = l1.hd; switch (marks1.TAG) { case "TSeq" : - if (!l2) { + if (!l2) { + return false; + } + let match = l2.hd; + switch (match.TAG) { + case "TSeq" : + if (marks1._1.id !== match._1.id) { + return false; + } + if (!equal(marks1._0, match._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + case "TExp" : + case "TMatch" : return false; - } - let match = l2.hd; - switch (match.TAG) { - case "TSeq" : - if (marks1._1.id !== match._1.id) { - return false; - } - if (!equal(marks1._0, match._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - case "TExp" : - case "TMatch" : - return false; - - } + } case "TExp" : - if (!l2) { + if (!l2) { + return false; + } + let match$1 = l2.hd; + switch (match$1.TAG) { + case "TExp" : + if (marks1._1.id !== match$1._1.id) { + return false; + } + if (!Caml_obj.equal(marks1._0, match$1._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + case "TSeq" : + case "TMatch" : return false; - } - let match$1 = l2.hd; - switch (match$1.TAG) { - case "TExp" : - if (marks1._1.id !== match$1._1.id) { - return false; - } - if (!Caml_obj.equal(marks1._0, match$1._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - case "TSeq" : - case "TMatch" : - return false; - - } + } case "TMatch" : - if (!l2) { + if (!l2) { + return false; + } + let marks2 = l2.hd; + switch (marks2.TAG) { + case "TSeq" : + case "TExp" : return false; - } - let marks2 = l2.hd; - switch (marks2.TAG) { - case "TSeq" : - case "TExp" : - return false; - case "TMatch" : - if (!Caml_obj.equal(marks1._0, marks2._0)) { - return false; - } - _l2 = l2.tl; - _l1 = l1.tl; - continue; - - } - + case "TMatch" : + if (!Caml_obj.equal(marks1._0, marks2._0)) { + return false; + } + _l2 = l2.tl; + _l1 = l1.tl; + continue; + } } }; } function hash$1(_l, _accu) { - while(true) { + while (true) { let accu = _accu; let l = _l; if (!l) { @@ -901,18 +897,17 @@ function hash$1(_l, _accu) { let marks = l.hd; switch (marks.TAG) { case "TSeq" : - _accu = hash_combine(388635598, hash_combine(marks._1.id, hash$1(marks._0, accu))); - _l = l.tl; - continue; + _accu = hash_combine(388635598, hash_combine(marks._1.id, hash$1(marks._0, accu))); + _l = l.tl; + continue; case "TExp" : - _accu = hash_combine(726404471, hash_combine(marks._1.id, hash(marks._0, accu))); - _l = l.tl; - continue; + _accu = hash_combine(726404471, hash_combine(marks._1.id, hash(marks._0, accu))); + _l = l.tl; + continue; case "TMatch" : - _accu = hash_combine(471882453, hash(marks._0, accu)); - _l = l.tl; - continue; - + _accu = hash_combine(471882453, hash(marks._0, accu)); + _l = l.tl; + continue; } }; } @@ -924,22 +919,21 @@ function tseq(kind, x, y, rem) { let match = x.hd; switch (match.TAG) { case "TExp" : - let tmp = match._1.def; - if (typeof tmp !== "object" && !x.tl) { - return { - hd: { - TAG: "TExp", - _0: match._0, - _1: y - }, - tl: rem - }; - } - break; + let tmp = match._1.def; + if (typeof tmp !== "object" && !x.tl) { + return { + hd: { + TAG: "TExp", + _0: match._0, + _1: y + }, + tl: rem + }; + } + break; case "TSeq" : case "TMatch" : - break; - + break; } return { hd: { @@ -1011,11 +1005,10 @@ function mark_used_indices(tbl) { return List.iter((function (x) { switch (x.TAG) { case "TSeq" : - return mark_used_indices(tbl)(x._0); + return mark_used_indices(tbl)(x._0); case "TExp" : case "TMatch" : - break; - + break; } List.iter((function (param) { let i = param[1]; @@ -1029,7 +1022,7 @@ function mark_used_indices(tbl) { } function find_free(tbl, _idx, len) { - while(true) { + while (true) { let idx = _idx; if (idx === len || !Caml_array.get(tbl, idx)) { return idx; @@ -1056,16 +1049,15 @@ function remove_matches(extra) { switch (x.TAG) { case "TSeq" : case "TExp" : - return true; + return true; case "TMatch" : - return false; - + return false; } }), extra); } function split_at_match_rec(_l$p, _x) { - while(true) { + while (true) { let x = _x; let l$p = _l$p; if (x) { @@ -1073,36 +1065,35 @@ function split_at_match_rec(_l$p, _x) { switch (x$1.TAG) { case "TSeq" : case "TExp" : - _x = x.tl; - _l$p = { - hd: x$1, - tl: l$p - }; - continue; + _x = x.tl; + _l$p = { + hd: x$1, + tl: l$p + }; + continue; case "TMatch" : - return [ - List.rev(l$p), - remove_matches(x.tl) - ]; - + return [ + List.rev(l$p), + remove_matches(x.tl) + ]; } } else { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ocaml_re_test.res", - 816, - 16 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ocaml_re_test.res", + 816, + 16 + ] + } + }); } }; } function remove_duplicates(prev, _l, y) { - while(true) { + while (true) { let l = _l; if (!l) { return [ @@ -1113,59 +1104,58 @@ function remove_duplicates(prev, _l, y) { let x = l.hd; switch (x.TAG) { case "TSeq" : - let x$1 = x._1; - let match = remove_duplicates(prev, x._0, x$1); - let match$1 = remove_duplicates(match[1], l.tl, y); - return [ - tseq(x._2, match[0], x$1, match$1[0]), - match$1[1] - ]; + let x$1 = x._1; + let match = remove_duplicates(prev, x._0, x$1); + let match$1 = remove_duplicates(match[1], l.tl, y); + return [ + tseq(x._2, match[0], x$1, match$1[0]), + match$1[1] + ]; case "TExp" : - let x$2 = x._1; - let tmp = x$2.def; - if (typeof tmp !== "object") { - let r = l.tl; - if (List.memq(y.id, prev)) { - _l = r; - continue; - } - let match$2 = remove_duplicates({ - hd: y.id, - tl: prev - }, r, y); - return [ - { - hd: x, - tl: match$2[0] - }, - match$2[1] - ]; - } - let r$1 = l.tl; - if (List.memq(x$2.id, prev)) { - _l = r$1; + let x$2 = x._1; + let tmp = x$2.def; + if (typeof tmp !== "object") { + let r = l.tl; + if (List.memq(y.id, prev)) { + _l = r; continue; } - let match$3 = remove_duplicates({ - hd: x$2.id, + let match$2 = remove_duplicates({ + hd: y.id, tl: prev - }, r$1, y); + }, r, y); return [ { hd: x, - tl: match$3[0] + tl: match$2[0] }, - match$3[1] + match$2[1] ]; + } + let r$1 = l.tl; + if (List.memq(x$2.id, prev)) { + _l = r$1; + continue; + } + let match$3 = remove_duplicates({ + hd: x$2.id, + tl: prev + }, r$1, y); + return [ + { + hd: x, + tl: match$3[0] + }, + match$3[1] + ]; case "TMatch" : - return [ - { - hd: x, - tl: /* [] */0 - }, - prev - ]; - + return [ + { + hd: x, + tl: /* [] */0 + }, + prev + ]; } }; } @@ -1177,33 +1167,32 @@ function set_idx(idx, x) { let marks = x.hd; switch (marks.TAG) { case "TSeq" : - return { - hd: { - TAG: "TSeq", - _0: set_idx(idx, marks._0), - _1: marks._1, - _2: marks._2 - }, - tl: set_idx(idx, x.tl) - }; + return { + hd: { + TAG: "TSeq", + _0: set_idx(idx, marks._0), + _1: marks._1, + _2: marks._2 + }, + tl: set_idx(idx, x.tl) + }; case "TExp" : - return { - hd: { - TAG: "TExp", - _0: marks_set_idx$1(marks._0, idx), - _1: marks._1 - }, - tl: set_idx(idx, x.tl) - }; + return { + hd: { + TAG: "TExp", + _0: marks_set_idx$1(marks._0, idx), + _1: marks._1 + }, + tl: set_idx(idx, x.tl) + }; case "TMatch" : - return { - hd: { - TAG: "TMatch", - _0: marks_set_idx$1(marks._0, idx) - }, - tl: set_idx(idx, x.tl) - }; - + return { + hd: { + TAG: "TMatch", + _0: marks_set_idx$1(marks._0, idx) + }, + tl: set_idx(idx, x.tl) + }; } } @@ -1234,129 +1223,127 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { } switch (s.TAG) { case "Cst" : - if (mem(c, s._0)) { - return { - hd: { - TAG: "TExp", - _0: marks, - _1: eps_expr - }, - tl: rem - }; - } else { - return rem; - } + if (mem(c, s._0)) { + return { + hd: { + TAG: "TExp", + _0: marks, + _1: eps_expr + }, + tl: rem + }; + } else { + return rem; + } case "Alt" : - return delta_2(marks, c, next_cat, prev_cat, s._0, rem); + return delta_2(marks, c, next_cat, prev_cat, s._0, rem); case "Seq" : - let y$p = delta_1(marks, c, next_cat, prev_cat, s._1, /* [] */0); - return delta_seq(c, next_cat, prev_cat, s._0, y$p, s._2, rem); + let y$p = delta_1(marks, c, next_cat, prev_cat, s._1, /* [] */0); + return delta_seq(c, next_cat, prev_cat, s._0, y$p, s._2, rem); case "Rep" : - let kind = s._1; - let y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); - let marks$p = first((function (x) { - switch (x.TAG) { - case "TSeq" : - case "TExp" : - return; - case "TMatch" : - return x._0; - - } - }), y$p$1); - let match = marks$p !== undefined ? [ - remove_matches(y$p$1), - marks$p - ] : [ - y$p$1, - marks - ]; - let y$p$p = match[0]; - if (s._0 === "Non_greedy") { - return { - hd: { - TAG: "TMatch", - _0: marks - }, - tl: tseq(kind, y$p$p, x, rem) - }; - } else { - return tseq(kind, y$p$p, x, { - hd: { - TAG: "TMatch", - _0: match[1] - }, - tl: rem - }); + let kind = s._1; + let y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); + let marks$p = first((function (x) { + switch (x.TAG) { + case "TSeq" : + case "TExp" : + return; + case "TMatch" : + return x._0; } - case "Mark" : - let i = s._0; - let marks_marks = { - hd: [ - i, - -1 - ], - tl: List.remove_assq(i, marks.marks) - }; - let marks_pmarks = marks.pmarks; - let marks$1 = { - marks: marks_marks, - pmarks: marks_pmarks - }; + }), y$p$1); + let match = marks$p !== undefined ? [ + remove_matches(y$p$1), + marks$p + ] : [ + y$p$1, + marks + ]; + let y$p$p = match[0]; + if (s._0 === "Non_greedy") { return { hd: { TAG: "TMatch", - _0: marks$1 + _0: marks }, - tl: rem + tl: tseq(kind, y$p$p, x, rem) }; + } else { + return tseq(kind, y$p$p, x, { + hd: { + TAG: "TMatch", + _0: match[1] + }, + tl: rem + }); + } + case "Mark" : + let i = s._0; + let marks_marks = { + hd: [ + i, + -1 + ], + tl: List.remove_assq(i, marks.marks) + }; + let marks_pmarks = marks.pmarks; + let marks$1 = { + marks: marks_marks, + pmarks: marks_pmarks + }; + return { + hd: { + TAG: "TMatch", + _0: marks$1 + }, + tl: rem + }; case "Erase" : + return { + hd: { + TAG: "TMatch", + _0: filter_marks(s._0, s._1, marks) + }, + tl: rem + }; + case "Before" : + if (intersect(next_cat, s._0)) { return { hd: { TAG: "TMatch", - _0: filter_marks(s._0, s._1, marks) + _0: marks }, tl: rem }; - case "Before" : - if (intersect(next_cat, s._0)) { - return { - hd: { - TAG: "TMatch", - _0: marks - }, - tl: rem - }; - } else { - return rem; - } + } else { + return rem; + } case "After" : - if (intersect(prev_cat, s._0)) { - return { - hd: { - TAG: "TMatch", - _0: marks - }, - tl: rem - }; - } else { - return rem; - } - case "Pmark" : - let marks_marks$1 = marks.marks; - let marks_pmarks$1 = add$1(s._0, marks.pmarks); - let marks$2 = { - marks: marks_marks$1, - pmarks: marks_pmarks$1 - }; + if (intersect(prev_cat, s._0)) { return { hd: { TAG: "TMatch", - _0: marks$2 + _0: marks }, tl: rem }; - + } else { + return rem; + } + case "Pmark" : + let marks_marks$1 = marks.marks; + let marks_pmarks$1 = add$1(s._0, marks.pmarks); + let marks$2 = { + marks: marks_marks$1, + pmarks: marks_pmarks$1 + }; + return { + hd: { + TAG: "TMatch", + _0: marks$2 + }, + tl: rem + }; } } @@ -1373,10 +1360,9 @@ function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { switch (x.TAG) { case "TSeq" : case "TExp" : - return; + return; case "TMatch" : - return x._0; - + return x._0; } }), y); if (marks === undefined) { @@ -1398,16 +1384,15 @@ function delta_4(c, next_cat, prev_cat, l, rem) { let rem$1 = delta_4(c, next_cat, prev_cat, l.tl, rem); switch (x.TAG) { case "TSeq" : - let y$p = delta_4(c, next_cat, prev_cat, x._0, /* [] */0); - return delta_seq(c, next_cat, prev_cat, x._2, y$p, x._1, rem$1); + let y$p = delta_4(c, next_cat, prev_cat, x._0, /* [] */0); + return delta_seq(c, next_cat, prev_cat, x._2, y$p, x._1, rem$1); case "TExp" : - return delta_1(x._0, c, next_cat, prev_cat, x._1, rem$1); + return delta_1(x._0, c, next_cat, prev_cat, x._1, rem$1); case "TMatch" : - return { - hd: x, - tl: rem$1 - }; - + return { + hd: x, + tl: rem$1 + }; } } else { return rem; @@ -1446,17 +1431,16 @@ function status(s) { switch (m.TAG) { case "TSeq" : case "TExp" : - st$1 = "Running"; - break; + st$1 = "Running"; + break; case "TMatch" : - let m$1 = m._0; - st$1 = { - TAG: "Match", - _0: flatten_match(m$1.marks), - _1: m$1.pmarks - }; - break; - + let m$1 = m._0; + st$1 = { + TAG: "Match", + _0: flatten_match(m$1.marks), + _1: m$1.pmarks + }; + break; } } else { st$1 = "Failed"; @@ -1483,7 +1467,7 @@ let Re_automata_State = { }; function iter(_n, f, _v) { - while(true) { + while (true) { let v = _v; let n = _n; if (n === 0) { @@ -1531,8 +1515,7 @@ function mk_state(ncol, desc) { function find_state(re, desc) { try { return Re_automata_State.Table.find(re.states, desc); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let st = mk_state(re.ncol, desc); @@ -1540,8 +1523,8 @@ function find_state(re, desc) { return st; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -1572,7 +1555,7 @@ function loop(info, s, pos, st) { let _pos = pos; let _st = st; let _st$p = st$p; - while(true) { + while (true) { let st$p$1 = _st$p; let st$1 = _st; let pos$1 = _pos; @@ -1602,8 +1585,7 @@ function loop(info, s, pos, st) { function final(info, st, cat) { try { return List.assq(cat, st.final); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let st$p = delta$1(info, cat, -1, st); @@ -1623,16 +1605,15 @@ function final(info, st, cat) { return res; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function find_initial_state(re, cat) { try { return List.assq(cat, re.initial_states); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let st = find_state(re, Re_automata_State.create(cat, re.initial)); @@ -1646,8 +1627,8 @@ function find_initial_state(re, cat) { return st; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -1674,7 +1655,7 @@ function scan_str(info, s, initial_state, groups) { } else { let _pos = pos; let _st = initial_state; - while(true) { + while (true) { let st = _st; let pos$1 = _pos; if (pos$1 >= last) { @@ -1706,7 +1687,7 @@ function scan_str(info, s, initial_state, groups) { return st$1; } else { let pos$2 = last - 1 | 0; - while(true) { + while (true) { let st$p$1 = Caml_array.get(st$1.next, info$1.re.lnl); if (st$p$1.idx >= 0) { if (groups) { @@ -1747,14 +1728,14 @@ function trans_set(cache, cm, s) { ]; try { let _param = cache.contents; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = compare(v, param.v); if (c === 0) { @@ -1763,8 +1744,7 @@ function trans_set(cache, cm, s) { _param = c < 0 ? param.l : param.r; continue; }; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let l = List.fold_right((function (param, l) { @@ -1774,39 +1754,39 @@ function trans_set(cache, cm, s) { return l; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function is_charset(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; } switch (x.TAG) { case "Set" : - return true; + return true; case "Sem" : case "Sem_greedy" : - _x = x._1; - continue; + _x = x._1; + continue; case "No_group" : case "Case" : case "No_case" : - _x = x._0; - continue; + _x = x._0; + continue; case "Alternative" : case "Intersection" : case "Complement" : - return List.for_all(is_charset, x._0); + return List.for_all(is_charset, x._0); case "Difference" : - if (!is_charset(x._0)) { - return false; - } - _x = x._1; - continue; + if (!is_charset(x._0)) { + return false; + } + _x = x._1; + continue; default: return false; } @@ -1819,7 +1799,7 @@ function split(s, cm) { Caml_bytes.set(cm, i, /* '\001' */1); Caml_bytes.set(cm, j + 1 | 0, /* '\001' */1); }; - while(true) { + while (true) { let t = _t; if (!t) { return; @@ -1869,62 +1849,61 @@ function colorize(c, regexp) { contents: false }; let colorize$1 = function (_regexp) { - while(true) { + while (true) { let regexp = _regexp; if (typeof regexp !== "object") { switch (regexp) { case "Beg_of_line" : case "End_of_line" : - return split({ - hd: [ - /* '\n' */10, - /* '\n' */10 - ], - tl: /* [] */0 - }, c); + return split({ + hd: [ + /* '\n' */10, + /* '\n' */10 + ], + tl: /* [] */0 + }, c); case "Beg_of_word" : case "End_of_word" : case "Not_bound" : - return split(cword, c); + return split(cword, c); case "Last_end_of_line" : - lnl.contents = true; - return; + lnl.contents = true; + return; case "Beg_of_str" : case "End_of_str" : case "Start" : case "Stop" : - return; - + return; } } else { switch (regexp.TAG) { case "Set" : - return split(regexp._0, c); + return split(regexp._0, c); case "Sequence" : case "Alternative" : - return List.iter(colorize$1, regexp._0); + return List.iter(colorize$1, regexp._0); case "Repeat" : case "Group" : case "No_group" : case "Nest" : - _regexp = regexp._0; - continue; + _regexp = regexp._0; + continue; case "Sem" : case "Sem_greedy" : case "Pmark" : - _regexp = regexp._1; - continue; + _regexp = regexp._1; + continue; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ocaml_re_test.res", - 2169, - 8 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ocaml_re_test.res", + 2169, + 8 + ] + } + }); } } }; @@ -1939,7 +1918,7 @@ function flatten_cmap(cm) { let v = 0; Caml_bytes.set(c, 0, /* '\000' */0); Caml_bytes.set(col_repr, 0, /* '\000' */0); - for(let i = 1; i <= 255; ++i){ + for (let i = 1; i <= 255; ++i) { if (Caml_bytes.get(cm, i) !== /* '\000' */0) { v = v + 1 | 0; } @@ -1954,223 +1933,221 @@ function flatten_cmap(cm) { } function equal$2(_x1, _x2) { - while(true) { + while (true) { let x2 = _x2; let x1 = _x1; if (typeof x1 !== "object") { switch (x1) { case "Beg_of_line" : - if (typeof x2 !== "object" && x2 === "Beg_of_line") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Beg_of_line") { + return true; + } else { + return false; + } case "End_of_line" : - if (typeof x2 !== "object" && x2 === "End_of_line") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "End_of_line") { + return true; + } else { + return false; + } case "Beg_of_word" : - if (typeof x2 !== "object" && x2 === "Beg_of_word") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Beg_of_word") { + return true; + } else { + return false; + } case "End_of_word" : - if (typeof x2 !== "object" && x2 === "End_of_word") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "End_of_word") { + return true; + } else { + return false; + } case "Not_bound" : - if (typeof x2 !== "object" && x2 === "Not_bound") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Not_bound") { + return true; + } else { + return false; + } case "Beg_of_str" : - if (typeof x2 !== "object" && x2 === "Beg_of_str") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Beg_of_str") { + return true; + } else { + return false; + } case "End_of_str" : - if (typeof x2 !== "object" && x2 === "End_of_str") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "End_of_str") { + return true; + } else { + return false; + } case "Last_end_of_line" : - if (typeof x2 !== "object" && x2 === "Last_end_of_line") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Last_end_of_line") { + return true; + } else { + return false; + } case "Start" : - if (typeof x2 !== "object" && x2 === "Start") { - return true; - } else { - return false; - } + if (typeof x2 !== "object" && x2 === "Start") { + return true; + } else { + return false; + } case "Stop" : - if (typeof x2 !== "object" && x2 === "Stop") { - return true; - } else { - return false; - } - + if (typeof x2 !== "object" && x2 === "Stop") { + return true; + } else { + return false; + } } } else { switch (x1.TAG) { case "Set" : - if (typeof x2 !== "object" || x2.TAG !== "Set") { - return false; - } else { - return Caml_obj.equal(x1._0, x2._0); - } + if (typeof x2 !== "object" || x2.TAG !== "Set") { + return false; + } else { + return Caml_obj.equal(x1._0, x2._0); + } case "Sequence" : - if (typeof x2 !== "object" || x2.TAG !== "Sequence") { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (typeof x2 !== "object" || x2.TAG !== "Sequence") { + return false; + } else { + return eq_list(x1._0, x2._0); + } case "Alternative" : - if (typeof x2 !== "object" || x2.TAG !== "Alternative") { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (typeof x2 !== "object" || x2.TAG !== "Alternative") { + return false; + } else { + return eq_list(x1._0, x2._0); + } case "Repeat" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Repeat") { - return false; - } - if (x1._1 !== x2._1) { - return false; - } - if (!Caml_obj.equal(x1._2, x2._2)) { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Repeat") { + return false; + } + if (x1._1 !== x2._1) { + return false; + } + if (!Caml_obj.equal(x1._2, x2._2)) { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case "Sem" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Sem") { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Sem") { + return false; + } + if (x1._0 !== x2._0) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; case "Sem_greedy" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Sem_greedy") { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; - case "Group" : + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Sem_greedy") { + return false; + } + if (x1._0 !== x2._0) { return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; + case "Group" : + return false; case "No_group" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "No_group") { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "No_group") { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case "Nest" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Nest") { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Nest") { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case "Case" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Case") { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Case") { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; case "No_case" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "No_case") { - return false; - } - _x2 = x2._0; - _x1 = x1._0; - continue; - case "Intersection" : - if (typeof x2 !== "object" || x2.TAG !== "Intersection") { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "No_case") { + return false; + } + _x2 = x2._0; + _x1 = x1._0; + continue; + case "Intersection" : + if (typeof x2 !== "object" || x2.TAG !== "Intersection") { + return false; + } else { + return eq_list(x1._0, x2._0); + } case "Complement" : - if (typeof x2 !== "object" || x2.TAG !== "Complement") { - return false; - } else { - return eq_list(x1._0, x2._0); - } + if (typeof x2 !== "object" || x2.TAG !== "Complement") { + return false; + } else { + return eq_list(x1._0, x2._0); + } case "Difference" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Difference") { - return false; - } - if (!equal$2(x1._0, x2._0)) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Difference") { + return false; + } + if (!equal$2(x1._0, x2._0)) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; case "Pmark" : - if (typeof x2 !== "object") { - return false; - } - if (x2.TAG !== "Pmark") { - return false; - } - if (x1._0 !== x2._0) { - return false; - } - _x2 = x2._1; - _x1 = x1._1; - continue; - + if (typeof x2 !== "object") { + return false; + } + if (x2.TAG !== "Pmark") { + return false; + } + if (x1._0 !== x2._0) { + return false; + } + _x2 = x2._1; + _x1 = x1._1; + continue; } } }; } function eq_list(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -2204,7 +2181,7 @@ function sequence(x) { } function merge_sequences(_x) { - while(true) { + while (true) { let x = _x; if (!x) { return /* [] */0; @@ -2213,71 +2190,69 @@ function merge_sequences(_x) { if (typeof l$p === "object") { switch (l$p.TAG) { case "Sequence" : - let match = l$p._0; - if (match) { - let y = match.tl; - let x$1 = match.hd; - let r$p = merge_sequences(x.tl); - let exit = 0; - if (r$p) { - let match$1 = r$p.hd; - if (typeof match$1 !== "object" || match$1.TAG !== "Sequence") { - exit = 2; - } else { - let match$2 = match$1._0; - if (match$2) { - if (equal$2(x$1, match$2.hd)) { - return { - hd: { - TAG: "Sequence", - _0: { - hd: x$1, - tl: { - hd: { - TAG: "Alternative", - _0: { - hd: sequence(y), - tl: { - hd: sequence(match$2.tl), - tl: /* [] */0 - } + let match = l$p._0; + if (match) { + let y = match.tl; + let x$1 = match.hd; + let r$p = merge_sequences(x.tl); + let exit = 0; + if (r$p) { + let match$1 = r$p.hd; + if (typeof match$1 !== "object" || match$1.TAG !== "Sequence") { + exit = 2; + } else { + let match$2 = match$1._0; + if (match$2) { + if (equal$2(x$1, match$2.hd)) { + return { + hd: { + TAG: "Sequence", + _0: { + hd: x$1, + tl: { + hd: { + TAG: "Alternative", + _0: { + hd: sequence(y), + tl: { + hd: sequence(match$2.tl), + tl: /* [] */0 } - }, - tl: /* [] */0 - } + } + }, + tl: /* [] */0 } - }, - tl: r$p.tl - }; - } - exit = 2; - } else { - exit = 2; + } + }, + tl: r$p.tl + }; } + exit = 2; + } else { + exit = 2; } - } else { - exit = 2; } - if (exit === 2) { - return { - hd: { - TAG: "Sequence", - _0: { - hd: x$1, - tl: y - } - }, - tl: r$p - }; - } - + } else { + exit = 2; + } + if (exit === 2) { + return { + hd: { + TAG: "Sequence", + _0: { + hd: x$1, + tl: y + } + }, + tl: r$p + }; } - break; + + } + break; case "Alternative" : - _x = Pervasives.$at(l$p._0, x.tl); - continue; - default: - + _x = Pervasives.$at(l$p._0, x.tl); + continue; } } return { @@ -2296,59 +2271,67 @@ function enforce_kind(ids, kind, kind$p, cr) { } function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) { - while(true) { + while (true) { let x = _x; let greedy = _greedy; let ign_group = _ign_group; if (typeof x !== "object") { switch (x) { case "Beg_of_line" : - let c$1 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.newline); - return [ - mk_expr(ids, { - TAG: "After", - _0: c$1 - }), - kind - ]; + let c$1 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.newline); + return [ + mk_expr(ids, { + TAG: "After", + _0: c$1 + }), + kind + ]; case "End_of_line" : - let c$2 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.newline); - return [ - mk_expr(ids, { - TAG: "Before", - _0: c$2 - }), - kind - ]; + let c$2 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.newline); + return [ + mk_expr(ids, { + TAG: "Before", + _0: c$2 + }), + kind + ]; case "Beg_of_word" : - let c$3 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.not_letter); - let c$4 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.letter); - return [ - seq$1(ids, "First", mk_expr(ids, { - TAG: "After", - _0: c$3 - }), mk_expr(ids, { - TAG: "Before", - _0: c$4 - })), - kind - ]; + let c$3 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.not_letter); + let c$4 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.letter); + return [ + seq$1(ids, "First", mk_expr(ids, { + TAG: "After", + _0: c$3 + }), mk_expr(ids, { + TAG: "Before", + _0: c$4 + })), + kind + ]; case "End_of_word" : - let c$5 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.letter); - let c$6 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.not_letter); - return [ - seq$1(ids, "First", mk_expr(ids, { + let c$5 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.letter); + let c$6 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.not_letter); + return [ + seq$1(ids, "First", mk_expr(ids, { + TAG: "After", + _0: c$5 + }), mk_expr(ids, { + TAG: "Before", + _0: c$6 + })), + kind + ]; + case "Not_bound" : + return [ + alt(ids, { + hd: seq$1(ids, "First", mk_expr(ids, { TAG: "After", - _0: c$5 + _0: Re_automata_Category.letter }), mk_expr(ids, { TAG: "Before", - _0: c$6 + _0: Re_automata_Category.letter })), - kind - ]; - case "Not_bound" : - return [ - alt(ids, { + tl: { hd: seq$1(ids, "First", mk_expr(ids, { TAG: "After", _0: Re_automata_Category.letter @@ -2356,196 +2339,187 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) TAG: "Before", _0: Re_automata_Category.letter })), - tl: { - hd: seq$1(ids, "First", mk_expr(ids, { - TAG: "After", - _0: Re_automata_Category.letter - }), mk_expr(ids, { - TAG: "Before", - _0: Re_automata_Category.letter - })), - tl: /* [] */0 - } - }), - kind - ]; + tl: /* [] */0 + } + }), + kind + ]; case "Beg_of_str" : - return [ - mk_expr(ids, { - TAG: "After", - _0: Re_automata_Category.inexistant - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: "After", + _0: Re_automata_Category.inexistant + }), + kind + ]; case "End_of_str" : - return [ - mk_expr(ids, { - TAG: "Before", - _0: Re_automata_Category.inexistant - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: "Before", + _0: Re_automata_Category.inexistant + }), + kind + ]; case "Last_end_of_line" : - let c$7 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.lastnewline); - return [ - mk_expr(ids, { - TAG: "Before", - _0: c$7 - }), - kind - ]; + let c$7 = Re_automata_Category.$plus$plus(Re_automata_Category.inexistant, Re_automata_Category.lastnewline); + return [ + mk_expr(ids, { + TAG: "Before", + _0: c$7 + }), + kind + ]; case "Start" : - return [ - mk_expr(ids, { - TAG: "After", - _0: Re_automata_Category.search_boundary - }), - kind - ]; + return [ + mk_expr(ids, { + TAG: "After", + _0: Re_automata_Category.search_boundary + }), + kind + ]; case "Stop" : - return [ - mk_expr(ids, { - TAG: "Before", - _0: Re_automata_Category.search_boundary - }), - kind - ]; - + return [ + mk_expr(ids, { + TAG: "Before", + _0: Re_automata_Category.search_boundary + }), + kind + ]; } } else { switch (x.TAG) { case "Set" : - return [ - cst(ids, trans_set(cache, c, x._0)), - kind - ]; + return [ + cst(ids, trans_set(cache, c, x._0)), + kind + ]; case "Sequence" : - return [ - trans_seq(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0), - kind - ]; + return [ + trans_seq(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0), + kind + ]; case "Alternative" : - let merged_sequences = merge_sequences(x._0); - if (merged_sequences && !merged_sequences.tl) { - let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, merged_sequences.hd); - return [ - enforce_kind(ids, kind, match[1], match[0]), - kind - ]; - } + let merged_sequences = merge_sequences(x._0); + if (merged_sequences && !merged_sequences.tl) { + let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, merged_sequences.hd); return [ - alt(ids, List.map((function (r$p) { - let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); - return enforce_kind(ids, kind, match[1], match[0]); - }), merged_sequences)), + enforce_kind(ids, kind, match[1], match[0]), kind ]; + } + return [ + alt(ids, List.map((function (r$p) { + let match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); + return enforce_kind(ids, kind, match[1], match[0]); + }), merged_sequences)), + kind + ]; case "Repeat" : - let j = x._2; - let i = x._1; - let match$1 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0); - let kind$p = match$1[1]; - let cr = match$1[0]; - let rem; - if (j !== undefined) { - let f = greedy === "Non_greedy" ? (function (rem) { - return alt(ids, { - hd: mk_expr(ids, "Eps"), - tl: { - hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: /* [] */0 - } - }); - }) : (function (rem) { - return alt(ids, { + let j = x._2; + let i = x._1; + let match$1 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0); + let kind$p = match$1[1]; + let cr = match$1[0]; + let rem; + if (j !== undefined) { + let f = greedy === "Non_greedy" ? (function (rem) { + return alt(ids, { + hd: mk_expr(ids, "Eps"), + tl: { hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: { - hd: mk_expr(ids, "Eps"), - tl: /* [] */0 - } - }); + tl: /* [] */0 + } }); - rem = iter(j - i | 0, f, mk_expr(ids, "Eps")); - } else { - rem = rep(ids, greedy, kind$p, cr); - } - return [ - iter(i, (function (rem) { - return seq$1(ids, kind$p, rename(ids, cr), rem); - }), rem), - kind - ]; + }) : (function (rem) { + return alt(ids, { + hd: seq$1(ids, kind$p, rename(ids, cr), rem), + tl: { + hd: mk_expr(ids, "Eps"), + tl: /* [] */0 + } + }); + }); + rem = iter(j - i | 0, f, mk_expr(ids, "Eps")); + } else { + rem = rep(ids, greedy, kind$p, cr); + } + return [ + iter(i, (function (rem) { + return seq$1(ids, kind$p, rename(ids, cr), rem); + }), rem), + kind + ]; case "Sem" : - let kind$p$1 = x._0; - let match$2 = translate(ids, kind$p$1, ign_group, ign_case, greedy, pos, cache, c, x._1); - return [ - enforce_kind(ids, kind$p$1, match$2[1], match$2[0]), - kind$p$1 - ]; + let kind$p$1 = x._0; + let match$2 = translate(ids, kind$p$1, ign_group, ign_case, greedy, pos, cache, c, x._1); + return [ + enforce_kind(ids, kind$p$1, match$2[1], match$2[0]), + kind$p$1 + ]; case "Sem_greedy" : - _x = x._1; - _greedy = x._0; - continue; + _x = x._1; + _greedy = x._0; + continue; case "Group" : - let r$p = x._0; - if (ign_group) { - _x = r$p; - continue; - } - let p = pos.contents; - pos.contents = pos.contents + 2 | 0; - let match$3 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); - return [ - seq$1(ids, "First", mk_expr(ids, { - TAG: "Mark", - _0: p - }), seq$1(ids, "First", match$3[0], mk_expr(ids, { - TAG: "Mark", - _0: p + 1 | 0 - }))), - match$3[1] - ]; - case "No_group" : - _x = x._0; - _ign_group = true; + let r$p = x._0; + if (ign_group) { + _x = r$p; continue; + } + let p = pos.contents; + pos.contents = pos.contents + 2 | 0; + let match$3 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); + return [ + seq$1(ids, "First", mk_expr(ids, { + TAG: "Mark", + _0: p + }), seq$1(ids, "First", match$3[0], mk_expr(ids, { + TAG: "Mark", + _0: p + 1 | 0 + }))), + match$3[1] + ]; + case "No_group" : + _x = x._0; + _ign_group = true; + continue; case "Nest" : - let b = pos.contents; - let match$4 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0); - let kind$p$2 = match$4[1]; - let cr$1 = match$4[0]; - let e = pos.contents - 1 | 0; - if (e < b) { - return [ - cr$1, - kind$p$2 - ]; - } else { - return [ - seq$1(ids, "First", erase(ids, b, e), cr$1), - kind$p$2 - ]; - } - case "Pmark" : - let match$5 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._1); + let b = pos.contents; + let match$4 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._0); + let kind$p$2 = match$4[1]; + let cr$1 = match$4[0]; + let e = pos.contents - 1 | 0; + if (e < b) { return [ - seq$1(ids, "First", mk_expr(ids, { - TAG: "Pmark", - _0: x._0 - }), match$5[0]), - match$5[1] + cr$1, + kind$p$2 ]; + } else { + return [ + seq$1(ids, "First", erase(ids, b, e), cr$1), + kind$p$2 + ]; + } + case "Pmark" : + let match$5 = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, x._1); + return [ + seq$1(ids, "First", mk_expr(ids, { + TAG: "Pmark", + _0: x._0 + }), match$5[0]), + match$5[1] + ]; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ocaml_re_test.res", - 2403, - 80 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ocaml_re_test.res", + 2403, + 80 + ] + } + }); } } }; @@ -2580,33 +2554,33 @@ function case_insens(s) { function as_set(x) { if (typeof x !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ocaml_re_test.res", - 2438, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ocaml_re_test.res", + 2438, + 11 + ] + } + }); } if (x.TAG === "Set") { return x._0; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "ocaml_re_test.res", - 2438, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "ocaml_re_test.res", + 2438, + 11 + ] + } + }); } function handle_case(_ign_case, _x) { - while(true) { + while (true) { let x = _x; let ign_case = _ign_case; if (typeof x !== "object") { @@ -2614,171 +2588,170 @@ function handle_case(_ign_case, _x) { } switch (x.TAG) { case "Set" : - let s = x._0; + let s = x._0; + return { + TAG: "Set", + _0: ign_case ? case_insens(s) : s + }; + case "Sequence" : + return { + TAG: "Sequence", + _0: List.map((function (extra) { + return handle_case(ign_case, extra); + }), x._0) + }; + case "Alternative" : + let l$p = List.map((function (extra) { + return handle_case(ign_case, extra); + }), x._0); + if (is_charset({ + TAG: "Alternative", + _0: l$p + })) { return { TAG: "Set", - _0: ign_case ? case_insens(s) : s + _0: List.fold_left((function (s, r) { + return union(s, as_set(r)); + }), /* [] */0, l$p) }; - case "Sequence" : + } else { return { - TAG: "Sequence", - _0: List.map((function (extra) { - return handle_case(ign_case, extra); - }), x._0) + TAG: "Alternative", + _0: l$p }; - case "Alternative" : - let l$p = List.map((function (extra) { - return handle_case(ign_case, extra); - }), x._0); - if (is_charset({ - TAG: "Alternative", - _0: l$p - })) { - return { - TAG: "Set", - _0: List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */0, l$p) - }; - } else { - return { - TAG: "Alternative", - _0: l$p - }; - } + } case "Repeat" : + return { + TAG: "Repeat", + _0: handle_case(ign_case, x._0), + _1: x._1, + _2: x._2 + }; + case "Sem" : + let r$p = handle_case(ign_case, x._1); + if (is_charset(r$p)) { + return r$p; + } else { return { - TAG: "Repeat", - _0: handle_case(ign_case, x._0), - _1: x._1, - _2: x._2 + TAG: "Sem", + _0: x._0, + _1: r$p }; - case "Sem" : - let r$p = handle_case(ign_case, x._1); - if (is_charset(r$p)) { - return r$p; - } else { - return { - TAG: "Sem", - _0: x._0, - _1: r$p - }; - } + } case "Sem_greedy" : - let r$p$1 = handle_case(ign_case, x._1); - if (is_charset(r$p$1)) { - return r$p$1; - } else { - return { - TAG: "Sem_greedy", - _0: x._0, - _1: r$p$1 - }; - } - case "Group" : + let r$p$1 = handle_case(ign_case, x._1); + if (is_charset(r$p$1)) { + return r$p$1; + } else { return { - TAG: "Group", - _0: handle_case(ign_case, x._0) + TAG: "Sem_greedy", + _0: x._0, + _1: r$p$1 }; + } + case "Group" : + return { + TAG: "Group", + _0: handle_case(ign_case, x._0) + }; case "No_group" : - let r$p$2 = handle_case(ign_case, x._0); - if (is_charset(r$p$2)) { - return r$p$2; - } else { - return { - TAG: "No_group", - _0: r$p$2 - }; - } + let r$p$2 = handle_case(ign_case, x._0); + if (is_charset(r$p$2)) { + return r$p$2; + } else { + return { + TAG: "No_group", + _0: r$p$2 + }; + } case "Nest" : - let r$p$3 = handle_case(ign_case, x._0); - if (is_charset(r$p$3)) { - return r$p$3; - } else { - return { - TAG: "Nest", - _0: r$p$3 - }; - } + let r$p$3 = handle_case(ign_case, x._0); + if (is_charset(r$p$3)) { + return r$p$3; + } else { + return { + TAG: "Nest", + _0: r$p$3 + }; + } case "Case" : - _x = x._0; - _ign_case = false; - continue; + _x = x._0; + _ign_case = false; + continue; case "No_case" : - _x = x._0; - _ign_case = true; - continue; + _x = x._0; + _ign_case = true; + continue; case "Intersection" : - let l$p$1 = List.map((function (r) { - return handle_case(ign_case, r); - }), x._0); - return { - TAG: "Set", - _0: List.fold_left((function (s, r) { - return inter(s, as_set(r)); - }), cany, l$p$1) - }; + let l$p$1 = List.map((function (r) { + return handle_case(ign_case, r); + }), x._0); + return { + TAG: "Set", + _0: List.fold_left((function (s, r) { + return inter(s, as_set(r)); + }), cany, l$p$1) + }; case "Complement" : - let l$p$2 = List.map((function (r) { - return handle_case(ign_case, r); - }), x._0); - return { - TAG: "Set", - _0: diff(cany, List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */0, l$p$2)) - }; + let l$p$2 = List.map((function (r) { + return handle_case(ign_case, r); + }), x._0); + return { + TAG: "Set", + _0: diff(cany, List.fold_left((function (s, r) { + return union(s, as_set(r)); + }), /* [] */0, l$p$2)) + }; case "Difference" : - return { - TAG: "Set", - _0: inter(as_set(handle_case(ign_case, x._0)), diff(cany, as_set(handle_case(ign_case, x._1)))) - }; + return { + TAG: "Set", + _0: inter(as_set(handle_case(ign_case, x._0)), diff(cany, as_set(handle_case(ign_case, x._1)))) + }; case "Pmark" : - return { - TAG: "Pmark", - _0: x._0, - _1: handle_case(ign_case, x._1) - }; - + return { + TAG: "Pmark", + _0: x._0, + _1: handle_case(ign_case, x._1) + }; } }; } function anchored(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { switch (x) { case "Beg_of_str" : case "Start" : - return true; + return true; default: return false; } } else { switch (x.TAG) { case "Sequence" : - return List.exists(anchored, x._0); + return List.exists(anchored, x._0); case "Alternative" : - return List.for_all(anchored, x._0); + return List.for_all(anchored, x._0); case "Repeat" : - if (x._1 <= 0) { - return false; - } - _x = x._0; - continue; + if (x._1 <= 0) { + return false; + } + _x = x._0; + continue; case "Group" : case "No_group" : case "Nest" : case "Case" : case "No_case" : - _x = x._0; - continue; + _x = x._0; + continue; case "Sem" : case "Sem_greedy" : case "Pmark" : - _x = x._1; - continue; + _x = x._1; + continue; default: return false; } @@ -2816,19 +2789,19 @@ let epsilon = { function repn(r, i, j) { if (i < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Re.repn" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Re.repn" + } + }); } if (j !== undefined && j < i) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Re.repn" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Re.repn" + } + }); } return { TAG: "Repeat", @@ -2840,7 +2813,7 @@ function repn(r, i, j) { function set(str) { let s = /* [] */0; - for(let i = 0 ,i_finish = str.length; i < i_finish; ++i){ + for (let i = 0, i_finish = str.length; i < i_finish; ++i) { s = union(single(Caml_string.get(str, i)), s); } return { @@ -2858,11 +2831,11 @@ function compl(l) { return r; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Re.compl" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Re.compl" + } + }); } let any = { @@ -3213,11 +3186,11 @@ function exec_internal(name, posOpt, lenOpt, groups, re, s) { let len = lenOpt !== undefined ? lenOpt : -1; if (pos < 0 || len < -1 || (pos + len | 0) > s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: name - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: name + } + }); } let partial = false; let slen = s.length; @@ -3284,18 +3257,18 @@ function exec_internal(name, posOpt, lenOpt, groups, re, s) { function offset$1(t, i) { if (((i << 1) + 1 | 0) >= t.marks.length) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let m1 = Caml_array.get(t.marks, (i << 1)); if (m1 === -1) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let p1 = Caml_array.get(t.gpos, m1) - 1 | 0; let p2 = Caml_array.get(t.gpos, Caml_array.get(t.marks, (i << 1) + 1 | 0)) - 1 | 0; @@ -3318,39 +3291,39 @@ let Not_supported = /* @__PURE__ */Caml_exceptions.create("Not_supported"); function posix_class_of_string(x) { switch (x) { case "alnum" : - return alnum; + return alnum; case "ascii" : - return ascii; + return ascii; case "blank" : - return blank; + return blank; case "cntrl" : - return cntrl; + return cntrl; case "digit" : - return digit; + return digit; case "graph" : - return graph; + return graph; case "lower" : - return lower; + return lower; case "print" : - return print; + return print; case "punct" : - return punct; + return punct; case "space" : - return space; + return space; case "upper" : - return upper; + return upper; case "word" : - return wordc; + return wordc; case "xdigit" : - return xdigit; + return xdigit; default: let s = "Invalid pcre class: " + x; throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } } @@ -3376,36 +3349,34 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let accept_s = function (s$p) { let len = s$p.length; try { - for(let j = 0; j < len; ++j){ + for (let j = 0; j < len; ++j) { try { if (Caml_string.get(s$p, j) !== Caml_string.get(s, i.contents + j | 0)) { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } - } - catch (exn){ + } catch (exn) { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } } i.contents = i.contents + len | 0; return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn$1.RE_EXN_ID === Pervasives.Exit) { return false; } throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } }; let get = function () { @@ -3431,7 +3402,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } }; let regexp$p = function (_left) { - while(true) { + while (true) { let left = _left; if (!accept(/* '|' */124)) { return left; @@ -3447,7 +3418,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; }; let branch$p = function (_left) { - while(true) { + while (true) { let left = _left; if (i.contents === l || test(/* '|' */124) || test(/* ')' */41)) { return seq$2(List.rev(left)); @@ -3473,10 +3444,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let r = regexp$p(branch()); if (!accept(/* ')' */41)) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return r; } @@ -3484,18 +3455,18 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return comment(); } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let r$1 = regexp$p(branch()); if (!accept(/* ')' */41)) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return { TAG: "Group", @@ -3528,10 +3499,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { if (accept(/* '\\' */92)) { if (i.contents === l) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let c = get(); switch (c) { @@ -3545,75 +3516,75 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 55 : case 56 : case 57 : - throw new Error(Not_supported, { - cause: { - RE_EXN_ID: Not_supported - } - }); + throw new Error(Not_supported, { + cause: { + RE_EXN_ID: Not_supported + } + }); case 65 : - return "Beg_of_str"; + return "Beg_of_str"; case 66 : - return "Not_bound"; + return "Not_bound"; case 68 : - return compl({ - hd: digit, - tl: /* [] */0 - }); + return compl({ + hd: digit, + tl: /* [] */0 + }); case 71 : - return "Start"; + return "Start"; case 83 : - return compl({ - hd: space, - tl: /* [] */0 - }); + return compl({ + hd: space, + tl: /* [] */0 + }); case 87 : - return compl({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, - tl: /* [] */0 - } - }); + return compl({ + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */0 + } + }, + tl: /* [] */0 + } + }); case 90 : - return "Last_end_of_line"; + return "Last_end_of_line"; case 98 : - return alt$1({ - hd: "Beg_of_word", - tl: { - hd: "End_of_word", - tl: /* [] */0 - } - }); + return alt$1({ + hd: "Beg_of_word", + tl: { + hd: "End_of_word", + tl: /* [] */0 + } + }); case 100 : - return digit; + return digit; case 115 : - return space; + return space; case 119 : - return alt$1({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, - tl: /* [] */0 - } - }); + return alt$1({ + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */0 + } + }, + tl: /* [] */0 + } + }); case 67 : case 69 : case 70 : @@ -3654,13 +3625,13 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 118 : case 120 : case 121 : - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); case 122 : - return "End_of_str"; + return "End_of_str"; default: return { TAG: "Set", @@ -3670,10 +3641,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } else { if (i.contents === l) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let c$1 = get(); if (c$1 >= 64) { @@ -3685,24 +3656,24 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { }; } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } if (c$1 >= 44) { if (c$1 >= 63) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return { TAG: "Set", @@ -3711,10 +3682,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } if (c$1 >= 42) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return { TAG: "Set", @@ -3732,7 +3703,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return; } else { let _i = d - /* '0' */48 | 0; - while(true) { + while (true) { let i$1 = _i; if (i.contents === l) { return i$1; @@ -3745,10 +3716,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let i$p = Math.imul(10, i$1) + (d$1 - /* '0' */48 | 0) | 0; if (i$p < i$1) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } _i = i$p; continue; @@ -3774,17 +3745,17 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let j = accept(/* ',' */44) ? integer() : i$1; if (!accept(/* '}' */125)) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } if (j !== undefined && j < i$1) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return greedy_mod(repn(r, i$1, j)); } @@ -3794,19 +3765,19 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let char = function () { if (i.contents === l) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let c = get(); if (c === /* '[' */91) { if (accept(/* '=' */61)) { throw new Error(Not_supported, { - cause: { - RE_EXN_ID: Not_supported - } - }); + cause: { + RE_EXN_ID: Not_supported + } + }); } if (accept(/* ':' */58)) { let compl$1 = accept(/* '^' */94); @@ -3852,26 +3823,25 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } } }); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } if (!accept_s(":]")) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let posix_class = posix_class_of_string(cls); let re = compl$1 ? compl({ @@ -3891,25 +3861,25 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } if (i.contents === l) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } let c$1 = get(); if (!accept(/* '.' */46)) { throw new Error(Not_supported, { - cause: { - RE_EXN_ID: Not_supported - } - }); + cause: { + RE_EXN_ID: Not_supported + } + }); } if (!accept(/* ']' */93)) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return { NAME: "Char", @@ -3932,41 +3902,41 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } switch (c$2) { case 68 : - return { - NAME: "Set", - VAL: compl({ - hd: digit, - tl: /* [] */0 - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: digit, + tl: /* [] */0 + }) + }; case 83 : - return { - NAME: "Set", - VAL: compl({ - hd: space, - tl: /* [] */0 - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: space, + tl: /* [] */0 + }) + }; case 87 : - return { - NAME: "Set", - VAL: compl({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, - tl: /* [] */0 - } - }) - }; + return { + NAME: "Set", + VAL: compl({ + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */0 + } + }, + tl: /* [] */0 + } + }) + }; case 58 : case 59 : case 60 : @@ -3980,60 +3950,60 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 94 : case 95 : case 96 : - return { - NAME: "Char", - VAL: c$2 - }; + return { + NAME: "Char", + VAL: c$2 + }; case 98 : - return { - NAME: "Char", - VAL: /* '\b' */8 - }; + return { + NAME: "Char", + VAL: /* '\b' */8 + }; case 100 : - return { - NAME: "Set", - VAL: digit - }; + return { + NAME: "Set", + VAL: digit + }; case 110 : - return { - NAME: "Char", - VAL: /* '\n' */10 - }; + return { + NAME: "Char", + VAL: /* '\n' */10 + }; case 114 : - return { - NAME: "Char", - VAL: /* '\r' */13 - }; + return { + NAME: "Char", + VAL: /* '\r' */13 + }; case 115 : - return { - NAME: "Set", - VAL: space - }; + return { + NAME: "Set", + VAL: space + }; case 116 : - return { - NAME: "Char", - VAL: /* '\t' */9 - }; + return { + NAME: "Char", + VAL: /* '\t' */9 + }; case 119 : - return { - NAME: "Set", - VAL: alt$1({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, - tl: /* [] */0 - } - }) - }; + return { + NAME: "Set", + VAL: alt$1({ + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */0 + } + }, + tl: /* [] */0 + } + }) + }; case 65 : case 66 : case 67 : @@ -4076,20 +4046,19 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { case 120 : case 121 : case 122 : - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); - + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); } } else { if (c$2 >= 48) { throw new Error(Not_supported, { - cause: { - RE_EXN_ID: Not_supported - } - }); + cause: { + RE_EXN_ID: Not_supported + } + }); } return { NAME: "Char", @@ -4098,7 +4067,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } }; let bracket = function (_s) { - while(true) { + while (true) { let s = _s; if (s !== /* [] */0 && accept(/* ']' */93)) { return s; @@ -4182,7 +4151,7 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return branch$p(/* [] */0); }; let comment = function () { - while(true) { + while (true) { if (accept(/* ')' */41)) { return epsilon; } @@ -4193,10 +4162,10 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { let res = regexp$p(branch()); if (i.contents !== l) { throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + cause: { + RE_EXN_ID: Parse_error + } + }); } return res; } @@ -4240,16 +4209,16 @@ function exec(rex, pos, s) { } if (substr === "Failed") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let s = "a".repeat(1048575) + "b"; diff --git a/jscomp/test/offset.js b/jscomp/test/offset.js index efec476040..07958cb021 100644 --- a/jscomp/test/offset.js +++ b/jscomp/test/offset.js @@ -36,11 +36,11 @@ function bal(l, v, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -52,11 +52,11 @@ function bal(l, v, r) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -69,11 +69,11 @@ function bal(l, v, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -85,11 +85,11 @@ function bal(l, v, r) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } function add(x, param) { @@ -170,14 +170,14 @@ function join(l, v, r) { } function min_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -189,7 +189,7 @@ function min_elt(_param) { } function min_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -204,14 +204,14 @@ function min_elt_opt(_param) { } function max_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -223,7 +223,7 @@ function max_elt(_param) { } function max_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -240,11 +240,11 @@ function max_elt_opt(_param) { function remove_min_elt(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -308,7 +308,7 @@ function is_empty(param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -419,7 +419,7 @@ function diff(s1, s2) { } function cons_enum(_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -439,7 +439,7 @@ function cons_enum(_s, _e) { function compare(s1, s2) { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -467,7 +467,7 @@ function equal(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -518,7 +518,7 @@ function subset(_s1, _s2) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -531,7 +531,7 @@ function iter(f, _param) { } function fold(f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -544,7 +544,7 @@ function fold(f, _s, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -561,7 +561,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -635,7 +635,7 @@ function cardinal(param) { } function elements_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -655,14 +655,14 @@ function elements(s) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = Caml.string_compare(x, v); @@ -675,20 +675,20 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -710,7 +710,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -719,7 +719,7 @@ function find_first_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -741,20 +741,20 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -776,7 +776,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -785,7 +785,7 @@ function find_last_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -807,7 +807,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -868,28 +868,54 @@ function of_list(l) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -900,52 +926,24 @@ function of_list(l) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -958,15 +956,15 @@ function of_list(l) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l$1), l$1)[0]; } else { diff --git a/jscomp/test/pq_test.js b/jscomp/test/pq_test.js index 4888a86070..55344e6523 100644 --- a/jscomp/test/pq_test.js +++ b/jscomp/test/pq_test.js @@ -41,10 +41,10 @@ let Queue_is_empty = /* @__PURE__ */Caml_exceptions.create("Pq_test.PrioQueue.Qu function remove_top(x) { if (typeof x !== "object") { throw new Error(Queue_is_empty, { - cause: { - RE_EXN_ID: Queue_is_empty - } - }); + cause: { + RE_EXN_ID: Queue_is_empty + } + }); } let left = x._2; let tmp = x._3; @@ -85,10 +85,10 @@ function extract(x) { ]; } throw new Error(Queue_is_empty, { - cause: { - RE_EXN_ID: Queue_is_empty - } - }); + cause: { + RE_EXN_ID: Queue_is_empty + } + }); } let PrioQueue = { diff --git a/jscomp/test/queue_402.js b/jscomp/test/queue_402.js index 9adf63c154..2e37b1eba6 100644 --- a/jscomp/test/queue_402.js +++ b/jscomp/test/queue_402.js @@ -41,10 +41,10 @@ function add(x, q) { function peek(q) { if (q.length === 0) { throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } return q.tail.next.content; } @@ -52,10 +52,10 @@ function peek(q) { function take(q) { if (q.length === 0) { throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } q.length = q.length - 1 | 0; let tail = q.tail; @@ -82,7 +82,7 @@ function copy(q) { next: tail$p }); let copy$1 = function (_prev, _cell) { - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (cell === tail) { @@ -119,7 +119,7 @@ function iter(f, q) { } let tail = q.tail; let _cell = tail.next; - while(true) { + while (true) { let cell = _cell; f(cell.content); if (cell === tail) { @@ -137,7 +137,7 @@ function fold(f, accu, q) { let tail = q.tail; let _accu = accu; let _cell = tail.next; - while(true) { + while (true) { let cell = _cell; let accu$1 = _accu; let accu$2 = f(accu$1, cell.content); diff --git a/jscomp/test/random_test.js b/jscomp/test/random_test.js index c17e6947e0..f1460f1e59 100644 --- a/jscomp/test/random_test.js +++ b/jscomp/test/random_test.js @@ -39,7 +39,7 @@ Random.init(0); let v = Caml_array.make(10, false); -for(let i = 0; i <= 9; ++i){ +for (let i = 0; i <= 9; ++i) { Caml_array.set(v, i, Random.bool()); } diff --git a/jscomp/test/raw_hash_tbl_bench.js b/jscomp/test/raw_hash_tbl_bench.js index 1f295c92bb..0e1650354a 100644 --- a/jscomp/test/raw_hash_tbl_bench.js +++ b/jscomp/test/raw_hash_tbl_bench.js @@ -5,25 +5,25 @@ let Hashtbl = require("../../lib/js/hashtbl.js"); function bench() { let table = Hashtbl.create(undefined, 1000000); - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { Hashtbl.add(table, i, i); } - for(let i$1 = 0; i$1 <= 1000000; ++i$1){ + for (let i$1 = 0; i$1 <= 1000000; ++i$1) { if (!Hashtbl.mem(table, i$1)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "raw_hash_tbl_bench.res", - 8, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "raw_hash_tbl_bench.res", + 8, + 4 + ] + } + }); } } - for(let i$2 = 0; i$2 <= 1000000; ++i$2){ + for (let i$2 = 0; i$2 <= 1000000; ++i$2) { Hashtbl.remove(table, i$2); } } diff --git a/jscomp/test/rbset.js b/jscomp/test/rbset.js index 0213e644bd..559c1cfe84 100644 --- a/jscomp/test/rbset.js +++ b/jscomp/test/rbset.js @@ -31,7 +31,7 @@ function is_empty(x) { } function mem(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -94,34 +94,33 @@ function balance_left(l, x, r) { } switch (exit) { case 1 : - return { + return { + TAG: "Node", + _0: "Black", + _1: l, + _2: x, + _3: r + }; + case 2 : + return { + TAG: "Node", + _0: "Red", + _1: { TAG: "Node", _0: "Black", - _1: l, - _2: x, - _3: r - }; - case 2 : - return { + _1: a, + _2: x$1, + _3: b + }, + _2: y, + _3: { TAG: "Node", - _0: "Red", - _1: { - TAG: "Node", - _0: "Black", - _1: a, - _2: x$1, - _3: b - }, - _2: y, - _3: { - TAG: "Node", - _0: "Black", - _1: c, - _2: z, - _3: d - } - }; - + _0: "Black", + _1: c, + _2: z, + _3: d + } + }; } } @@ -170,34 +169,33 @@ function balance_right(l, x, r) { } switch (exit) { case 1 : - return { + return { + TAG: "Node", + _0: "Black", + _1: l, + _2: x, + _3: r + }; + case 2 : + return { + TAG: "Node", + _0: "Red", + _1: { TAG: "Node", _0: "Black", - _1: l, - _2: x, - _3: r - }; - case 2 : - return { + _1: a, + _2: x$1, + _3: b + }, + _2: y, + _3: { TAG: "Node", - _0: "Red", - _1: { - TAG: "Node", - _0: "Black", - _1: a, - _2: x$1, - _3: b - }, - _2: y, - _3: { - TAG: "Node", - _0: "Black", - _1: c, - _2: z, - _3: d - } - }; - + _0: "Black", + _1: c, + _2: z, + _3: d + } + }; } } @@ -268,15 +266,15 @@ function unbalanced_left(x) { } } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "rbset.res", - 64, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "rbset.res", + 64, + 9 + ] + } + }); } function unbalanced_right(x) { @@ -338,15 +336,15 @@ function unbalanced_right(x) { } } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "rbset.res", - 75, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "rbset.res", + 75, + 9 + ] + } + }); } function lbalance(x1, x2, x3) { @@ -563,15 +561,15 @@ function add(x, s) { function remove_min(x) { if (typeof x !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "rbset.res", - 138, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "rbset.res", + 138, + 4 + ] + } + }); } let c = x._0; if (c === "Black") { @@ -600,15 +598,15 @@ function remove_min(x) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "rbset.res", - 138, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "rbset.res", + 138, + 4 + ] + } + }); } } else { diff --git a/jscomp/test/reactDOMRe.js b/jscomp/test/reactDOMRe.js index a8fef06588..e438f9ee76 100644 --- a/jscomp/test/reactDOMRe.js +++ b/jscomp/test/reactDOMRe.js @@ -70,11 +70,11 @@ function hydrateToElementWithId(reactElement, id) { let element = document.getElementById(id); if (element == null) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "ReactDOMRe.hydrateToElementWithId : no element of id " + (id + " found in the HTML.") - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "ReactDOMRe.hydrateToElementWithId : no element of id " + (id + " found in the HTML.") + } + }); } ReactDom.hydrate(reactElement, element); } diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index e6d50f29b6..bc95545c7d 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -22,7 +22,7 @@ function path() { switch (raw) { case "" : case "/" : - return /* [] */0; + return /* [] */0; default: let raw$1 = raw.slice(1); let match = raw$1[raw$1.length - 1 | 0]; @@ -30,7 +30,7 @@ function path() { let a = raw$2.split("/"); let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -55,7 +55,7 @@ function hash() { switch (raw) { case "" : case "#" : - return ""; + return ""; default: return raw.slice(1); } @@ -70,7 +70,7 @@ function search() { switch (raw) { case "" : case "?" : - return ""; + return ""; default: return raw.slice(1); } @@ -104,7 +104,7 @@ function urlNotEqual(a, b) { } else { let _aList = a.path; let _bList = b.path; - while(true) { + while (true) { let bList = _bList; let aList = _aList; if (!aList) { diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index 2e22414f15..44fec3d4c3 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -215,11 +215,11 @@ function bal(l, v, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -231,11 +231,11 @@ function bal(l, v, r) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -248,11 +248,11 @@ function bal(l, v, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -264,11 +264,11 @@ function bal(l, v, r) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } function add(x, param) { @@ -349,14 +349,14 @@ function join(l, v, r) { } function min_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -368,7 +368,7 @@ function min_elt(_param) { } function min_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -383,14 +383,14 @@ function min_elt_opt(_param) { } function max_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -402,7 +402,7 @@ function max_elt(_param) { } function max_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -419,11 +419,11 @@ function max_elt_opt(_param) { function remove_min_elt(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -487,7 +487,7 @@ function is_empty(param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -598,7 +598,7 @@ function diff(s1, s2) { } function cons_enum(_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -618,7 +618,7 @@ function cons_enum(_s, _e) { function compare(s1, s2) { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -646,7 +646,7 @@ function equal(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -697,7 +697,7 @@ function subset(_s1, _s2) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -710,7 +710,7 @@ function iter(f, _param) { } function fold(f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -723,7 +723,7 @@ function fold(f, _s, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -740,7 +740,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -814,7 +814,7 @@ function cardinal(param) { } function elements_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -834,14 +834,14 @@ function elements(s) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = AAA.compare(x, v); @@ -854,20 +854,20 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -889,7 +889,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -898,7 +898,7 @@ function find_first_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -920,20 +920,20 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -955,7 +955,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -964,7 +964,7 @@ function find_last_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -986,7 +986,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1047,28 +1047,54 @@ function of_list(l) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1079,52 +1105,24 @@ function of_list(l) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -1137,15 +1135,15 @@ function of_list(l) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l$1), l$1)[0]; } else { diff --git a/jscomp/test/recmodule.js b/jscomp/test/recmodule.js index c5b9cec6fc..c1dd92c6ed 100644 --- a/jscomp/test/recmodule.js +++ b/jscomp/test/recmodule.js @@ -41,15 +41,15 @@ let Adapter = { function MakeLayer$2(Deps) { let presentJson = function (json, status) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "recmodule.res", - 60, - 41 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "recmodule.res", + 60, + 41 + ] + } + }); }; let routes = function () { return [[ @@ -117,15 +117,15 @@ let U = Caml_module.init_mod([ function presentJson(json, status) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "recmodule.res", - 60, - 41 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "recmodule.res", + 60, + 41 + ] + } + }); } function routes() { diff --git a/jscomp/test/record_extension_test.js b/jscomp/test/record_extension_test.js index 2067603615..79d2317167 100644 --- a/jscomp/test/record_extension_test.js +++ b/jscomp/test/record_extension_test.js @@ -64,8 +64,7 @@ let C = /* @__PURE__ */Caml_exceptions.create("Record_extension_test.C"); function u(f) { try { return f(); - } - catch (raw_x){ + } catch (raw_x) { let x = Caml_js_exceptions.internalToOCamlException(raw_x); if (x.RE_EXN_ID === A) { return x.name + x.x | 0; diff --git a/jscomp/test/record_regression.js b/jscomp/test/record_regression.js index bc1e9d736e..7aa0588a55 100644 --- a/jscomp/test/record_regression.js +++ b/jscomp/test/record_regression.js @@ -175,29 +175,27 @@ function inlinedRecord(ir) { if (x1 !== undefined) { switch (x1) { case "x1" : - let x2 = ir.x2; - if (x2 !== undefined) { - return [ - x0, - "x1", - x2, - ir.x3 - ]; - } - break; + let x2 = ir.x2; + if (x2 !== undefined) { + return [ + x0, + "x1", + x2, + ir.x3 + ]; + } + break; case "xx1" : - let x2$1 = ir.x2; - if (x2$1 !== undefined) { - return [ - x0, - "xx1", - x2$1, - ir.x3 - ]; - } - break; - default: - + let x2$1 = ir.x2; + if (x2$1 !== undefined) { + return [ + x0, + "xx1", + x2$1, + ir.x3 + ]; + } + break; } let x2$2 = ir.x2; if (x2$2 !== undefined) { diff --git a/jscomp/test/recursive_module.js b/jscomp/test/recursive_module.js index 6d916dc60a..e3c0df5885 100644 --- a/jscomp/test/recursive_module.js +++ b/jscomp/test/recursive_module.js @@ -101,15 +101,14 @@ let tmp; try { tmp = CamlinternalLazy.force(Intb.a); -} -catch (raw_exn){ +} catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Lazy.Undefined) { tmp = -1; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -179,15 +178,14 @@ let tmp$1; try { Int3.u(3); tmp$1 = 3; -} -catch (raw_exn$1){ +} catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Undefined_recursive_module") { tmp$1 = 4; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } diff --git a/jscomp/test/recursive_records_test.js b/jscomp/test/recursive_records_test.js index ccf80b9d3b..61816cb5d4 100644 --- a/jscomp/test/recursive_records_test.js +++ b/jscomp/test/recursive_records_test.js @@ -69,15 +69,15 @@ function tl_exn(x) { return x.next; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "recursive_records_test.res", - 49, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "recursive_records_test.res", + 49, + 11 + ] + } + }); } eq("File \"recursive_records_test.res\", line 54, characters 5-12", (hd(rec_cell2) + hd(tl_exn(rec_cell2)) | 0) + hd(tl_exn(tl_exn(rec_cell2))) | 0, 9); diff --git a/jscomp/test/return_check.js b/jscomp/test/return_check.js index 58a814e65e..06b689c120 100644 --- a/jscomp/test/return_check.js +++ b/jscomp/test/return_check.js @@ -19,15 +19,15 @@ function f_undefined(xs, i) { return k; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "return_check.res", - 23, - 12 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "return_check.res", + 23, + 12 + ] + } + }); } function f_escaped_not(xs, i) { @@ -61,15 +61,15 @@ function f_null(xs, i) { return k; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "return_check.res", - 51, - 12 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "return_check.res", + 51, + 12 + ] + } + }); } function f_null_undefined(xs, i) { @@ -78,15 +78,15 @@ function f_null_undefined(xs, i) { return k; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "return_check.res", - 59, - 12 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "return_check.res", + 59, + 12 + ] + } + }); } exports.test = test; diff --git a/jscomp/test/set_gen.js b/jscomp/test/set_gen.js index 4c211f46ae..56131cc7bb 100644 --- a/jscomp/test/set_gen.js +++ b/jscomp/test/set_gen.js @@ -6,7 +6,7 @@ let Pervasives = require("../../lib/js/pervasives.js"); let Caml_exceptions = require("../../lib/js/caml_exceptions.js"); function cons_enum(_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -32,14 +32,14 @@ function height(x) { } function min_elt(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -51,14 +51,14 @@ function min_elt(_x) { } function max_elt(_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = x._2; if (typeof r !== "object") { @@ -78,7 +78,7 @@ function is_empty(x) { } function cardinal_aux(_acc, _x) { - while(true) { + while (true) { let x = _x; let acc = _acc; if (typeof x !== "object") { @@ -95,7 +95,7 @@ function cardinal(s) { } function elements_aux(_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (typeof x !== "object") { @@ -115,7 +115,7 @@ function elements(s) { } function iter(f, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return; @@ -128,7 +128,7 @@ function iter(f, _x) { } function fold(f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -141,7 +141,7 @@ function fold(f, _s, _accu) { } function for_all(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return true; @@ -158,7 +158,7 @@ function for_all(p, _x) { } function exists(p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; @@ -209,18 +209,18 @@ function check_height_and_diff(x) { let hr = check_height_and_diff(x._2); if (h !== (max_int_2(hl, hr) + 1 | 0)) { throw new Error(Height_invariant_broken, { - cause: { - RE_EXN_ID: Height_invariant_broken - } - }); + cause: { + RE_EXN_ID: Height_invariant_broken + } + }); } let diff = Pervasives.abs(hl - hr | 0); if (diff > 2) { throw new Error(Height_diff_borken, { - cause: { - RE_EXN_ID: Height_diff_borken - } - }); + cause: { + RE_EXN_ID: Height_diff_borken + } + }); } return h; } @@ -251,15 +251,15 @@ function internal_bal(l, v, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set_gen.res", - 278, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set_gen.res", + 278, + 15 + ] + } + }); } let lr = l._2; let lv = l._1; @@ -271,15 +271,15 @@ function internal_bal(l, v, r) { return create(create(ll, lv, lr._0), lr._1, create(lr._2, v, r)); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set_gen.res", - 288, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set_gen.res", + 288, + 19 + ] + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -292,15 +292,15 @@ function internal_bal(l, v, r) { } if (typeof r !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set_gen.res", - 300, - 15 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set_gen.res", + 300, + 15 + ] + } + }); } let rr = r._2; let rv = r._1; @@ -312,25 +312,25 @@ function internal_bal(l, v, r) { return create(create(l, v, rl._0), rl._1, create(rl._2, rv, rr)); } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set_gen.res", - 306, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set_gen.res", + 306, + 19 + ] + } + }); } function remove_min_elt(x) { if (typeof x !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -451,28 +451,54 @@ function of_sorted_list(l) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + _0: "Empty", + _1: l.hd, + _2: "Empty", + _3: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - _0: "Empty", - _1: l.hd, + _0: { + TAG: "Node", + _0: "Empty", + _1: l.hd, + _2: "Empty", + _3: 1 + }, + _1: match.hd, _2: "Empty", - _3: 1 + _3: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -483,52 +509,24 @@ function of_sorted_list(l) { _2: "Empty", _3: 1 }, - _1: match.hd, - _2: "Empty", + _1: match$1.hd, + _2: { + TAG: "Node", + _0: "Empty", + _1: match$2.hd, + _2: "Empty", + _3: 1 + }, _3: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - _0: { - TAG: "Node", - _0: "Empty", - _1: l.hd, - _2: "Empty", - _3: 1 - }, - _1: match$1.hd, - _2: { - TAG: "Node", - _0: "Empty", - _1: match$2.hd, - _2: "Empty", - _3: 1 - }, - _3: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -541,15 +539,15 @@ function of_sorted_list(l) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set_gen.res", - 447, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set_gen.res", + 447, + 18 + ] + } + }); }; return sub(List.length(l), l)[0]; } @@ -698,7 +696,7 @@ function invariant(cmp, t) { } function compare_aux(cmp, _e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index ec021c83c3..6f1601514f 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -163,7 +163,7 @@ function $great$great$eq(e, f) { function map_opt(f, l) { let _acc = /* [] */0; let _l = l; - while(true) { + while (true) { let l$1 = _l; let acc = _acc; if (!l$1) { @@ -185,7 +185,7 @@ function map_opt(f, l) { function list_any(f, e) { if (e.NAME === "List") { let _l = e.VAL; - while(true) { + while (true) { let l = _l; if (!l) { return; @@ -205,7 +205,7 @@ function list_all(f, e) { if (e.NAME === "List") { let _acc = /* [] */0; let _l = e.VAL; - while(true) { + while (true) { let l = _l; let acc = _acc; if (!l) { @@ -235,8 +235,7 @@ function _try_atom(e, f) { } try { return Caml_option.some(f(e.VAL)); - } - catch (exn){ + } catch (exn) { return; } } @@ -362,7 +361,7 @@ function get_field(name) { return function (e) { if (e.NAME === "List") { let _l = e.VAL; - while(true) { + while (true) { let l = _l; if (!l) { return; @@ -417,7 +416,7 @@ function field(name, f) { } function _get_field_list(name, _l) { - while(true) { + while (true) { let l = _l; if (!l) { return; @@ -463,7 +462,7 @@ function field_list(name, f) { } function _get_variant(s, args, _l) { - while(true) { + while (true) { let l = _l; if (!l) { return; @@ -499,11 +498,11 @@ function get_exn(e) { return Caml_option.valFromOption(e); } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "CCSexp.Traverse.get_exn" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "CCSexp.Traverse.get_exn" + } + }); } let of_unit = { diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index 9ac601aa21..bf9221f37e 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -14,7 +14,7 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function _must_escape(s) { try { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let c = s.codePointAt(i); let exit = 0; if (c >= 42) { @@ -23,17 +23,17 @@ function _must_escape(s) { exit = 1; } else { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } } else { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } } else if (c >= 11) { if (c >= 32) { @@ -44,18 +44,17 @@ function _must_escape(s) { case 37 : case 38 : case 39 : - exit = 1; - break; + exit = 1; + break; case 32 : case 34 : case 40 : case 41 : - throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); - + throw new Error(Pervasives.Exit, { + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } } else { exit = 1; @@ -63,32 +62,31 @@ function _must_escape(s) { } else { if (c >= 9) { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } exit = 1; } if (exit === 1 && c > 127) { throw new Error(Pervasives.Exit, { - cause: { - RE_EXN_ID: Pervasives.Exit - } - }); + cause: { + RE_EXN_ID: Pervasives.Exit + } + }); } } return false; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Pervasives.Exit) { return true; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -164,15 +162,15 @@ function _refill(t, k_succ, k_fail) { function _get(t) { if (t.i >= t.len) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "sexpm.res", - 111, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "sexpm.res", + 111, + 4 + ] + } + }); } let c = Caml_bytes.get(t.buf, t.i); t.i = t.i + 1 | 0; @@ -203,7 +201,7 @@ function _error_eof(t) { } function expr(k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return expr(k, extra); @@ -238,51 +236,50 @@ function expr_starting_with(c, k, t) { if (c >= 32) { switch (c) { case 32 : - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "sexpm.res", - 152, - 27 - ] - } - }); + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "sexpm.res", + 152, + 27 + ] + } + }); case 34 : - return quoted(k, t); + return quoted(k, t); case 33 : case 35 : case 36 : case 37 : case 38 : case 39 : - break; + break; case 40 : - return expr_list(/* [] */0, k, t); + return expr_list(/* [] */0, k, t); case 41 : - return _error(t, "unexpected ')'"); - + return _error(t, "unexpected ')'"); } } } else if (c >= 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "sexpm.res", - 152, - 27 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "sexpm.res", + 152, + 27 + ] + } + }); } Buffer.add_char(t.atom, c); return atom(k, t); } function expr_list(acc, k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return expr_list(acc, k, extra); @@ -345,7 +342,7 @@ function _return_atom(last, k, t) { } function atom(k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return atom(k, extra); @@ -368,14 +365,13 @@ function atom(k, t) { if (c >= 32) { switch (c) { case 32 : - exit = 2; - break; + exit = 2; + break; case 33 : - exit = 1; - break; + exit = 1; + break; case 34 : - return _error(t, "unexpected '\"' in the middle of an atom"); - + return _error(t, "unexpected '\"' in the middle of an atom"); } } else { exit = 1; @@ -385,17 +381,16 @@ function atom(k, t) { } switch (exit) { case 1 : - Buffer.add_char(t.atom, c); - continue; + Buffer.add_char(t.atom, c); + continue; case 2 : - return _return_atom(c, k, t); - + return _return_atom(c, k, t); } }; } function quoted(k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return quoted(k, extra); @@ -427,13 +422,13 @@ function escaped(k, t) { if (c < 117) { switch (c) { case 92 : - return k(/* '\\' */92); + return k(/* '\\' */92); case 98 : - return k(/* '\b' */8); + return k(/* '\b' */8); case 110 : - return k(/* '\n' */10); + return k(/* '\n' */10); case 114 : - return k(/* '\r' */13); + return k(/* '\r' */13); case 93 : case 94 : case 95 : @@ -454,10 +449,9 @@ function escaped(k, t) { case 112 : case 113 : case 115 : - break; + break; case 116 : - return k(/* '\t' */9); - + return k(/* '\t' */9); } } @@ -502,7 +496,7 @@ function read1int(i, k, t) { } function skip_comment(k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return skip_comment(k, extra); @@ -517,7 +511,7 @@ function skip_comment(k, t) { } function expr_or_end(k, t) { - while(true) { + while (true) { if (t.i === t.len) { return _refill(t, (function (extra) { return expr_or_end(k, extra); diff --git a/jscomp/test/simplify_lambda_632o.js b/jscomp/test/simplify_lambda_632o.js index 4324b08b2c..b2cf689ace 100644 --- a/jscomp/test/simplify_lambda_632o.js +++ b/jscomp/test/simplify_lambda_632o.js @@ -5,28 +5,26 @@ function f(x) { switch (x) { case "X1" : - return "X1"; + return "X1"; case "X2" : - return "X2"; + return "X2"; case "X3" : - return "X3"; + return "X3"; case "X4" : - return "X4"; - + return "X4"; } } function f2(x) { switch (x) { case "X1" : - return "X1"; + return "X1"; case "X2" : - return "X2"; + return "X2"; case "X3" : - return "X3"; + return "X3"; case "X4" : - return "X4"; - + return "X4"; } } diff --git a/jscomp/test/small_inline_test.js b/jscomp/test/small_inline_test.js index 9e13d19432..0654859b97 100644 --- a/jscomp/test/small_inline_test.js +++ b/jscomp/test/small_inline_test.js @@ -27,7 +27,7 @@ function hello5(y, f) { } function f(_x) { - while(true) { + while (true) { let x = _x; _x = x + 1 | 0; continue; @@ -35,7 +35,7 @@ function f(_x) { } function ff(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; _y = x + 1 | 0; @@ -45,7 +45,7 @@ function ff(_x, _y) { } function fff(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; _y = x; diff --git a/jscomp/test/stack_comp_test.js b/jscomp/test/stack_comp_test.js index dabb3ee849..915fafeb4c 100644 --- a/jscomp/test/stack_comp_test.js +++ b/jscomp/test/stack_comp_test.js @@ -59,15 +59,14 @@ function does_raise(f, s) { try { f(s); return false; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stack.Empty) { return true; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -217,7 +216,7 @@ let s$3 = { len: 0 }; -for(let i = 1; i <= 10; ++i){ +for (let i = 1; i <= 10; ++i) { Stack.push(i, s$3); } @@ -241,7 +240,7 @@ let s1 = { len: 0 }; -for(let i$1 = 1; i$1 <= 10; ++i$1){ +for (let i$1 = 1; i$1 <= 10; ++i$1) { Stack.push(i$1, s1); } @@ -315,11 +314,11 @@ assert_("File \"stack_comp_test.res\", line 109, characters 10-17", s1.len === 1 assert_("File \"stack_comp_test.res\", line 110, characters 10-17", s2.len === 10); -for(let i$2 = 10; i$2 >= 1; --i$2){ +for (let i$2 = 10; i$2 >= 1; --i$2) { assert_("File \"stack_comp_test.res\", line 112, characters 12-19", Stack.pop(s1) === i$2); } -for(let i$3 = 10; i$3 >= 1; --i$3){ +for (let i$3 = 10; i$3 >= 1; --i$3) { assert_("File \"stack_comp_test.res\", line 115, characters 12-19", Stack.pop(s2) === i$3); } @@ -330,13 +329,13 @@ let s$4 = { assert_("File \"stack_comp_test.res\", line 121, characters 10-17", s$4.c === /* [] */0); -for(let i$4 = 1; i$4 <= 10; ++i$4){ +for (let i$4 = 1; i$4 <= 10; ++i$4) { Stack.push(i$4, s$4); assert_("File \"stack_comp_test.res\", line 124, characters 12-19", s$4.len === i$4); assert_("File \"stack_comp_test.res\", line 125, characters 12-19", s$4.c !== /* [] */0); } -for(let i$5 = 10; i$5 >= 1; --i$5){ +for (let i$5 = 10; i$5 >= 1; --i$5) { assert_("File \"stack_comp_test.res\", line 128, characters 12-19", s$4.len === i$5); assert_("File \"stack_comp_test.res\", line 129, characters 12-19", s$4.c !== /* [] */0); Stack.pop(s$4); @@ -351,7 +350,7 @@ let s$5 = { len: 0 }; -for(let i$6 = 10; i$6 >= 1; --i$6){ +for (let i$6 = 10; i$6 >= 1; --i$6) { Stack.push(i$6, s$5); } @@ -388,7 +387,7 @@ let s1$2 = { len: 0 }; -for(let i$8 = 1; i$8 <= 4; ++i$8){ +for (let i$8 = 1; i$8 <= 4; ++i$8) { Stack.push(i$8, s1$2); } diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index 462de12883..d6368ae6c8 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -7,7 +7,7 @@ let Stack = require("../../lib/js/stack.js"); function to_list(v) { let acc = /* [] */0; - while(v.c !== /* [] */0) { + while (v.c !== /* [] */0) { acc = { hd: Stack.pop(v), tl: acc diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index d8c949d0ee..c79f09df72 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -22,8 +22,7 @@ function parse(token) { } try { return token(); - } - catch (exn){ + } catch (exn) { return { TAG: "Kwd", _0: "==" @@ -34,44 +33,44 @@ function parse(token) { let n = token$1(); switch (n.TAG) { case "Kwd" : - if (n._0 === "(") { - let v = parse_expr_aux(parse_term()); - let match = token$1(); - if (match.TAG === "Kwd") { - if (match._0 === ")") { - return v; - } - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unbalanced parens" - } - }); + if (n._0 === "(") { + let v = parse_expr_aux(parse_term()); + let match = token$1(); + if (match.TAG === "Kwd") { + if (match._0 === ")") { + return v; } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unbalanced parens" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "Unbalanced parens" + } + }); } - Queue.push(n, look_ahead); throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "unexpected token" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "Unbalanced parens" + } + }); + } + Queue.push(n, look_ahead); + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error, + _1: "unexpected token" + } + }); case "Int" : - return n._0; + return n._0; default: Queue.push(n, look_ahead); throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "unexpected token" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "unexpected token" + } + }); } }; let parse_term = function () { @@ -82,9 +81,9 @@ function parse(token) { if (e.TAG === "Kwd") { switch (e._0) { case "+" : - return e1 + parse_expr_aux(parse_term()) | 0; + return e1 + parse_expr_aux(parse_term()) | 0; case "-" : - return e1 - parse_expr_aux(parse_term()) | 0; + return e1 - parse_expr_aux(parse_term()) | 0; default: Queue.push(e, look_ahead); return e1; @@ -99,9 +98,9 @@ function parse(token) { if (e.TAG === "Kwd") { switch (e._0) { case "*" : - return Math.imul(e1, parse_term_aux(parse_atom())); + return Math.imul(e1, parse_term_aux(parse_atom())); case "/" : - return Caml_int32.div(e1, parse_term_aux(parse_atom())); + return Caml_int32.div(e1, parse_term_aux(parse_atom())); default: Queue.push(e, look_ahead); return e1; @@ -162,8 +161,7 @@ function l_parse(token) { } try { return token(); - } - catch (exn){ + } catch (exn) { return { TAG: "Kwd", _0: "==" @@ -174,56 +172,56 @@ function l_parse(token) { let i = token$1(); switch (i.TAG) { case "Kwd" : - if (i._0 === "(") { - let v = parse_t_aux(parse_t()); - let t = token$1(); - if (t.TAG === "Kwd") { - if (t._0 === ")") { - return v; - } - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unbalanced )" - } - }); + if (i._0 === "(") { + let v = parse_t_aux(parse_t()); + let t = token$1(); + if (t.TAG === "Kwd") { + if (t._0 === ")") { + return v; } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unbalanced )" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "Unbalanced )" + } + }); } throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unexpected token" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "Unbalanced )" + } + }); + } + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error, + _1: "Unexpected token" + } + }); case "Int" : - return i._0; + return i._0; default: throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error, - _1: "Unexpected token" - } - }); + cause: { + RE_EXN_ID: Parse_error, + _1: "Unexpected token" + } + }); } }; let parse_f_aux = function (_a) { - while(true) { + while (true) { let a = _a; let t = token$1(); if (t.TAG === "Kwd") { switch (t._0) { case "*" : - _a = Math.imul(a, parse_f()); - continue; + _a = Math.imul(a, parse_f()); + continue; case "/" : - _a = Caml_int32.div(a, parse_f()); - continue; + _a = Caml_int32.div(a, parse_f()); + continue; default: Queue.push(t, look_ahead); return a; @@ -235,17 +233,17 @@ function l_parse(token) { }; }; let parse_t_aux = function (_a) { - while(true) { + while (true) { let a = _a; let t = token$1(); if (t.TAG === "Kwd") { switch (t._0) { case "+" : - _a = a + parse_f_aux(parse_f()) | 0; - continue; + _a = a + parse_f_aux(parse_f()) | 0; + continue; case "-" : - _a = a - parse_f_aux(parse_f()) | 0; - continue; + _a = a - parse_f_aux(parse_f()) | 0; + continue; default: Queue.push(t, look_ahead); return a; diff --git a/jscomp/test/string_set.js b/jscomp/test/string_set.js index 7103bdbfba..437b01483c 100644 --- a/jscomp/test/string_set.js +++ b/jscomp/test/string_set.js @@ -129,7 +129,7 @@ function diff(s1, s2) { } function mem(x, _tree) { - while(true) { + while (true) { let tree = _tree; if (typeof tree !== "object") { return false; @@ -169,7 +169,7 @@ function equal(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -220,14 +220,14 @@ function subset(_s1, _s2) { } function find(x, _tree) { - while(true) { + while (true) { let tree = _tree; if (typeof tree !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = tree._1; let c = Caml.string_compare(x, v); diff --git a/jscomp/test/string_set_test.js b/jscomp/test/string_set_test.js index 17bf8448c9..b4c2594891 100644 --- a/jscomp/test/string_set_test.js +++ b/jscomp/test/string_set_test.js @@ -31,7 +31,7 @@ function eq(loc, x, y) { let s = String_set.empty; -for(let i = 0; i <= 99999; ++i){ +for (let i = 0; i <= 99999; ++i) { s = String_set.add(String(i), s); } diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index 23f7e57812..7d8042cada 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -15,17 +15,17 @@ function ff(x) { case "0" : case "1" : case "2" : - a = 3; - break; + a = 3; + break; case "3" : - a = 4; - break; + a = 4; + break; case "4" : - a = 6; - break; + a = 6; + break; case "7" : - a = 7; - break; + a = 7; + break; default: a = 8; } @@ -38,17 +38,17 @@ function gg(x) { case 0 : case 1 : case 2 : - a = 3; - break; + a = 3; + break; case 3 : - a = 4; - break; + a = 4; + break; case 4 : - a = 6; - break; + a = 6; + break; case 8 : - a = 7; - break; + a = 7; + break; default: a = 8; } @@ -64,8 +64,7 @@ function rev_split_by_char(c, s) { hd: s$p, tl: l })); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return { @@ -74,8 +73,8 @@ function rev_split_by_char(c, s) { }; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; return loop(0, /* [] */0); @@ -86,7 +85,7 @@ function xsplit(delim, s) { if (len !== 0) { let _l = /* [] */0; let _x = len; - while(true) { + while (true) { let x = _x; let l = _l; if (x === 0) { @@ -95,8 +94,7 @@ function xsplit(delim, s) { let i$p; try { i$p = $$String.rindex_from(s, x - 1 | 0, delim); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return { @@ -105,8 +103,8 @@ function xsplit(delim, s) { }; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } let l_0 = $$String.sub(s, i$p + 1 | 0, (x - i$p | 0) - 1 | 0); let l$1 = { diff --git a/jscomp/test/stringmatch_test.js b/jscomp/test/stringmatch_test.js index 69510ced77..e9632da06a 100644 --- a/jscomp/test/stringmatch_test.js +++ b/jscomp/test/stringmatch_test.js @@ -12,41 +12,41 @@ function tst01(s) { if (tst01("") !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 22, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 22, + 2 + ] + } + }); } if (tst01("\x00\x00\x00\x03") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 23, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 23, + 2 + ] + } + }); } if (tst01("\x00\x00\x00\x00\x00\x00\x00\x07") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 24, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 24, + 2 + ] + } + }); } function tst02(s) { @@ -56,27 +56,27 @@ function tst02(s) { return 1; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 33, - 21 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 33, + 21 + ] + } + }); } if (len === 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 35, - 21 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 35, + 21 + ] + } + }); } if (s === "A") { return 2; @@ -87,119 +87,119 @@ function tst02(s) { if (tst02("") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 42, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 42, + 2 + ] + } + }); } if (tst02("A") !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 43, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 43, + 2 + ] + } + }); } if (tst02("B") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 44, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 44, + 2 + ] + } + }); } if (tst02("\x00\x00\x00\x00\x00\x00\x00\x07") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 45, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 45, + 2 + ] + } + }); } if (tst02("\x00\x00\x00\x03") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 46, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 46, + 2 + ] + } + }); } function tst03(s) { switch (s) { case "app_const" : - return 5; + return 5; case "app_const_const" : - return 9; + return 9; case "app_const_env" : - return 11; + return 11; case "app_const_meth" : - return 12; + return 12; case "app_const_var" : - return 10; + return 10; case "app_env" : - return 7; + return 7; case "app_env_const" : - return 14; + return 14; case "app_meth" : - return 8; + return 8; case "app_meth_const" : - return 15; + return 15; case "app_var" : - return 6; + return 6; case "app_var_const" : - return 13; + return 13; case "get_const" : - return 0; + return 0; case "get_env" : - return 2; + return 2; case "get_meth" : - return 3; + return 3; case "get_var" : - return 1; + return 1; case "meth_app_const" : - return 16; + return 16; case "meth_app_env" : - return 18; + return 18; case "meth_app_meth" : - return 19; + return 19; case "meth_app_var" : - return 17; + return 17; case "send_const" : - return 20; + return 20; case "send_env" : - return 22; + return 22; case "send_meth" : - return 23; + return 23; case "send_var" : - return 21; + return 21; case "set_var" : - return 4; + return 4; default: return -1; } @@ -207,654 +207,654 @@ function tst03(s) { if (tst03("get_const") !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 131, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 131, + 2 + ] + } + }); } if (tst03("set_congt") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 132, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 132, + 2 + ] + } + }); } if (tst03("get_var") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 133, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 133, + 2 + ] + } + }); } if (tst03("gat_ver") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 134, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 134, + 2 + ] + } + }); } if (tst03("get_env") !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 135, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 135, + 2 + ] + } + }); } if (tst03("get_env") !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 136, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 136, + 2 + ] + } + }); } if (tst03("get_meth") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 137, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 137, + 2 + ] + } + }); } if (tst03("met_geth") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 138, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 138, + 2 + ] + } + }); } if (tst03("set_var") !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 139, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 139, + 2 + ] + } + }); } if (tst03("sev_tar") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 140, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 140, + 2 + ] + } + }); } if (tst03("app_const") !== 5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 141, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 141, + 2 + ] + } + }); } if (tst03("ppa_const") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 142, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 142, + 2 + ] + } + }); } if (tst03("app_var") !== 6) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 143, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 143, + 2 + ] + } + }); } if (tst03("app_var") !== 6) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 144, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 144, + 2 + ] + } + }); } if (tst03("app_env") !== 7) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 145, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 145, + 2 + ] + } + }); } if (tst03("epp_anv") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 146, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 146, + 2 + ] + } + }); } if (tst03("app_meth") !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 147, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 147, + 2 + ] + } + }); } if (tst03("atp_meph") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 148, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 148, + 2 + ] + } + }); } if (tst03("app_const_const") !== 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 149, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 149, + 2 + ] + } + }); } if (tst03("app_const_const") !== 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 150, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 150, + 2 + ] + } + }); } if (tst03("app_const_var") !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 151, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 151, + 2 + ] + } + }); } if (tst03("atp_consp_var") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 152, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 152, + 2 + ] + } + }); } if (tst03("app_const_env") !== 11) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 153, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 153, + 2 + ] + } + }); } if (tst03("app_constne_v") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 154, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 154, + 2 + ] + } + }); } if (tst03("app_const_meth") !== 12) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 155, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 155, + 2 + ] + } + }); } if (tst03("spp_conat_meth") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 156, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 156, + 2 + ] + } + }); } if (tst03("app_var_const") !== 13) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 157, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 157, + 2 + ] + } + }); } if (tst03("app_va_rconst") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 158, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 158, + 2 + ] + } + }); } if (tst03("app_env_const") !== 14) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 159, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 159, + 2 + ] + } + }); } if (tst03("app_env_const") !== 14) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 160, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 160, + 2 + ] + } + }); } if (tst03("app_meth_const") !== 15) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 161, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 161, + 2 + ] + } + }); } if (tst03("app_teth_consm") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 162, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 162, + 2 + ] + } + }); } if (tst03("meth_app_const") !== 16) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 163, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 163, + 2 + ] + } + }); } if (tst03("math_epp_const") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 164, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 164, + 2 + ] + } + }); } if (tst03("meth_app_var") !== 17) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 165, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 165, + 2 + ] + } + }); } if (tst03("meth_app_var") !== 17) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 166, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 166, + 2 + ] + } + }); } if (tst03("meth_app_env") !== 18) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 167, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 167, + 2 + ] + } + }); } if (tst03("eeth_app_mnv") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 168, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 168, + 2 + ] + } + }); } if (tst03("meth_app_meth") !== 19) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 169, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 169, + 2 + ] + } + }); } if (tst03("meth_apt_meph") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 170, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 170, + 2 + ] + } + }); } if (tst03("send_const") !== 20) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 171, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 171, + 2 + ] + } + }); } if (tst03("tend_conss") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 172, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 172, + 2 + ] + } + }); } if (tst03("send_var") !== 21) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 173, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 173, + 2 + ] + } + }); } if (tst03("serd_van") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 174, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 174, + 2 + ] + } + }); } if (tst03("send_env") !== 22) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 175, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 175, + 2 + ] + } + }); } if (tst03("sen_denv") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 176, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 176, + 2 + ] + } + }); } if (tst03("send_meth") !== 23) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 177, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 177, + 2 + ] + } + }); } if (tst03("tend_mesh") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 178, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 178, + 2 + ] + } + }); } function tst04(s) { switch (s) { case "AAAAAAAA" : - return 0; + return 0; case "AAAAAAAAAAAAAAAA" : - return 1; + return 1; case "AAAAAAAAAAAAAAAAAAAAAAAA" : - return 2; + return 2; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 3; + return 3; case "BBBBBBBB" : - return 4; + return 4; case "BBBBBBBBBBBBBBBB" : - return 5; + return 5; case "BBBBBBBBBBBBBBBBBBBBBBBB" : - return 6; + return 6; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 7; + return 7; case "CCCCCCCC" : - return 8; + return 8; case "CCCCCCCCCCCCCCCC" : - return 9; + return 9; case "CCCCCCCCCCCCCCCCCCCCCCCC" : - return 10; + return 10; case "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC" : - return 11; + return 11; default: return -1; } @@ -862,279 +862,279 @@ function tst04(s) { if (tst04("AAAAAAAA") !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 215, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 215, + 2 + ] + } + }); } if (tst04("AAAAAAAAAAAAAAAA") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 216, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 216, + 2 + ] + } + }); } if (tst04("AAAAAAAAAAAAAAAAAAAAAAAA") !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 217, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 217, + 2 + ] + } + }); } if (tst04("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 218, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 218, + 2 + ] + } + }); } if (tst04("BBBBBBBB") !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 219, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 219, + 2 + ] + } + }); } if (tst04("BBBBBBBBBBBBBBBB") !== 5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 220, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 220, + 2 + ] + } + }); } if (tst04("BBBBBBBBBBBBBBBBBBBBBBBB") !== 6) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 221, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 221, + 2 + ] + } + }); } if (tst04("BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB") !== 7) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 222, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 222, + 2 + ] + } + }); } if (tst04("CCCCCCCC") !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 223, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 223, + 2 + ] + } + }); } if (tst04("CCCCCCCCCCCCCCCC") !== 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 224, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 224, + 2 + ] + } + }); } if (tst04("CCCCCCCCCCCCCCCCCCCCCCCC") !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 225, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 225, + 2 + ] + } + }); } if (tst04("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC") !== 11) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 226, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 226, + 2 + ] + } + }); } if (tst04("") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 227, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 227, + 2 + ] + } + }); } if (tst04("DDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 228, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 228, + 2 + ] + } + }); } if (tst04("DDDDDDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 229, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 229, + 2 + ] + } + }); } if (tst04("AAADDDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 230, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 230, + 2 + ] + } + }); } if (tst04("AAAAAAADDDDDDDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 231, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 231, + 2 + ] + } + }); } if (tst04("AAAAAAADDDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 232, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 232, + 2 + ] + } + }); } if (tst04("AAAAAAAAAAAAAAADDDD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 233, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 233, + 2 + ] + } + }); } function tst05(s) { switch (s) { case "AAA" : - return 0; + return 0; case "AAAA" : - return 1; + return 1; case "AAAAA" : - return 2; + return 2; case "AAAAAA" : - return 3; + return 3; case "AAAAAAA" : - return 4; + return 4; case "AAAAAAAAAAAA" : - return 5; + return 5; case "AAAAAAAAAAAAAAAA" : - return 6; + return 6; case "AAAAAAAAAAAAAAAAAAAA" : - return 7; + return 7; case "BBB" : - return 8; + return 8; case "BBBB" : - return 9; + return 9; case "BBBBB" : - return 10; + return 10; case "BBBBBB" : - return 11; + return 11; case "BBBBBBB" : - return 12; + return 12; default: return -1; } @@ -1142,288 +1142,288 @@ function tst05(s) { if (tst05("AAA") !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 272, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 272, + 2 + ] + } + }); } if (tst05("AAAA") !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 273, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 273, + 2 + ] + } + }); } if (tst05("AAAAA") !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 274, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 274, + 2 + ] + } + }); } if (tst05("AAAAAA") !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 275, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 275, + 2 + ] + } + }); } if (tst05("AAAAAAA") !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 276, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 276, + 2 + ] + } + }); } if (tst05("AAAAAAAAAAAA") !== 5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 277, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 277, + 2 + ] + } + }); } if (tst05("AAAAAAAAAAAAAAAA") !== 6) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 278, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 278, + 2 + ] + } + }); } if (tst05("AAAAAAAAAAAAAAAAAAAA") !== 7) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 279, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 279, + 2 + ] + } + }); } if (tst05("BBB") !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 280, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 280, + 2 + ] + } + }); } if (tst05("BBBB") !== 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 281, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 281, + 2 + ] + } + }); } if (tst05("BBBBB") !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 282, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 282, + 2 + ] + } + }); } if (tst05("BBBBBB") !== 11) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 283, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 283, + 2 + ] + } + }); } if (tst05("BBBBBBB") !== 12) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 284, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 284, + 2 + ] + } + }); } if (tst05("") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 285, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 285, + 2 + ] + } + }); } if (tst05("AAD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 286, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 286, + 2 + ] + } + }); } if (tst05("AAAD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 287, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 287, + 2 + ] + } + }); } if (tst05("AAAAAAD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 288, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 288, + 2 + ] + } + }); } if (tst05("AAAAAAAD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 289, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 289, + 2 + ] + } + }); } if (tst05("BBD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 290, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 290, + 2 + ] + } + }); } if (tst05("BBBD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 291, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 291, + 2 + ] + } + }); } if (tst05("BBBBBBD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 292, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 292, + 2 + ] + } + }); } if (tst05("BBBBBBBD") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 293, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 293, + 2 + ] + } + }); } let s00 = "and"; @@ -1797,189 +1797,189 @@ let t91 = "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"; function tst06(s) { switch (s) { case "A" : - return 55; + return 55; case "AA" : - return 56; + return 56; case "AAA" : - return 57; + return 57; case "AAAA" : - return 58; + return 58; case "AAAAA" : - return 59; + return 59; case "AAAAAA" : - return 60; + return 60; case "AAAAAAA" : - return 61; + return 61; case "AAAAAAAA" : - return 62; + return 62; case "AAAAAAAAA" : - return 63; + return 63; case "AAAAAAAAAA" : - return 64; + return 64; case "AAAAAAAAAAA" : - return 65; + return 65; case "AAAAAAAAAAAA" : - return 66; + return 66; case "AAAAAAAAAAAAA" : - return 67; + return 67; case "AAAAAAAAAAAAAA" : - return 68; + return 68; case "AAAAAAAAAAAAAAA" : - return 69; + return 69; case "AAAAAAAAAAAAAAAA" : - return 70; + return 70; case "AAAAAAAAAAAAAAAAA" : - return 71; + return 71; case "AAAAAAAAAAAAAAAAAA" : - return 72; + return 72; case "AAAAAAAAAAAAAAAAAAA" : - return 73; + return 73; case "AAAAAAAAAAAAAAAAAAAA" : - return 74; + return 74; case "AAAAAAAAAAAAAAAAAAAAA" : - return 75; + return 75; case "AAAAAAAAAAAAAAAAAAAAAA" : - return 76; + return 76; case "AAAAAAAAAAAAAAAAAAAAAAA" : - return 77; + return 77; case "AAAAAAAAAAAAAAAAAAAAAAAA" : - return 78; + return 78; case "AAAAAAAAAAAAAAAAAAAAAAAAA" : - return 79; + return 79; case "AAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 80; + return 80; case "AAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 81; + return 81; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 82; + return 82; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 83; + return 83; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 84; + return 84; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 85; + return 85; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 86; + return 86; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 87; + return 87; case "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" : - return 88; + return 88; case "BBBBBBBBBBBBBBB" : - return 89; + return 89; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 90; + return 90; case "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" : - return 91; + return 91; case "and" : - return 0; + return 0; case "as" : - return 1; + return 1; case "asr" : - return 54; + return 54; case "assert" : - return 2; + return 2; case "begin" : - return 3; + return 3; case "class" : - return 4; + return 4; case "constraint" : - return 5; + return 5; case "do" : - return 6; + return 6; case "done" : - return 7; + return 7; case "downto" : - return 8; + return 8; case "else" : - return 9; + return 9; case "end" : - return 10; + return 10; case "exception" : - return 11; + return 11; case "external" : - return 12; + return 12; case "false" : - return 13; + return 13; case "for" : - return 14; + return 14; case "fun" : - return 15; + return 15; case "function" : - return 16; + return 16; case "functor" : - return 17; + return 17; case "if" : - return 18; + return 18; case "in" : - return 19; + return 19; case "include" : - return 20; + return 20; case "inherit" : - return 21; + return 21; case "initializer" : - return 22; + return 22; case "land" : - return 49; + return 49; case "lazy" : - return 23; + return 23; case "let" : - return 24; + return 24; case "lor" : - return 50; + return 50; case "lsl" : - return 52; + return 52; case "lsr" : - return 53; + return 53; case "lxor" : - return 51; + return 51; case "match" : - return 25; + return 25; case "method" : - return 26; + return 26; case "mod" : - return 48; + return 48; case "module" : - return 27; + return 27; case "mutable" : - return 28; + return 28; case "new" : - return 29; + return 29; case "object" : - return 30; + return 30; case "of" : - return 31; + return 31; case "open" : - return 32; + return 32; case "or" : - return 33; + return 33; case "private" : - return 34; + return 34; case "rec" : - return 35; + return 35; case "sig" : - return 36; + return 36; case "struct" : - return 37; + return 37; case "then" : - return 38; + return 38; case "to" : - return 39; + return 39; case "true" : - return 40; + return 40; case "try" : - return 41; + return 41; case "type" : - return 42; + return 42; case "val" : - return 43; + return 43; case "virtual" : - return 44; + return 44; case "when" : - return 45; + return 45; case "while" : - return 46; + return 46; case "with" : - return 47; + return 47; default: return -1; } @@ -1987,2407 +1987,2407 @@ function tst06(s) { if (tst06(s00) !== 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 582, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 582, + 2 + ] + } + }); } if (tst06(t00) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 583, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 583, + 2 + ] + } + }); } if (tst06(s01) !== 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 584, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 584, + 2 + ] + } + }); } if (tst06(t01) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 585, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 585, + 2 + ] + } + }); } if (tst06(s02) !== 2) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 586, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 586, + 2 + ] + } + }); } if (tst06(t02) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 587, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 587, + 2 + ] + } + }); } if (tst06(s03) !== 3) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 588, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 588, + 2 + ] + } + }); } if (tst06(t03) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 589, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 589, + 2 + ] + } + }); } if (tst06(s04) !== 4) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 590, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 590, + 2 + ] + } + }); } if (tst06(t04) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 591, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 591, + 2 + ] + } + }); } if (tst06(s05) !== 5) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 592, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 592, + 2 + ] + } + }); } if (tst06(t05) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 593, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 593, + 2 + ] + } + }); } if (tst06(s06) !== 6) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 594, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 594, + 2 + ] + } + }); } if (tst06(t06) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 595, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 595, + 2 + ] + } + }); } if (tst06(s07) !== 7) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 596, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 596, + 2 + ] + } + }); } if (tst06(t07) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 597, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 597, + 2 + ] + } + }); } if (tst06(s08) !== 8) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 598, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 598, + 2 + ] + } + }); } if (tst06(t08) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 599, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 599, + 2 + ] + } + }); } if (tst06(s09) !== 9) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 600, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 600, + 2 + ] + } + }); } if (tst06(t09) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 601, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 601, + 2 + ] + } + }); } if (tst06(s10) !== 10) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 602, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 602, + 2 + ] + } + }); } if (tst06(t10) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 603, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 603, + 2 + ] + } + }); } if (tst06(s11) !== 11) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 604, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 604, + 2 + ] + } + }); } if (tst06(t11) !== 11) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 605, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 605, + 2 + ] + } + }); } if (tst06(s12) !== 12) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 606, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 606, + 2 + ] + } + }); } if (tst06(t12) !== 12) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 607, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 607, + 2 + ] + } + }); } if (tst06(s13) !== 13) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 608, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 608, + 2 + ] + } + }); } if (tst06(t13) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 609, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 609, + 2 + ] + } + }); } if (tst06(s14) !== 14) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 610, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 610, + 2 + ] + } + }); } if (tst06(t14) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 611, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 611, + 2 + ] + } + }); } if (tst06(s15) !== 15) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 612, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 612, + 2 + ] + } + }); } if (tst06(t15) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 613, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 613, + 2 + ] + } + }); } if (tst06(s16) !== 16) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 614, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 614, + 2 + ] + } + }); } if (tst06(t16) !== 16) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 615, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 615, + 2 + ] + } + }); } if (tst06(s17) !== 17) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 616, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 616, + 2 + ] + } + }); } if (tst06(t17) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 617, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 617, + 2 + ] + } + }); } if (tst06(s18) !== 18) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 618, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 618, + 2 + ] + } + }); } if (tst06(t18) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 619, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 619, + 2 + ] + } + }); } if (tst06(s19) !== 19) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 620, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 620, + 2 + ] + } + }); } if (tst06(t19) !== 19) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 621, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 621, + 2 + ] + } + }); } if (tst06(s20) !== 20) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 622, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 622, + 2 + ] + } + }); } if (tst06(t20) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 623, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 623, + 2 + ] + } + }); } if (tst06(s21) !== 21) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 624, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 624, + 2 + ] + } + }); } if (tst06(t21) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 625, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 625, + 2 + ] + } + }); } if (tst06(s22) !== 22) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 626, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 626, + 2 + ] + } + }); } if (tst06(t22) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 627, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 627, + 2 + ] + } + }); } if (tst06(s23) !== 23) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 628, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 628, + 2 + ] + } + }); } if (tst06(t23) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 629, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 629, + 2 + ] + } + }); } if (tst06(s24) !== 24) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 630, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 630, + 2 + ] + } + }); } if (tst06(t24) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 631, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 631, + 2 + ] + } + }); } if (tst06(s25) !== 25) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 632, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 632, + 2 + ] + } + }); } if (tst06(t25) !== 25) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 633, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 633, + 2 + ] + } + }); } if (tst06(s26) !== 26) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 634, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 634, + 2 + ] + } + }); } if (tst06(t26) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 635, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 635, + 2 + ] + } + }); } if (tst06(s27) !== 27) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 636, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 636, + 2 + ] + } + }); } if (tst06(t27) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 637, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 637, + 2 + ] + } + }); } if (tst06(s28) !== 28) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 638, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 638, + 2 + ] + } + }); } if (tst06(t28) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 639, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 639, + 2 + ] + } + }); } if (tst06(s29) !== 29) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 640, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 640, + 2 + ] + } + }); } if (tst06(t29) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 641, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 641, + 2 + ] + } + }); } if (tst06(s30) !== 30) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 642, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 642, + 2 + ] + } + }); } if (tst06(t30) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 643, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 643, + 2 + ] + } + }); } if (tst06(s31) !== 31) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 644, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 644, + 2 + ] + } + }); } if (tst06(t31) !== 31) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 645, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 645, + 2 + ] + } + }); } if (tst06(s32) !== 32) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 646, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 646, + 2 + ] + } + }); } if (tst06(t32) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 647, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 647, + 2 + ] + } + }); } if (tst06(s33) !== 33) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 648, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 648, + 2 + ] + } + }); } if (tst06(t33) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 649, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 649, + 2 + ] + } + }); } if (tst06(s34) !== 34) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 650, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 650, + 2 + ] + } + }); } if (tst06(t34) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 651, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 651, + 2 + ] + } + }); } if (tst06(s35) !== 35) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 652, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 652, + 2 + ] + } + }); } if (tst06(t35) !== 35) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 653, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 653, + 2 + ] + } + }); } if (tst06(s36) !== 36) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 654, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 654, + 2 + ] + } + }); } if (tst06(t36) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 655, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 655, + 2 + ] + } + }); } if (tst06(s37) !== 37) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 656, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 656, + 2 + ] + } + }); } if (tst06(t37) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 657, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 657, + 2 + ] + } + }); } if (tst06(s38) !== 38) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 658, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 658, + 2 + ] + } + }); } if (tst06(t38) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 659, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 659, + 2 + ] + } + }); } if (tst06(s39) !== 39) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 660, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 660, + 2 + ] + } + }); } if (tst06(t39) !== 39) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 661, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 661, + 2 + ] + } + }); } if (tst06(s40) !== 40) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 662, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 662, + 2 + ] + } + }); } if (tst06(t40) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 663, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 663, + 2 + ] + } + }); } if (tst06(s41) !== 41) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 664, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 664, + 2 + ] + } + }); } if (tst06(t41) !== 41) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 665, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 665, + 2 + ] + } + }); } if (tst06(s42) !== 42) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 666, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 666, + 2 + ] + } + }); } if (tst06(t42) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 667, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 667, + 2 + ] + } + }); } if (tst06(s43) !== 43) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 668, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 668, + 2 + ] + } + }); } if (tst06(t43) !== 43) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 669, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 669, + 2 + ] + } + }); } if (tst06(s44) !== 44) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 670, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 670, + 2 + ] + } + }); } if (tst06(t44) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 671, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 671, + 2 + ] + } + }); } if (tst06(s45) !== 45) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 672, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 672, + 2 + ] + } + }); } if (tst06(t45) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 673, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 673, + 2 + ] + } + }); } if (tst06(s46) !== 46) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 674, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 674, + 2 + ] + } + }); } if (tst06(t46) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 675, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 675, + 2 + ] + } + }); } if (tst06(s47) !== 47) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 676, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 676, + 2 + ] + } + }); } if (tst06(t47) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 677, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 677, + 2 + ] + } + }); } if (tst06(s48) !== 48) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 678, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 678, + 2 + ] + } + }); } if (tst06(t48) !== 48) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 679, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 679, + 2 + ] + } + }); } if (tst06(s49) !== 49) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 680, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 680, + 2 + ] + } + }); } if (tst06(t49) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 681, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 681, + 2 + ] + } + }); } if (tst06(s50) !== 50) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 682, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 682, + 2 + ] + } + }); } if (tst06(t50) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 683, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 683, + 2 + ] + } + }); } if (tst06(s51) !== 51) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 684, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 684, + 2 + ] + } + }); } if (tst06(t51) !== 51) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 685, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 685, + 2 + ] + } + }); } if (tst06(s52) !== 52) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 686, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 686, + 2 + ] + } + }); } if (tst06(t52) !== 52) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 687, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 687, + 2 + ] + } + }); } if (tst06(s53) !== 53) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 688, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 688, + 2 + ] + } + }); } if (tst06(t53) !== 53) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 689, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 689, + 2 + ] + } + }); } if (tst06(s54) !== 54) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 690, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 690, + 2 + ] + } + }); } if (tst06(t54) !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 691, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 691, + 2 + ] + } + }); } if (tst06(s55) !== 55) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 692, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 692, + 2 + ] + } + }); } if (tst06(t55) !== 55) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 693, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 693, + 2 + ] + } + }); } if (tst06(s56) !== 56) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 694, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 694, + 2 + ] + } + }); } if (tst06(t56) !== 56) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 695, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 695, + 2 + ] + } + }); } if (tst06(s57) !== 57) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 696, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 696, + 2 + ] + } + }); } if (tst06(t57) !== 57) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 697, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 697, + 2 + ] + } + }); } if (tst06(s58) !== 58) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 698, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 698, + 2 + ] + } + }); } if (tst06(t58) !== 58) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 699, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 699, + 2 + ] + } + }); } if (tst06(s59) !== 59) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 700, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 700, + 2 + ] + } + }); } if (tst06(t59) !== 59) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 701, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 701, + 2 + ] + } + }); } if (tst06(s60) !== 60) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 702, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 702, + 2 + ] + } + }); } if (tst06(t60) !== 60) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 703, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 703, + 2 + ] + } + }); } if (tst06(s61) !== 61) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 704, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 704, + 2 + ] + } + }); } if (tst06(t61) !== 61) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 705, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 705, + 2 + ] + } + }); } if (tst06(s62) !== 62) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 706, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 706, + 2 + ] + } + }); } if (tst06(t62) !== 62) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 707, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 707, + 2 + ] + } + }); } if (tst06(s63) !== 63) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 708, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 708, + 2 + ] + } + }); } if (tst06(t63) !== 63) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 709, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 709, + 2 + ] + } + }); } if (tst06(s64) !== 64) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 710, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 710, + 2 + ] + } + }); } if (tst06(t64) !== 64) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 711, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 711, + 2 + ] + } + }); } if (tst06(s65) !== 65) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 712, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 712, + 2 + ] + } + }); } if (tst06(t65) !== 65) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 713, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 713, + 2 + ] + } + }); } if (tst06(s66) !== 66) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 714, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 714, + 2 + ] + } + }); } if (tst06(t66) !== 66) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 715, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 715, + 2 + ] + } + }); } if (tst06(s67) !== 67) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 716, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 716, + 2 + ] + } + }); } if (tst06(t67) !== 67) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 717, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 717, + 2 + ] + } + }); } if (tst06(s68) !== 68) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 718, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 718, + 2 + ] + } + }); } if (tst06(t68) !== 68) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 719, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 719, + 2 + ] + } + }); } if (tst06(s69) !== 69) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 720, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 720, + 2 + ] + } + }); } if (tst06(t69) !== 69) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 721, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 721, + 2 + ] + } + }); } if (tst06(s70) !== 70) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 722, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 722, + 2 + ] + } + }); } if (tst06(t70) !== 70) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 723, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 723, + 2 + ] + } + }); } if (tst06(s71) !== 71) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 724, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 724, + 2 + ] + } + }); } if (tst06(t71) !== 71) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 725, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 725, + 2 + ] + } + }); } if (tst06(s72) !== 72) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 726, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 726, + 2 + ] + } + }); } if (tst06(t72) !== 72) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 727, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 727, + 2 + ] + } + }); } if (tst06(s73) !== 73) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 728, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 728, + 2 + ] + } + }); } if (tst06(t73) !== 73) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 729, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 729, + 2 + ] + } + }); } if (tst06(s74) !== 74) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 730, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 730, + 2 + ] + } + }); } if (tst06(t74) !== 74) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 731, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 731, + 2 + ] + } + }); } if (tst06(s75) !== 75) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 732, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 732, + 2 + ] + } + }); } if (tst06(t75) !== 75) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 733, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 733, + 2 + ] + } + }); } if (tst06(s76) !== 76) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 734, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 734, + 2 + ] + } + }); } if (tst06(t76) !== 76) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 735, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 735, + 2 + ] + } + }); } if (tst06(s77) !== 77) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 736, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 736, + 2 + ] + } + }); } if (tst06(t77) !== 77) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 737, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 737, + 2 + ] + } + }); } if (tst06(s78) !== 78) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 738, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 738, + 2 + ] + } + }); } if (tst06(t78) !== 78) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 739, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 739, + 2 + ] + } + }); } if (tst06(s79) !== 79) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 740, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 740, + 2 + ] + } + }); } if (tst06(t79) !== 79) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 741, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 741, + 2 + ] + } + }); } if (tst06(s80) !== 80) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 742, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 742, + 2 + ] + } + }); } if (tst06(t80) !== 80) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 743, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 743, + 2 + ] + } + }); } if (tst06(s81) !== 81) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 744, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 744, + 2 + ] + } + }); } if (tst06(t81) !== 81) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 745, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 745, + 2 + ] + } + }); } if (tst06(s82) !== 82) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 746, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 746, + 2 + ] + } + }); } if (tst06(t82) !== 82) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 747, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 747, + 2 + ] + } + }); } if (tst06(s83) !== 83) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 748, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 748, + 2 + ] + } + }); } if (tst06(t83) !== 83) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 749, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 749, + 2 + ] + } + }); } if (tst06(s84) !== 84) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 750, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 750, + 2 + ] + } + }); } if (tst06(t84) !== 84) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 751, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 751, + 2 + ] + } + }); } if (tst06(s85) !== 85) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 752, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 752, + 2 + ] + } + }); } if (tst06(t85) !== 85) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 753, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 753, + 2 + ] + } + }); } if (tst06(s86) !== 86) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 754, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 754, + 2 + ] + } + }); } if (tst06(t86) !== 86) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 755, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 755, + 2 + ] + } + }); } if (tst06(s87) !== 87) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 756, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 756, + 2 + ] + } + }); } if (tst06(t87) !== 87) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 757, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 757, + 2 + ] + } + }); } if (tst06(s88) !== 88) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 758, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 758, + 2 + ] + } + }); } if (tst06(t88) !== 88) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 759, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 759, + 2 + ] + } + }); } if (tst06(s89) !== 89) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 760, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 760, + 2 + ] + } + }); } if (tst06(t89) !== 89) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 761, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 761, + 2 + ] + } + }); } if (tst06(s90) !== 90) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 762, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 762, + 2 + ] + } + }); } if (tst06(t90) !== 90) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 763, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 763, + 2 + ] + } + }); } if (tst06(s91) !== 91) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 764, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 764, + 2 + ] + } + }); } if (tst06(t91) !== 91) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 765, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 765, + 2 + ] + } + }); } if (tst06("") !== -1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stringmatch_test.res", - 766, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stringmatch_test.res", + 766, + 2 + ] + } + }); } exports.tst01 = tst01; diff --git a/jscomp/test/switch_case_test.js b/jscomp/test/switch_case_test.js index 110f8d48d7..6990bc227c 100644 --- a/jscomp/test/switch_case_test.js +++ b/jscomp/test/switch_case_test.js @@ -31,13 +31,13 @@ function eq(loc, x, y) { function f(x) { switch (x) { case "xx'''" : - return 0; + return 0; case "xx\"" : - return 1; + return 1; case "xx\\\"" : - return 2; + return 2; case "xx\\\"\"" : - return 3; + return 3; default: return 4; } diff --git a/jscomp/test/switch_string.js b/jscomp/test/switch_string.js index 44bb2901b2..4cdd65b785 100644 --- a/jscomp/test/switch_string.js +++ b/jscomp/test/switch_string.js @@ -13,9 +13,9 @@ function foo(x) { function bar(x) { switch (x) { case "\\" : - return "\\"; + return "\\"; case "😀" : - return "😀"; + return "😀"; default: return ""; } diff --git a/jscomp/test/tagged_template_test.js b/jscomp/test/tagged_template_test.js index 02226e62b1..9fc3b9c2f4 100644 --- a/jscomp/test/tagged_template_test.js +++ b/jscomp/test/tagged_template_test.js @@ -30,7 +30,7 @@ let length = Tagged_template_libJs.length`hello ${10} what's the total length? I function foo(strings, values) { let res = ""; let valueCount = values.length; - for(let i = 0; i < valueCount; ++i){ + for (let i = 0; i < valueCount; ++i) { res = res + Caml_array.get(strings, i) + String(Math.imul(Caml_array.get(values, i), 10)); } return res + Caml_array.get(strings, valueCount); diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index 820658b385..c419a6d6b1 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -7,7 +7,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); function f() { let f$1 = function (_acc, _n) { - while(true) { + while (true) { let n = _n; let acc = _acc; if (n <= 0) { @@ -19,7 +19,7 @@ function f() { }; }; let v = Caml_array.make(10, 0); - for(let i = 0; i <= 9; ++i){ + for (let i = 0; i <= 9; ++i) { Caml_array.set(v, i, f$1(0, i)); } return v; diff --git a/jscomp/test/test_ari.js b/jscomp/test/test_ari.js index 32407d6233..8c25d0ec2b 100644 --- a/jscomp/test/test_ari.js +++ b/jscomp/test/test_ari.js @@ -30,7 +30,7 @@ function ff(extra) { let fff = VV.test_primit2(3); function length_aux(_len, _x) { - while(true) { + while (true) { let x = _x; let len = _len; if (!x) { diff --git a/jscomp/test/test_array_primitive.js b/jscomp/test/test_array_primitive.js index d1dc53858d..3ac46e92e8 100644 --- a/jscomp/test/test_array_primitive.js +++ b/jscomp/test/test_array_primitive.js @@ -5,7 +5,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); function caml_array_sub(x, offset, len) { let result = new Array(len); - for(let j = 0; j < len; ++j){ + for (let j = 0; j < len; ++j) { Caml_array.set(result, j, Caml_array.get(x, offset + j | 0)); } return result; @@ -14,11 +14,11 @@ function caml_array_sub(x, offset, len) { function caml_array_set(xs, index, newval) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } Caml_array.set(xs, index, newval); } @@ -26,18 +26,18 @@ function caml_array_set(xs, index, newval) { function caml_array_get(xs, index) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return Caml_array.get(xs, index); } function caml_make_vect(len, init) { let b = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { Caml_array.set(b, i, init); } return b; diff --git a/jscomp/test/test_bool_equal.js b/jscomp/test/test_bool_equal.js index e5b824d6e7..d4a80430d8 100644 --- a/jscomp/test/test_bool_equal.js +++ b/jscomp/test/test_bool_equal.js @@ -19,51 +19,51 @@ function bool_equal(x, y) { function assertions() { if (!bool_equal(true, true)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_bool_equal.res", - 16, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_bool_equal.res", + 16, + 2 + ] + } + }); } if (!bool_equal(false, false)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_bool_equal.res", - 17, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_bool_equal.res", + 17, + 2 + ] + } + }); } if (bool_equal(true, false)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_bool_equal.res", - 18, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_bool_equal.res", + 18, + 2 + ] + } + }); } if (bool_equal(false, true)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_bool_equal.res", - 19, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_bool_equal.res", + 19, + 2 + ] + } + }); } } diff --git a/jscomp/test/test_bug.js b/jscomp/test/test_bug.js index 1dd0680f50..47d483ac4e 100644 --- a/jscomp/test/test_bug.js +++ b/jscomp/test/test_bug.js @@ -7,7 +7,7 @@ let Caml_bytes = require("../../lib/js/caml_bytes.js"); function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let c = s[i]; let tmp; let exit = 0; @@ -38,7 +38,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c$1 = s[i$1]; let exit$1 = 0; if (c$1 > 92 || c$1 < 34) { @@ -47,20 +47,20 @@ function escaped(s) { } else { switch (c$1) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -71,14 +71,13 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit$1 = 1; - break; + exit$1 = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } } else if (c$1 > 91 || c$1 < 35) { diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index d19b24cb89..ebef4942f9 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -12,7 +12,7 @@ function f() { let arr = Caml_array.make(10, (function (param) { })); - for(let i = 0; i <= 9; ++i){ + for (let i = 0; i <= 9; ++i) { Caml_array.set(arr, i, (function (param) { v.contents = v.contents + i | 0; })); @@ -28,15 +28,15 @@ $$Array.iter((function (x) { if (v.contents !== 45) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_closure.res", - 52, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_closure.res", + 52, + 2 + ] + } + }); } exports.v = v; diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index f1dff037ec..351f2d4edd 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -4,7 +4,7 @@ let Caml_array = require("../../lib/js/caml_array.js"); function f(_n, _acc) { - while(true) { + while (true) { let acc = _acc; let n = _n; if (n === 0) { @@ -23,7 +23,7 @@ function test_closure() { let arr = Caml_array.make(6, (function (x) { return x; })); - for(let i = 0; i <= 6; ++i){ + for (let i = 0; i <= 6; ++i) { Caml_array.set(arr, i, (function (param) { return i; })); diff --git a/jscomp/test/test_demo.js b/jscomp/test/test_demo.js index 4a5a6409e0..4fb912cfb3 100644 --- a/jscomp/test/test_demo.js +++ b/jscomp/test/test_demo.js @@ -33,7 +33,7 @@ function map(f, x) { function sum(n) { let v = 0; - for(let i = 0; i <= n; ++i){ + for (let i = 0; i <= n; ++i) { v = v + i | 0; } return v; diff --git a/jscomp/test/test_exception.js b/jscomp/test/test_exception.js index b050e637b5..d8fd225654 100644 --- a/jscomp/test/test_exception.js +++ b/jscomp/test/test_exception.js @@ -8,45 +8,45 @@ let Local = /* @__PURE__ */Caml_exceptions.create("Test_exception.Local"); function f() { throw new Error(Local, { - cause: { - RE_EXN_ID: Local, - _1: 3 - } - }); + cause: { + RE_EXN_ID: Local, + _1: 3 + } + }); } function g() { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function h() { throw new Error(Test_common.U, { - cause: { - RE_EXN_ID: Test_common.U, - _1: 3 - } - }); + cause: { + RE_EXN_ID: Test_common.U, + _1: 3 + } + }); } function x() { throw new Error(Test_common.H, { - cause: { - RE_EXN_ID: Test_common.H - } - }); + cause: { + RE_EXN_ID: Test_common.H + } + }); } function xx() { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "x" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "x" + } + }); } let Nullary = /* @__PURE__ */Caml_exceptions.create("Test_exception.Nullary"); diff --git a/jscomp/test/test_exception_escape.js b/jscomp/test/test_exception_escape.js index 8b90039f39..418fec2b66 100644 --- a/jscomp/test/test_exception_escape.js +++ b/jscomp/test/test_exception_escape.js @@ -9,13 +9,12 @@ let f; try { throw new Error(A, { - cause: { - RE_EXN_ID: A, - _1: 3 - } - }); -} -catch (exn){ + cause: { + RE_EXN_ID: A, + _1: 3 + } + }); +} catch (exn) { f = 3; } diff --git a/jscomp/test/test_fib.js b/jscomp/test/test_fib.js index ccc19ec289..935791bd55 100644 --- a/jscomp/test/test_fib.js +++ b/jscomp/test/test_fib.js @@ -20,7 +20,7 @@ function fib2(x) { let v = 0; -for(let i = 0; i <= 10; ++i){ +for (let i = 0; i <= 10; ++i) { v = v + i | 0; } @@ -28,7 +28,7 @@ let sum = v; let v$1 = 0; -for(let i$1 = 10; i$1 >= 0; --i$1){ +for (let i$1 = 10; i$1 >= 0; --i$1) { v$1 = v$1 + i$1 | 0; } @@ -65,7 +65,7 @@ function map(f, x) { function f(x) { let v = x; let sum = 0; - while(v > 0) { + while (v > 0) { sum = sum + v | 0; v = v - 1 | 0; }; @@ -76,7 +76,7 @@ function fib3(n) { let _a = 0; let _b = 1; let _n = n; - while(true) { + while (true) { let n$1 = _n; let b = _b; let a = _a; diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index 343bc858c5..23a212f718 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -5,13 +5,13 @@ let $$Array = require("../../lib/js/array.js"); let Caml_array = require("../../lib/js/caml_array.js"); function for_(x) { - for(let i = 0 ,i_finish = (console.log("hi"), x.length); i <= i_finish; ++i){ + for (let i = 0, i_finish = (console.log("hi"), x.length); i <= i_finish; ++i) { console.log(Caml_array.get(x, i)); } } function for_2(x) { - for(let i = 0 ,i_finish = x.length; i <= i_finish; ++i){ + for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { console.log(Caml_array.get(x, i)); } } @@ -25,7 +25,7 @@ function for_3(x) { }; }), x); - for(let i = 0 ,i_finish = x.length; i <= i_finish; ++i){ + for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); Caml_array.set(arr, i, (function () { v.contents = v.contents + j | 0; @@ -46,7 +46,7 @@ function for_4(x) { }; }), x); - for(let i = 0 ,i_finish = x.length; i <= i_finish; ++i){ + for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); let k = (j << 1); Caml_array.set(arr, i, (function () { @@ -68,7 +68,7 @@ function for_5(x, u) { }; }), x); - for(let i = 0 ,i_finish = x.length; i <= i_finish; ++i){ + for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = Math.imul((u << 1), u); Caml_array.set(arr, i, (function () { v.contents = v.contents + k | 0; @@ -96,12 +96,12 @@ function for_6(x, u) { contents: 0 }; v4.contents = v4.contents + 1 | 0; - for(let j = 0; j <= 1; ++j){ + for (let j = 0; j <= 1; ++j) { v5.contents = v5.contents + 1 | 0; let v2 = { contents: 0 }; - for(let i = 0 ,i_finish = x.length; i <= i_finish; ++i){ + for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = Math.imul((u << 1), u); let h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; diff --git a/jscomp/test/test_for_map.js b/jscomp/test/test_for_map.js index 6c0aa0b9e9..d5400a46d9 100644 --- a/jscomp/test/test_for_map.js +++ b/jscomp/test/test_for_map.js @@ -44,11 +44,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -61,11 +61,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -79,11 +79,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -96,11 +96,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty(param) { @@ -158,14 +158,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.int_compare(x, param.v); if (c === 0) { @@ -177,21 +177,21 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -218,7 +218,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -228,7 +228,7 @@ function find_first_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -255,21 +255,21 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -296,7 +296,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -306,7 +306,7 @@ function find_last_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -333,7 +333,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -348,7 +348,7 @@ function find_opt(x, _param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -363,14 +363,14 @@ function mem(x, _param) { } function min_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -385,7 +385,7 @@ function min_binding(_param) { } function min_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -403,14 +403,14 @@ function min_binding_opt(_param) { } function max_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -425,7 +425,7 @@ function max_binding(_param) { } function max_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -445,11 +445,11 @@ function max_binding_opt(_param) { function remove_min_binding(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -555,7 +555,7 @@ function update(x, f, param) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -603,7 +603,7 @@ function mapi(f, param) { } function fold(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -616,7 +616,7 @@ function fold(f, _m, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -633,7 +633,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -754,15 +754,15 @@ function merge$1(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -854,7 +854,7 @@ function partition(p, param) { } function cons_enum(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -875,7 +875,7 @@ function cons_enum(_m, _e) { function compare(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -905,7 +905,7 @@ function compare(cmp, m1, m2) { function equal(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -939,7 +939,7 @@ function cardinal(param) { } function bindings_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1000,10 +1000,10 @@ let IntMap = { function assertion_test() { let m = "Empty"; - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { m = add(i, i, m); } - for(let i$1 = 0; i$1 <= 1000000; ++i$1){ + for (let i$1 = 0; i$1 <= 1000000; ++i$1) { find(i$1, m); } } diff --git a/jscomp/test/test_for_map2.js b/jscomp/test/test_for_map2.js index ccdd27da39..ff20587c02 100644 --- a/jscomp/test/test_for_map2.js +++ b/jscomp/test/test_for_map2.js @@ -5,10 +5,10 @@ let Int_map = require("./int_map.js"); function assertion_test() { let m = "Empty"; - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { m = Int_map.add(i, i, m); } - for(let i$1 = 0; i$1 <= 1000000; ++i$1){ + for (let i$1 = 0; i$1 <= 1000000; ++i$1) { Int_map.find(i$1, m); } } diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index 521a669292..55fd61de0f 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -26,7 +26,7 @@ let arr = $$Array.init(2, (function (param) { return 0; })); -for(let i = 0; i <= 1; ++i){ +for (let i = 0; i <= 1; ++i) { let f3$1 = function (extra) { return i + 1 | 0; }; diff --git a/jscomp/test/test_incomplete.js b/jscomp/test/test_incomplete.js index 89fb301e78..bfcf01440e 100644 --- a/jscomp/test/test_incomplete.js +++ b/jscomp/test/test_incomplete.js @@ -7,15 +7,15 @@ function f(x) { return /* 'a' */97; } throw new Error("Match_failure", { - cause: { - RE_EXN_ID: "Match_failure", - _1: [ - "test_incomplete.res", - 3, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Match_failure", + _1: [ + "test_incomplete.res", + 3, + 2 + ] + } + }); } function f2(x) { @@ -30,11 +30,10 @@ function f3(x) { switch (x.TAG) { case "A" : case "C" : - return x._0 + 1 | 0; + return x._0 + 1 | 0; case "B" : case "D" : - return x._0 + 2 | 0; - + return x._0 + 2 | 0; } } diff --git a/jscomp/test/test_int_map_find.js b/jscomp/test/test_int_map_find.js index bb5b8cdfce..b5de86fa27 100644 --- a/jscomp/test/test_int_map_find.js +++ b/jscomp/test/test_int_map_find.js @@ -33,11 +33,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -50,11 +50,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -68,11 +68,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -85,11 +85,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, param) { diff --git a/jscomp/test/test_list.js b/jscomp/test/test_list.js index 564d252d74..3f5818641f 100644 --- a/jscomp/test/test_list.js +++ b/jscomp/test/test_list.js @@ -6,7 +6,7 @@ let Caml_obj = require("../../lib/js/caml_obj.js"); let Pervasives = require("../../lib/js/pervasives.js"); function length_aux(_len, _x) { - while(true) { + while (true) { let x = _x; let len = _len; if (!x) { @@ -27,11 +27,11 @@ function hd(x) { return x.hd; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "hd" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "hd" + } + }); } function tl(x) { @@ -39,25 +39,25 @@ function tl(x) { return x.tl; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "tl" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "tl" + } + }); } function nth(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (l$1) { @@ -69,16 +69,16 @@ function nth(l, n) { continue; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "nth" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "nth" + } + }); }; } function rev_append(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -134,7 +134,7 @@ function mapi$1(f, l) { function rev_map(f, l) { let _accu = /* [] */0; let _x = l; - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -150,7 +150,7 @@ function rev_map(f, l) { } function iter(f, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return; @@ -164,7 +164,7 @@ function iter(f, _x) { function iteri(f, l) { let _i = 0; let _x = l; - while(true) { + while (true) { let x = _x; let i = _i; if (!x) { @@ -178,7 +178,7 @@ function iteri(f, l) { } function fold_left(f, _accu, _l) { - while(true) { + while (true) { let l = _l; let accu = _accu; if (!l) { @@ -208,28 +208,28 @@ function map2(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } function rev_map2(f, l1, l2) { let _accu = /* [] */0; let _l1 = l1; let _l2 = l2; - while(true) { + while (true) { let l2$1 = _l2; let l1$1 = _l1; let accu = _accu; @@ -244,26 +244,26 @@ function rev_map2(f, l1, l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } if (l2$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } return accu; }; } function iter2(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -274,26 +274,26 @@ function iter2(f, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); } if (!l2) { return; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); }; } function fold_left2(f, _accu, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; let accu = _accu; @@ -305,19 +305,19 @@ function fold_left2(f, _accu, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } return accu; }; @@ -329,25 +329,25 @@ function fold_right2(f, l1, l2, accu) { return f(l1.hd, l2.hd, fold_right2(f, l1.tl, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } function for_all(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return true; @@ -361,7 +361,7 @@ function for_all(p, _x) { } function exists(p, _x) { - while(true) { + while (true) { let x = _x; if (!x) { return false; @@ -375,7 +375,7 @@ function exists(p, _x) { } function for_all2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -388,26 +388,26 @@ function for_all2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); } if (!l2) { return true; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); }; } function exists2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -420,26 +420,26 @@ function exists2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); } if (!l2) { return false; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); }; } function mem(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (!x_) { return false; @@ -453,7 +453,7 @@ function mem(x, _x_) { } function memq(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (!x_) { return false; @@ -467,7 +467,7 @@ function memq(x, _x_) { } function assoc(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (x_) { let match = x_.hd; @@ -478,15 +478,15 @@ function assoc(x, _x_) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assq(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (x_) { let match = x_.hd; @@ -497,15 +497,15 @@ function assq(x, _x_) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function mem_assoc(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (!x_) { return false; @@ -519,7 +519,7 @@ function mem_assoc(x, _x_) { } function mem_assq(x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (!x_) { return false; @@ -565,7 +565,7 @@ function remove_assq(x, x_) { } function find(p, _x) { - while(true) { + while (true) { let x = _x; if (x) { let x$1 = x.hd; @@ -576,10 +576,10 @@ function find(p, _x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -587,7 +587,7 @@ function find_all(p) { return function (__x) { let _accu = /* [] */0; let _x = __x; - while(true) { + while (true) { let x = _x; let accu = _accu; if (!x) { @@ -613,7 +613,7 @@ function partition(p, l) { let _yes = /* [] */0; let _no = /* [] */0; let _x = l; - while(true) { + while (true) { let x = _x; let no = _no; let yes = _yes; @@ -675,21 +675,21 @@ function combine(l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } function merge(cmp, l1, l2) { @@ -715,7 +715,7 @@ function merge(cmp, l1, l2) { } function chop(_k, _l) { - while(true) { + while (true) { let l = _l; let k = _k; if (k === 0) { @@ -727,15 +727,15 @@ function chop(_k, _l) { continue; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_list.res", - 343, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_list.res", + 343, + 11 + ] + } + }); }; } @@ -858,7 +858,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1004,7 +1004,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1232,7 +1232,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1463,7 +1463,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; diff --git a/jscomp/test/test_match_exception.js b/jscomp/test/test_match_exception.js index 4fa365dee3..6fe415efa7 100644 --- a/jscomp/test/test_match_exception.js +++ b/jscomp/test/test_match_exception.js @@ -6,15 +6,14 @@ let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function f(g, x) { try { return g(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return 3; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/jscomp/test/test_order_tailcall.js b/jscomp/test/test_order_tailcall.js index 89884b4dc3..a19ffd551a 100644 --- a/jscomp/test/test_order_tailcall.js +++ b/jscomp/test/test_order_tailcall.js @@ -3,7 +3,7 @@ function f(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; _y = x; @@ -13,7 +13,7 @@ function f(_x, _y) { } function f1(_x, _y, _z) { - while(true) { + while (true) { let z = _z; let y = _y; let x = _x; @@ -26,7 +26,7 @@ function f1(_x, _y, _z) { } function f2(x, _y) { - while(true) { + while (true) { let y = _y; _y = y + 10 | 0; continue; @@ -34,7 +34,7 @@ function f2(x, _y) { } function f3(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; _y = x + 10 | 0; @@ -44,7 +44,7 @@ function f3(_x, _y) { } function f4(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; _y = y + x | 0; @@ -54,7 +54,7 @@ function f4(_x, _y) { } function f5(_x, _y, z) { - while(true) { + while (true) { let y = _y; _y = z + 20 | 0; _x = y + 10 | 0; @@ -63,7 +63,7 @@ function f5(_x, _y, z) { } function f6(b) { - while(true) { + while (true) { if (!b) { return false; } @@ -72,7 +72,7 @@ function f6(b) { } function f7(b) { - while(true) { + while (true) { if (b) { return true; } @@ -81,7 +81,7 @@ function f7(b) { } function f8(_x, _y) { - while(true) { + while (true) { let y = _y; let x = _x; if (x > 10) { diff --git a/jscomp/test/test_per.js b/jscomp/test/test_per.js index 9e71d99071..eea5830322 100644 --- a/jscomp/test/test_per.js +++ b/jscomp/test/test_per.js @@ -8,20 +8,20 @@ let Caml_exceptions = require("../../lib/js/caml_exceptions.js"); function failwith(s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); } function invalid_arg(s) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } let Exit = /* @__PURE__ */Caml_exceptions.create("Test_per.Exit"); @@ -98,11 +98,11 @@ function $caret(s1, s2) { function char_of_int(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "char_of_int" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "char_of_int" + } + }); } return n; } diff --git a/jscomp/test/test_ramification.js b/jscomp/test/test_ramification.js index 9065dc4388..d77e2eb12a 100644 --- a/jscomp/test/test_ramification.js +++ b/jscomp/test/test_ramification.js @@ -8,17 +8,17 @@ function ff(x) { case "0" : case "1" : case "2" : - a = 3; - break; + a = 3; + break; case "3" : - a = 4; - break; + a = 4; + break; case "4" : - a = 6; - break; + a = 6; + break; case "7" : - a = 7; - break; + a = 7; + break; default: a = 8; } diff --git a/jscomp/test/test_runtime_encoding.js b/jscomp/test/test_runtime_encoding.js index e5193310b3..77edc3a296 100644 --- a/jscomp/test/test_runtime_encoding.js +++ b/jscomp/test/test_runtime_encoding.js @@ -41,7 +41,7 @@ function aaaa(x) { } function f(x) { - for(let i = 0; i <= 10; ++i){ + for (let i = 0; i <= 10; ++i) { Caml_array.set(x, i, i); } } diff --git a/jscomp/test/test_seq.js b/jscomp/test/test_seq.js index fe6bb57c1a..10c3093667 100644 --- a/jscomp/test/test_seq.js +++ b/jscomp/test/test_seq.js @@ -13,7 +13,7 @@ let Help = /* @__PURE__ */Caml_exceptions.create("Test_seq.Help"); let Stop = /* @__PURE__ */Caml_exceptions.create("Test_seq.Stop"); function assoc3(x, _l) { - while(true) { + while (true) { let l = _l; if (l) { let match = l.hd; @@ -24,23 +24,23 @@ function assoc3(x, _l) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function help_action() { throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Unknown", - _0: "-help" - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Unknown", + _0: "-help" + } + } + }); } function v(speclist) { @@ -57,8 +57,7 @@ function add_help(speclist) { try { assoc3("-help", speclist); add1 = /* [] */0; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { add1 = { @@ -74,16 +73,15 @@ function add_help(speclist) { }; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } let add2; try { assoc3("--help", speclist); add2 = /* [] */0; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { add2 = { @@ -99,8 +97,8 @@ function add_help(speclist) { }; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } return Pervasives.$at(speclist, Pervasives.$at(add1, add2)); diff --git a/jscomp/test/test_set.js b/jscomp/test/test_set.js index b20f62893c..a8fbcc1f3f 100644 --- a/jscomp/test/test_set.js +++ b/jscomp/test/test_set.js @@ -32,11 +32,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l._2; let lv = l._1; @@ -48,11 +48,11 @@ function Make(Ord) { return create(create(ll, lv, lr._0), lr._1, create(lr._2, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -65,11 +65,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r._2; let rv = r._1; @@ -81,11 +81,11 @@ function Make(Ord) { return create(create(l, v, rl._0), rl._1, create(rl._2, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, x_) { if (typeof x_ !== "object") { @@ -150,14 +150,14 @@ function Make(Ord) { } }; let min_elt = function (_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -168,14 +168,14 @@ function Make(Ord) { }; }; let max_elt = function (_x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = x._2; if (typeof r !== "object") { @@ -188,11 +188,11 @@ function Make(Ord) { let remove_min_elt = function (x) { if (typeof x !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = x._0; if (typeof l !== "object") { @@ -261,7 +261,7 @@ function Make(Ord) { } }; let mem = function (x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return false; @@ -351,7 +351,7 @@ function Make(Ord) { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -368,7 +368,7 @@ function Make(Ord) { }; }; let compare_aux = function (_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -397,7 +397,7 @@ function Make(Ord) { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -447,7 +447,7 @@ function Make(Ord) { }; }; let iter = function (f, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { return; @@ -459,7 +459,7 @@ function Make(Ord) { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -471,7 +471,7 @@ function Make(Ord) { }; }; let for_all = function (p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return true; @@ -487,7 +487,7 @@ function Make(Ord) { }; }; let exists = function (p, _x) { - while(true) { + while (true) { let x = _x; if (typeof x !== "object") { return false; @@ -551,7 +551,7 @@ function Make(Ord) { } }; let elements_aux = function (_accu, _x) { - while(true) { + while (true) { let x = _x; let accu = _accu; if (typeof x !== "object") { @@ -569,14 +569,14 @@ function Make(Ord) { return elements_aux(/* [] */0, s); }; let find = function (x, _x_) { - while(true) { + while (true) { let x_ = _x_; if (typeof x_ !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = x_._1; let c = Ord.compare(x, v); @@ -591,28 +591,54 @@ function Make(Ord) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + _0: "Empty", + _1: l.hd, + _2: "Empty", + _3: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - _0: "Empty", - _1: l.hd, + _0: { + TAG: "Node", + _0: "Empty", + _1: l.hd, + _2: "Empty", + _3: 1 + }, + _1: match.hd, _2: "Empty", - _3: 1 + _3: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -623,52 +649,24 @@ function Make(Ord) { _2: "Empty", _3: 1 }, - _1: match.hd, - _2: "Empty", + _1: match$1.hd, + _2: { + TAG: "Node", + _0: "Empty", + _1: match$2.hd, + _2: "Empty", + _3: 1 + }, _3: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - _0: { - TAG: "Node", - _0: "Empty", - _1: l.hd, - _2: "Empty", - _3: 1 - }, - _1: match$1.hd, - _2: { - TAG: "Node", - _0: "Empty", - _1: match$2.hd, - _2: "Empty", - _3: 1 - }, - _3: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -681,15 +679,15 @@ function Make(Ord) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_set.res", - 497, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_set.res", + 497, + 20 + ] + } + }); }; return sub(List.length(l), l)[0]; }; diff --git a/jscomp/test/test_simple_pattern_match.js b/jscomp/test/test_simple_pattern_match.js index e127dc7215..9b64d32f86 100644 --- a/jscomp/test/test_simple_pattern_match.js +++ b/jscomp/test/test_simple_pattern_match.js @@ -8,11 +8,11 @@ let match; switch (Sys.os_type) { case "Cygwin" : case "Unix" : - match = [ - 1, - 2 - ]; - break; + match = [ + 1, + 2 + ]; + break; default: match = [ 3, diff --git a/jscomp/test/test_simple_tailcall.js b/jscomp/test/test_simple_tailcall.js index 1fd893e906..016ca54fba 100644 --- a/jscomp/test/test_simple_tailcall.js +++ b/jscomp/test/test_simple_tailcall.js @@ -3,7 +3,7 @@ function tailcall(x) { - while(true) { + while (true) { continue; }; } @@ -17,7 +17,7 @@ function non_length(x) { } function length(_acc, _x) { - while(true) { + while (true) { let x = _x; let acc = _acc; if (!x) { diff --git a/jscomp/test/test_static_catch_ident.js b/jscomp/test/test_static_catch_ident.js index df30925c09..0f07ea108a 100644 --- a/jscomp/test/test_static_catch_ident.js +++ b/jscomp/test/test_static_catch_ident.js @@ -11,10 +11,10 @@ function scanf_bad_input(ib, x) { s = x._1; } else { throw new Error(x.RE_EXN_ID, { - cause: x - }); + cause: x + }); } - for(let i = 0; i <= 100; ++i){ + for (let i = 0; i <= 100; ++i) { console.log(s); console.log("don't inlinie"); } diff --git a/jscomp/test/test_string.js b/jscomp/test/test_string.js index f71fcdffbe..6cda6ae83e 100644 --- a/jscomp/test/test_string.js +++ b/jscomp/test/test_string.js @@ -7,20 +7,20 @@ let Caml_string = require("../../lib/js/caml_string.js"); function f(x) { switch (x) { case "aaaabb" : - return 0; + return 0; case "bbbb" : - return 1; + return 1; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_string.res", - 5, - 17 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_string.res", + 5, + 17 + ] + } + }); } } diff --git a/jscomp/test/test_string_case.js b/jscomp/test/test_string_case.js index 9a5bd0ef27..867814c4a6 100644 --- a/jscomp/test/test_string_case.js +++ b/jscomp/test/test_string_case.js @@ -5,20 +5,20 @@ function f(x) { switch (x) { case "abcd" : - return 0; + return 0; case "bcde" : - return 1; + return 1; default: throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_string_case.res", - 5, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_string_case.res", + 5, + 9 + ] + } + }); } } diff --git a/jscomp/test/test_string_const.js b/jscomp/test/test_string_const.js index d6335edda9..cadb0599f9 100644 --- a/jscomp/test/test_string_const.js +++ b/jscomp/test/test_string_const.js @@ -10,16 +10,15 @@ let hh; try { hh = Caml_string.get("ghsogh", -3); -} -catch (raw_e){ +} catch (raw_e) { let e = Caml_js_exceptions.internalToOCamlException(raw_e); if (e.RE_EXN_ID === "Invalid_argument") { console.log(e._1); hh = /* 'a' */97; } else { throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } } diff --git a/jscomp/test/test_string_map.js b/jscomp/test/test_string_map.js index 9aa866bb25..b8bc888cf3 100644 --- a/jscomp/test/test_string_map.js +++ b/jscomp/test/test_string_map.js @@ -32,11 +32,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -49,11 +49,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -67,11 +67,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -84,11 +84,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function add(x, data, param) { @@ -138,14 +138,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml.string_compare(x, param.v); if (c === 0) { @@ -167,12 +167,12 @@ function assertion_test() { contents: "Empty" }; timing("building", (function () { - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { m.contents = add(String(i), String(i), m.contents); } })); timing("querying", (function () { - for(let i = 0; i <= 1000000; ++i){ + for (let i = 0; i <= 1000000; ++i) { find(String(i), m.contents); } })); diff --git a/jscomp/test/test_string_switch.js b/jscomp/test/test_string_switch.js index 14432b71c7..0a8a542cb5 100644 --- a/jscomp/test/test_string_switch.js +++ b/jscomp/test/test_string_switch.js @@ -7,11 +7,11 @@ let os_version; switch (Sys.os_type) { case "Cygwin" : - os_version = 2; - break; + os_version = 2; + break; case "Unix" : - os_version = 1; - break; + os_version = 1; + break; default: os_version = 3; } diff --git a/jscomp/test/test_switch.js b/jscomp/test/test_switch.js index cf69436849..ccb9fab571 100644 --- a/jscomp/test/test_switch.js +++ b/jscomp/test/test_switch.js @@ -12,14 +12,13 @@ function f(x) { } switch (x.TAG) { case "A" : - return 0; + return 0; case "B" : - return 1; + return 1; case "C" : - return 2; + return 2; case "F" : - return 3; - + return 3; } } diff --git a/jscomp/test/test_trywith.js b/jscomp/test/test_trywith.js index 1f81560003..f327c553a7 100644 --- a/jscomp/test/test_trywith.js +++ b/jscomp/test/test_trywith.js @@ -15,132 +15,122 @@ let Sys_blocked_io = /* @__PURE__ */Caml_exceptions.create("Test_trywith.Sys_blo function ff(g, x) { try { g(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID !== "Not_found") { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } try { g(x); - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID !== Out_of_memory) { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } try { g(x); - } - catch (raw_exn$2){ + } catch (raw_exn$2) { let exn$2 = Caml_js_exceptions.internalToOCamlException(raw_exn$2); if (exn$2.RE_EXN_ID !== Sys_error) { throw new Error(exn$2.RE_EXN_ID, { - cause: exn$2 - }); + cause: exn$2 + }); } } try { g(x); - } - catch (raw_exn$3){ + } catch (raw_exn$3) { let exn$3 = Caml_js_exceptions.internalToOCamlException(raw_exn$3); if (exn$3.RE_EXN_ID !== "Invalid_argument") { throw new Error(exn$3.RE_EXN_ID, { - cause: exn$3 - }); + cause: exn$3 + }); } } try { g(x); - } - catch (raw_exn$4){ + } catch (raw_exn$4) { let exn$4 = Caml_js_exceptions.internalToOCamlException(raw_exn$4); if (exn$4.RE_EXN_ID !== "End_of_file") { throw new Error(exn$4.RE_EXN_ID, { - cause: exn$4 - }); + cause: exn$4 + }); } } try { g(x); - } - catch (raw_exn$5){ + } catch (raw_exn$5) { let exn$5 = Caml_js_exceptions.internalToOCamlException(raw_exn$5); if (exn$5.RE_EXN_ID !== "Match_failure") { throw new Error(exn$5.RE_EXN_ID, { - cause: exn$5 - }); + cause: exn$5 + }); } } try { g(x); - } - catch (raw_exn$6){ + } catch (raw_exn$6) { let exn$6 = Caml_js_exceptions.internalToOCamlException(raw_exn$6); if (exn$6.RE_EXN_ID !== Stack_overflow) { throw new Error(exn$6.RE_EXN_ID, { - cause: exn$6 - }); + cause: exn$6 + }); } } try { g(x); - } - catch (raw_exn$7){ + } catch (raw_exn$7) { let exn$7 = Caml_js_exceptions.internalToOCamlException(raw_exn$7); if (exn$7.RE_EXN_ID !== Sys_blocked_io) { throw new Error(exn$7.RE_EXN_ID, { - cause: exn$7 - }); + cause: exn$7 + }); } } try { g(x); - } - catch (raw_exn$8){ + } catch (raw_exn$8) { let exn$8 = Caml_js_exceptions.internalToOCamlException(raw_exn$8); if (exn$8.RE_EXN_ID !== "Assert_failure") { throw new Error(exn$8.RE_EXN_ID, { - cause: exn$8 - }); + cause: exn$8 + }); } } try { return g(x); - } - catch (raw_exn$9){ + } catch (raw_exn$9) { let exn$9 = Caml_js_exceptions.internalToOCamlException(raw_exn$9); if (exn$9.RE_EXN_ID === "Undefined_recursive_module") { return; } throw new Error(exn$9.RE_EXN_ID, { - cause: exn$9 - }); + cause: exn$9 + }); } } function u() { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function f(x) { @@ -151,15 +141,15 @@ function f(x) { return 1; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_trywith.res", - 59, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_trywith.res", + 59, + 9 + ] + } + }); } let u1 = "bad character decimal encoding \\"; diff --git a/jscomp/test/test_tuple.js b/jscomp/test/test_tuple.js index 77fbe2d158..2cf819e9e3 100644 --- a/jscomp/test/test_tuple.js +++ b/jscomp/test/test_tuple.js @@ -4,8 +4,8 @@ let r = 0; -for(let k = 1; k <= 10; ++k){ - for(let i = 1; i <= 10; ++i){ +for (let k = 1; k <= 10; ++k) { + for (let i = 1; i <= 10; ++i) { let match = i % 2 === 0 ? [ 1, (i << 1) diff --git a/jscomp/test/test_u.js b/jscomp/test/test_u.js index 946f386cab..bf3c0112f3 100644 --- a/jscomp/test/test_u.js +++ b/jscomp/test/test_u.js @@ -5,7 +5,7 @@ function f(x) { let v = x; let sum = 0; - while(v > 0) { + while (v > 0) { sum = sum + v | 0; v = v - 1 | 0; }; diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index ebca37f982..1378a7ded1 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -14,7 +14,7 @@ let arr = Caml_array.make(10, (function () { function f() { let n = 0; - while(n < 10) { + while (n < 10) { let j = n; Caml_array.set(arr, j, (function () { v.contents = v.contents + j | 0; @@ -33,15 +33,15 @@ console.log(String(v.contents)); if (v.contents !== 45) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "test_while_closure.res", - 55, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "test_while_closure.res", + 55, + 2 + ] + } + }); } let count = 10; diff --git a/jscomp/test/test_while_side_effect.js b/jscomp/test/test_while_side_effect.js index c368e122de..10dcf19579 100644 --- a/jscomp/test/test_while_side_effect.js +++ b/jscomp/test/test_while_side_effect.js @@ -6,7 +6,7 @@ let v = { contents: 0 }; -while(console.log(String(v.contents)), v.contents = v.contents + 1 | 0, v.contents < 10) { +while (console.log(String(v.contents)), v.contents = v.contents + 1 | 0, v.contents < 10) { }; @@ -22,7 +22,7 @@ let x = { contents: 3 }; -while((function () { +while ((function () { let y = 3; console.log(String(x.contents)); y = y + 1 | 0; diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index c785f5687c..adb9217fd2 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -15,7 +15,7 @@ function split(delim, s) { if (len !== 0) { let _l = /* [] */0; let _x = len; - while(true) { + while (true) { let x = _x; let l = _l; if (x === 0) { @@ -24,8 +24,7 @@ function split(delim, s) { let i$p; try { i$p = $$String.rindex_from(s, x - 1 | 0, delim); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return { @@ -34,8 +33,8 @@ function split(delim, s) { }; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } let l_0 = $$String.sub(s, i$p + 1 | 0, (x - i$p | 0) - 1 | 0); let l$1 = { @@ -136,11 +135,11 @@ function bal(l, x, d, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -153,11 +152,11 @@ function bal(l, x, d, r) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -171,11 +170,11 @@ function bal(l, x, d, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -188,11 +187,11 @@ function bal(l, x, d, r) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } function is_empty(param) { @@ -250,14 +249,14 @@ function add(x, data, param) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml_obj.compare(x, param.v); if (c === 0) { @@ -269,21 +268,21 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -310,7 +309,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -320,7 +319,7 @@ function find_first_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -347,21 +346,21 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -388,7 +387,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -398,7 +397,7 @@ function find_last_opt(f, _param) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -425,7 +424,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -440,7 +439,7 @@ function find_opt(x, _param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -455,14 +454,14 @@ function mem(x, _param) { } function min_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -477,7 +476,7 @@ function min_binding(_param) { } function min_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -495,14 +494,14 @@ function min_binding_opt(_param) { } function max_binding(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -517,7 +516,7 @@ function max_binding(_param) { } function max_binding_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -537,11 +536,11 @@ function max_binding_opt(_param) { function remove_min_binding(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -647,7 +646,7 @@ function update(x, f, param) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -695,7 +694,7 @@ function mapi(f, param) { } function fold(f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -708,7 +707,7 @@ function fold(f, _m, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -725,7 +724,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -846,15 +845,15 @@ function merge$1(f, s1, s2) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split$1(v2, s1); @@ -946,7 +945,7 @@ function partition(p, param) { } function cons_enum(_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -967,7 +966,7 @@ function cons_enum(_m, _e) { function compare(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -997,7 +996,7 @@ function compare(cmp, m1, m2) { function equal(cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1031,7 +1030,7 @@ function cardinal(param) { } function bindings_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1131,7 +1130,7 @@ function compute_update_sequences(all_tickers) { }, map); } let loop = function (_up, _map, _ticker) { - while(true) { + while (true) { let ticker = _ticker; let map = _map; let up = _up; @@ -1163,18 +1162,18 @@ function compute_update_sequences(all_tickers) { if (typeof x !== "object") { if (x === "Uninitialized") { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked" + } + }); } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked" + } + }); } else { let y = rhs.rank; if (typeof y === "object") { @@ -1182,18 +1181,18 @@ function compute_update_sequences(all_tickers) { } if (y === "Uninitialized") { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked" + } + }); } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked" + } + }); } }), l); return add(k, l$1, map); @@ -1210,11 +1209,11 @@ function process_quote(ticker_map, new_ticker, new_value) { return; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Only single Market ticker should be udpated upon a new quote" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Only single Market ticker should be udpated upon a new quote" + } + }); } let match$1 = match._0; let match$2 = match$1.lhs.value; @@ -1248,179 +1247,179 @@ function process_input_line(ticker_map, all_tickers, line) { if (tokens) { switch (tokens.hd) { case "Q" : - let match = tokens.tl; - if (match) { - let match$1 = match.tl; - if (match$1) { - if (match$1.tl) { - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - } - let ticker_map$1 = ticker_map !== undefined ? Caml_option.valFromOption(ticker_map) : compute_update_sequences(all_tickers); - let value = Caml_format.float_of_string(match$1.hd); - process_quote(ticker_map$1, match.hd, value); - return [ - all_tickers, - Caml_option.some(ticker_map$1) - ]; - } - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - } - throw new Error("Failure", { + let match = tokens.tl; + if (match) { + let match$1 = match.tl; + if (match$1) { + if (match$1.tl) { + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); + } + let ticker_map$1 = ticker_map !== undefined ? Caml_option.valFromOption(ticker_map) : compute_update_sequences(all_tickers); + let value = Caml_format.float_of_string(match$1.hd); + process_quote(ticker_map$1, match.hd, value); + return [ + all_tickers, + Caml_option.some(ticker_map$1) + ]; + } + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + } + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); case "R" : - let match$2 = tokens.tl; - if (match$2) { - let match$3 = match$2.tl; - if (match$3) { - let ticker_name = match$2.hd; - switch (match$3.hd) { - case "+" : - let match$4 = match$3.tl; - if (match$4) { - let match$5 = match$4.tl; - if (match$5) { - if (match$5.tl) { - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - } - return [ - { - hd: make_binary_op(ticker_name, match$4.hd, match$5.hd, "PLUS"), - tl: all_tickers - }, - ticker_map - ]; - } + let match$2 = tokens.tl; + if (match$2) { + let match$3 = match$2.tl; + if (match$3) { + let ticker_name = match$2.hd; + switch (match$3.hd) { + case "+" : + let match$4 = match$3.tl; + if (match$4) { + let match$5 = match$4.tl; + if (match$5) { + if (match$5.tl) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - } - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - case "-" : - let match$6 = match$3.tl; - if (match$6) { - let match$7 = match$6.tl; - if (match$7) { - if (match$7.tl) { - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" } - return [ - { - hd: make_binary_op(ticker_name, match$6.hd, match$7.hd, "MINUS"), - tl: all_tickers - }, - ticker_map - ]; - } - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - } - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); - case "S" : - if (match$3.tl) { - throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Invalid input line" - } - }); + }); } return [ { - hd: { - value: undefined, - rank: "Uninitialized", - ticker_name: ticker_name, - type_: "Market" - }, + hd: make_binary_op(ticker_name, match$4.hd, match$5.hd, "PLUS"), tl: all_tickers }, ticker_map ]; - default: + } throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + } + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + case "-" : + let match$6 = match$3.tl; + if (match$6) { + let match$7 = match$6.tl; + if (match$7) { + if (match$7.tl) { + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); - } - } else { - throw new Error("Failure", { + } + return [ + { + hd: make_binary_op(ticker_name, match$6.hd, match$7.hd, "MINUS"), + tl: all_tickers + }, + ticker_map + ]; + } + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); - } - } else { - throw new Error("Failure", { + } + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); - } - default: - throw new Error("Failure", { + case "S" : + if (match$3.tl) { + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + } + return [ + { + hd: { + value: undefined, + rank: "Uninitialized", + ticker_name: ticker_name, + type_: "Market" + }, + tl: all_tickers + }, + ticker_map + ]; + default: + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + } + } else { + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); - } - } else { - throw new Error("Failure", { + } + } else { + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); + } + default: + throw new Error("Failure", { cause: { RE_EXN_ID: "Failure", _1: "Invalid input line" } }); + } + } else { + throw new Error("Failure", { + cause: { + RE_EXN_ID: "Failure", + _1: "Invalid input line" + } + }); } } function loop(_lines, _param) { - while(true) { + while (true) { let param = _param; let lines = _lines; let all_tickers = param[0]; diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index d9f7b1d719..c1af12c84e 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -74,7 +74,7 @@ function nexts(x, g) { } function dfs1(_nodes, graph, _visited) { - while(true) { + while (true) { let visited = _visited; let nodes = _nodes; if (!nodes) { @@ -122,15 +122,15 @@ if (!Caml_obj.equal(dfs1({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 35, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 35, + 2 + ] + } + }); } console.log(""); @@ -161,20 +161,20 @@ if (!Caml_obj.equal(dfs1({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 38, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 38, + 2 + ] + } + }); } function dfs2(nodes, graph, visited) { let aux = function (_nodes, graph, _visited) { - while(true) { + while (true) { let visited = _visited; let nodes = _nodes; if (!nodes) { @@ -223,15 +223,15 @@ if (!Caml_obj.equal(dfs2({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 57, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 57, + 2 + ] + } + }); } if (!Caml_obj.equal(dfs2({ @@ -260,15 +260,15 @@ if (!Caml_obj.equal(dfs2({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 58, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 58, + 2 + ] + } + }); } function dfs3(nodes, graph) { @@ -319,15 +319,15 @@ if (!Caml_obj.equal(dfs3({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 74, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 74, + 2 + ] + } + }); } if (!Caml_obj.equal(dfs3({ @@ -356,15 +356,15 @@ if (!Caml_obj.equal(dfs3({ } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 75, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 75, + 2 + ] + } + }); } let grwork = { @@ -446,15 +446,15 @@ if (!Caml_obj.equal(unsafe_topsort(grwork), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 112, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 112, + 9 + ] + } + }); } function height(param) { @@ -487,11 +487,11 @@ function bal(l, v, r) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -503,11 +503,11 @@ function bal(l, v, r) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -520,11 +520,11 @@ function bal(l, v, r) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -536,11 +536,11 @@ function bal(l, v, r) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } function add(x, param) { @@ -621,14 +621,14 @@ function join(l, v, r) { } function min_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -640,7 +640,7 @@ function min_elt(_param) { } function min_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -655,14 +655,14 @@ function min_elt_opt(_param) { } function max_elt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -674,7 +674,7 @@ function max_elt(_param) { } function max_elt_opt(_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -691,11 +691,11 @@ function max_elt_opt(_param) { function remove_min_elt(param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -759,7 +759,7 @@ function is_empty(param) { } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -870,7 +870,7 @@ function diff(s1, s2) { } function cons_enum(_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -890,7 +890,7 @@ function cons_enum(_s, _e) { function compare(s1, s2) { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -918,7 +918,7 @@ function equal(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -969,7 +969,7 @@ function subset(_s1, _s2) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -982,7 +982,7 @@ function iter(f, _param) { } function fold(f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -995,7 +995,7 @@ function fold(f, _s, _accu) { } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1012,7 +1012,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1086,7 +1086,7 @@ function cardinal(param) { } function elements_aux(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1106,14 +1106,14 @@ function elements(s) { } function find(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = Caml.string_compare(x, v); @@ -1126,20 +1126,20 @@ function find(x, _param) { } function find_first(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -1161,7 +1161,7 @@ function find_first(f, _param) { } function find_first_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1170,7 +1170,7 @@ function find_first_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -1192,20 +1192,20 @@ function find_first_opt(f, _param) { } function find_last(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -1227,7 +1227,7 @@ function find_last(f, _param) { } function find_last_opt(f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1236,7 +1236,7 @@ function find_last_opt(f, _param) { if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -1258,7 +1258,7 @@ function find_last_opt(f, _param) { } function find_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1319,28 +1319,54 @@ function of_list(l) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1351,52 +1377,24 @@ function of_list(l) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -1409,15 +1407,15 @@ function of_list(l) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l$1), l$1)[0]; } else { @@ -1481,14 +1479,14 @@ function pathsort(graph) { let set = param[0]; if (mem(node, set)) { throw new Error(Cycle, { - cause: { - RE_EXN_ID: Cycle, - _1: { - hd: node, - tl: stack - } - } - }); + cause: { + RE_EXN_ID: Cycle, + _1: { + hd: node, + tl: stack + } + } + }); } return [ add(node, set), @@ -1540,15 +1538,15 @@ if (!Caml_obj.equal(pathsort(grwork), { } })) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 144, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 144, + 9 + ] + } + }); } try { @@ -1560,17 +1558,16 @@ try { tl: grwork }); throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 148, - 2 - ] - } - }); -} -catch (raw_exn){ + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 148, + 2 + ] + } + }); +} catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); let exit = 0; if (exn.RE_EXN_ID === Cycle) { @@ -1599,15 +1596,15 @@ catch (raw_exn){ } if (exit === 1) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "topsort_test.res", - 151, - 7 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "topsort_test.res", + 151, + 7 + ] + } + }); } } diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index be13bb677f..1f9cd58ab4 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -40,7 +40,7 @@ let u = fib(10, (function (x) { })); function iter(_bounce) { - while(true) { + while (true) { let bounce = _bounce; if (bounce.TAG === "Continue") { return bounce._0; diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index e10187f05c..ea671ac58b 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -14,17 +14,17 @@ function string_or_number(x) { } else { switch (ty.TAG) { case "JSNumber" : - console.log(ty._0 + 3); - return true; + console.log(ty._0 + 3); + return true; case "JSString" : - console.log(ty._0 + "hei"); - return true; + console.log(ty._0 + "hei"); + return true; case "JSFunction" : - console.log("Function"); - return false; + console.log("Function"); + return false; case "JSBigInt" : - console.log(ty._0.toString()); - return true; + console.log(ty._0.toString()); + return true; default: return false; } diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index 56e3fa54c2..1546d3777a 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -6,8 +6,8 @@ let Caml_exceptions = require("../../lib/js/caml_exceptions.js"); function raise(e) { throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } let map = Belt_List.mapU; @@ -25,10 +25,10 @@ let E = /* @__PURE__ */Caml_exceptions.create("Uncurried_cast.E"); function testRaise() { throw new Error(E, { - cause: { - RE_EXN_ID: E - } - }); + cause: { + RE_EXN_ID: E + } + }); } let l = Belt_List.mapU({ @@ -71,10 +71,10 @@ let StandardNotation = { function testRaise$1() { throw new Error(E, { - cause: { - RE_EXN_ID: E - } - }); + cause: { + RE_EXN_ID: E + } + }); } let l$1 = Belt_List.mapU({ diff --git a/jscomp/test/uncurry_test.js b/jscomp/test/uncurry_test.js index d88d252252..878d77dae1 100644 --- a/jscomp/test/uncurry_test.js +++ b/jscomp/test/uncurry_test.js @@ -27,7 +27,7 @@ console.log([ ]); function xx() { - while(true) { + while (true) { continue; }; } diff --git a/jscomp/test/unsafe_full_apply_primitive.js b/jscomp/test/unsafe_full_apply_primitive.js index c03ed3147e..08bdde1f35 100644 --- a/jscomp/test/unsafe_full_apply_primitive.js +++ b/jscomp/test/unsafe_full_apply_primitive.js @@ -3,7 +3,7 @@ function f(a) { - while(true) { + while (true) { continue; }; } diff --git a/jscomp/test/variant.js b/jscomp/test/variant.js index 40c6abea1f..d288abaca6 100644 --- a/jscomp/test/variant.js +++ b/jscomp/test/variant.js @@ -15,13 +15,12 @@ function foo(x) { } switch (x.TAG) { case "B" : - return x._0; + return x._0; case "C" : - return x._0 + x._1 | 0; + return x._0 + x._1 | 0; case "D" : - let match = x._0; - return match[0] + match[1] | 0; - + let match = x._0; + return match[0] + match[1] | 0; } } @@ -44,11 +43,11 @@ function fooC(x) { function switchNum(x) { switch (x) { case 0 : - return "0"; + return "0"; case 1 : - return "1"; + return "1"; case 2 : - return "2"; + return "2"; default: return "_"; } @@ -83,22 +82,20 @@ let M = { function rollback_path(subst, p) { try { return "try"; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { switch (p.TAG) { case "Pdot" : - return "Pdot"; + return "Pdot"; case "Pident" : case "Papply" : - return "Pident | Papply"; - + return "Pident | Papply"; } } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } } @@ -116,8 +113,7 @@ let ED = /* @__PURE__ */Caml_exceptions.create("Variant.ED"); function fooExn(f) { try { return f(); - } - catch (raw_n){ + } catch (raw_n) { let n = Caml_js_exceptions.internalToOCamlException(raw_n); if (n.RE_EXN_ID === EA1) { return 1; @@ -136,8 +132,8 @@ function fooExn(f) { return match[0] + match[1] | 0; } throw new Error(n.RE_EXN_ID, { - cause: n - }); + cause: n + }); } } diff --git a/jscomp/test/variantsMatching.js b/jscomp/test/variantsMatching.js index 62c4678445..4ee6946d14 100644 --- a/jscomp/test/variantsMatching.js +++ b/jscomp/test/variantsMatching.js @@ -5,32 +5,30 @@ function toEnum(x) { switch (x) { case "thisIsA" : - return 0; + return 0; case 42 : - return 1; + return 1; case null : - return 2; + return 2; case "D" : - return 3; + return 3; case 3.14 : - return 5; - + return 5; } } function toString(x) { switch (x) { case "thisIsA" : - return "A"; + return "A"; case 42 : - return "B"; + return "B"; case null : - return "C"; + return "C"; case "D" : - return "D"; + return "D"; case 3.14 : - return "Pi"; - + return "Pi"; } } @@ -38,7 +36,7 @@ function bar(x) { switch (x) { case "thisIsA" : case 3.14 : - return 10; + return 10; default: return 0; } @@ -139,22 +137,20 @@ function foo(x) { if (typeof x !== "object") { switch (x) { case "dd" : - return 1; + return 1; case 12 : - return 2; + return 2; case false : - return 3; - + return 3; } } else { switch (x.TAG) { case "qq" : - return 4; + return 4; case 42 : - return 5; + return 5; case "F" : - return 6; - + return 6; } } } @@ -283,10 +279,9 @@ function plus$3(x, y) { switch (x) { case null : case undefined : - return y; + return y; case "WhyNotAnotherOne" : - break; - + break; } } else if (!(y === undefined || y === null || y === "WhyNotAnotherOne")) { return { @@ -300,10 +295,9 @@ function plus$3(x, y) { switch (y) { case null : case undefined : - return x; + return x; case "WhyNotAnotherOne" : - return "WhyNotAnotherOne"; - + return "WhyNotAnotherOne"; } } @@ -313,12 +307,11 @@ function kind$1(x) { } switch (x) { case null : - return "null"; + return "null"; case undefined : - return "undefined"; + return "undefined"; case "WhyNotAnotherOne" : - return "whynot"; - + return "whynot"; } } @@ -349,12 +342,11 @@ let MyNullableExtended = { function area(shape) { switch (shape.kind) { case 1 : - return Math.PI * Math.pow(shape.radius, 2); + return Math.PI * Math.pow(shape.radius, 2); case "square" : - return Math.pow(shape.sideLength, 2); + return Math.pow(shape.sideLength, 2); case "rectangle" : - return shape.width * shape.height; - + return shape.width * shape.height; } } @@ -392,18 +384,17 @@ let CustomTagNotInline = { function classify(x) { switch (typeof x) { case "string" : - return "string"; + return "string"; case "number" : - return "int"; + return "int"; case "boolean" : - if (x) { - return "true"; - } else { - return "boolean"; - } + if (x) { + return "true"; + } else { + return "boolean"; + } case "object" : - return "Object" + x.name; - + return "Object" + x.name; } } diff --git a/lib/es6/arg.js b/lib/es6/arg.js index c65c77c67f..bd24d4e8e7 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -21,7 +21,7 @@ let Help = /* @__PURE__ */Caml_exceptions.create("Arg.Help"); let Stop = /* @__PURE__ */Caml_exceptions.create("Arg.Stop"); function assoc3(x, _l) { - while(true) { + while (true) { let l = _l; if (l) { let match = l.hd; @@ -32,10 +32,10 @@ function assoc3(x, _l) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -60,14 +60,14 @@ function make_symlist(prefix, sep, suffix, l) { function help_action() { throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Unknown", - _0: "-help" - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Unknown", + _0: "-help" + } + } + }); } function add_help(speclist) { @@ -75,8 +75,7 @@ function add_help(speclist) { try { assoc3("-help", speclist); add1 = /* [] */0; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { add1 = { @@ -92,16 +91,15 @@ function add_help(speclist) { }; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } let add2; try { assoc3("--help", speclist); add2 = /* [] */0; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { add2 = { @@ -117,8 +115,8 @@ function add_help(speclist) { }; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } return Pervasives.$at(speclist, Pervasives.$at(add1, add2)); @@ -158,45 +156,42 @@ let current = { function bool_of_string_opt(x) { try { return Pervasives.bool_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Invalid_argument") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function int_of_string_opt(x) { try { return Caml_format.int_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function float_of_string_opt(x) { try { return Caml_format.float_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -207,25 +202,24 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { case "Unknown" : - let s = error._0; - switch (s) { - case "--help" : - case "-help" : - break; - default: - Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n"); - } - break; + let s = error._0; + switch (s) { + case "--help" : + case "-help" : + break; + default: + Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n"); + } + break; case "Wrong" : - Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n"); - break; + Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n"); + break; case "Missing" : - Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n"); - break; + Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n"); + break; case "Message" : - Buffer.add_string(b, progname + ": " + error._0 + ".\n"); - break; - + Buffer.add_string(b, progname + ": " + error._0 + ".\n"); + break; } usage_b(b, speclist.contents, errmsg); if (Caml_obj.equal(error, { @@ -247,7 +241,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }; current.contents = current.contents + 1 | 0; - while(current.contents < argv.contents.length) { + while (current.contents < argv.contents.length) { try { let s = Caml_array.get(argv.contents, current.contents); if (s.length >= 1 && Caml_string.get(s, 0) === /* '-' */45) { @@ -257,8 +251,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist assoc3(s, speclist.contents), undefined ]; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { try { @@ -267,28 +260,27 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist assoc3(match$1[0], speclist.contents), match$1[1] ]; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Unknown", - _0: s - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Unknown", + _0: s + } + } + }); } throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } let follow = match[1]; @@ -297,16 +289,16 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: follow, - _2: "no argument" - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: follow, + _2: "no argument" + } + } + }); }; let get_arg = function () { if (follow !== undefined) { @@ -316,14 +308,14 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return Caml_array.get(argv.contents, current.contents + 1 | 0); } throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Missing", - _0: s - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Missing", + _0: s + } + } + }); }; let consume_arg = function () { if (follow !== undefined) { @@ -336,198 +328,196 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist let treat_action = function (f) { switch (f.TAG) { case "Unit" : - return f._0(); + return f._0(); case "Bool" : - let arg = get_arg(); - let s$1 = bool_of_string_opt(arg); - if (s$1 !== undefined) { - f._0(s$1); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg, - _2: "a boolean" - } - } - }); - } - return consume_arg(); + let arg = get_arg(); + let s$1 = bool_of_string_opt(arg); + if (s$1 !== undefined) { + f._0(s$1); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg, + _2: "a boolean" + } + } + }); + } + return consume_arg(); case "Set" : - no_arg(); - f._0.contents = true; - return; + no_arg(); + f._0.contents = true; + return; case "Clear" : - no_arg(); - f._0.contents = false; - return; + no_arg(); + f._0.contents = false; + return; case "String" : - let arg$1 = get_arg(); - f._0(arg$1); - return consume_arg(); + let arg$1 = get_arg(); + f._0(arg$1); + return consume_arg(); case "Set_string" : - f._0.contents = get_arg(); - return consume_arg(); + f._0.contents = get_arg(); + return consume_arg(); case "Int" : - let arg$2 = get_arg(); - let x = int_of_string_opt(arg$2); - if (x !== undefined) { - f._0(x); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$2, - _2: "an integer" - } - } - }); - } - return consume_arg(); + let arg$2 = get_arg(); + let x = int_of_string_opt(arg$2); + if (x !== undefined) { + f._0(x); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$2, + _2: "an integer" + } + } + }); + } + return consume_arg(); case "Set_int" : - let arg$3 = get_arg(); - let x$1 = int_of_string_opt(arg$3); - if (x$1 !== undefined) { - f._0.contents = x$1; - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$3, - _2: "an integer" - } - } - }); - } - return consume_arg(); + let arg$3 = get_arg(); + let x$1 = int_of_string_opt(arg$3); + if (x$1 !== undefined) { + f._0.contents = x$1; + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$3, + _2: "an integer" + } + } + }); + } + return consume_arg(); case "Float" : - let arg$4 = get_arg(); - let x$2 = float_of_string_opt(arg$4); - if (x$2 !== undefined) { - f._0(x$2); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$4, - _2: "a float" - } - } - }); - } - return consume_arg(); + let arg$4 = get_arg(); + let x$2 = float_of_string_opt(arg$4); + if (x$2 !== undefined) { + f._0(x$2); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$4, + _2: "a float" + } + } + }); + } + return consume_arg(); case "Set_float" : - let arg$5 = get_arg(); - let x$3 = float_of_string_opt(arg$5); - if (x$3 !== undefined) { - f._0.contents = x$3; - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$5, - _2: "a float" - } - } - }); - } - return consume_arg(); + let arg$5 = get_arg(); + let x$3 = float_of_string_opt(arg$5); + if (x$3 !== undefined) { + f._0.contents = x$3; + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$5, + _2: "a float" + } + } + }); + } + return consume_arg(); case "Tuple" : - return List.iter(treat_action, f._0); + return List.iter(treat_action, f._0); case "Symbol" : - let symb = f._0; - let arg$6 = get_arg(); - if (List.mem(arg$6, symb)) { - f._1(arg$6); - return consume_arg(); + let symb = f._0; + let arg$6 = get_arg(); + if (List.mem(arg$6, symb)) { + f._1(arg$6); + return consume_arg(); + } + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$6, + _2: "one of: " + make_symlist("", " ", "", symb) + } } - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$6, - _2: "one of: " + make_symlist("", " ", "", symb) - } - } - }); + }); case "Rest" : - let f$1 = f._0; - while(current.contents < (argv.contents.length - 1 | 0)) { - f$1(Caml_array.get(argv.contents, current.contents + 1 | 0)); - consume_arg(); - }; - return; - case "Expand" : - if (!allow_expand) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic" - } - }); - } - let arg$7 = get_arg(); - let newarg = f._0(arg$7); + let f$1 = f._0; + while (current.contents < (argv.contents.length - 1 | 0)) { + f$1(Caml_array.get(argv.contents, current.contents + 1 | 0)); consume_arg(); - let before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); - let after = $$Array.sub(argv.contents, current.contents + 1 | 0, (argv.contents.length - current.contents | 0) - 1 | 0); - argv.contents = Caml_array.concat({ - hd: before, - tl: { - hd: newarg, - tl: { - hd: after, - tl: /* [] */0 - } + }; + return; + case "Expand" : + if (!allow_expand) { + throw new Error("Invalid_argument", { + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic" } }); - return; - + } + let arg$7 = get_arg(); + let newarg = f._0(arg$7); + consume_arg(); + let before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); + let after = $$Array.sub(argv.contents, current.contents + 1 | 0, (argv.contents.length - current.contents | 0) - 1 | 0); + argv.contents = Caml_array.concat({ + hd: before, + tl: { + hd: newarg, + tl: { + hd: after, + tl: /* [] */0 + } + } + }); + return; } }; treat_action(match[0]); } else { anonfun(s); } - } - catch (raw_m){ + } catch (raw_m) { let m = Caml_js_exceptions.internalToOCamlException(raw_m); if (m.RE_EXN_ID === Bad) { throw new Error(convert_error({ - TAG: "Message", - _0: m._1 - }).RE_EXN_ID, { - cause: convert_error({ - TAG: "Message", - _0: m._1 - }) - }); + TAG: "Message", + _0: m._1 + }).RE_EXN_ID, { + cause: convert_error({ + TAG: "Message", + _0: m._1 + }) + }); } if (m.RE_EXN_ID === Stop) { throw new Error(convert_error(m._1).RE_EXN_ID, { - cause: convert_error(m._1) - }); + cause: convert_error(m._1) + }); } throw new Error(m.RE_EXN_ID, { - cause: m - }); + cause: m + }); } current.contents = current.contents + 1 | 0; }; @@ -554,8 +544,7 @@ function parse_argv(currentOpt, argv, speclist, anonfun, errmsg) { function parse(l, f, msg) { try { return parse_argv(undefined, Sys.argv, l, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -566,16 +555,15 @@ function parse(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } function parse_dynamic(l, f, msg) { try { return parse_argv_dynamic(undefined, Sys.argv, l, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -586,8 +574,8 @@ function parse_dynamic(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } @@ -603,8 +591,7 @@ function parse_expand(l, f, msg) { contents: current.contents }; return parse_and_expand_argv_dynamic(current$1, argv, spec, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -615,15 +602,15 @@ function parse_expand(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } function second_word(s) { let len = s.length; let loop = function (_n) { - while(true) { + while (true) { let n = _n; if (n >= len) { return len; @@ -638,8 +625,7 @@ function second_word(s) { let n; try { n = $$String.index(s, /* '\t' */9); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let exit = 0; @@ -647,15 +633,14 @@ function second_word(s) { try { n$1 = $$String.index(s, /* ' ' */32); exit = 2; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { return len; } throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } if (exit === 2) { return loop(n$1 + 1 | 0); @@ -663,8 +648,8 @@ function second_word(s) { } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } return loop(n + 1 | 0); diff --git a/lib/es6/array.js b/lib/es6/array.js index c027a50579..badec4a0e5 100644 --- a/lib/es6/array.js +++ b/lib/es6/array.js @@ -15,14 +15,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f(i); } return res; @@ -30,7 +30,7 @@ function init(l, f) { function make_matrix(sx, sy, init) { let res = Caml_array.make(sx, []); - for(let x = 0; x < sx; ++x){ + for (let x = 0; x < sx; ++x) { res[x] = Caml_array.make(sy, init); } return res; @@ -59,11 +59,11 @@ function append(a1, a2) { function sub(a, ofs, len) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.sub" + } + }); } return Caml_array.sub(a, ofs, len); } @@ -71,13 +71,13 @@ function sub(a, ofs, len) { function fill(a, ofs, len, v) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.fill" + } + }); } - for(let i = ofs ,i_finish = ofs + len | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + len | 0; i < i_finish; ++i) { a[i] = v; } } @@ -85,17 +85,17 @@ function fill(a, ofs, len, v) { function blit(a1, ofs1, a2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (a1.length - len | 0) || ofs2 < 0 || ofs2 > (a2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.blit" + } + }); } Caml_array.blit(a1, ofs1, a2, ofs2, len); } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -103,13 +103,13 @@ function iter(f, a) { function iter2(f, a, b) { if (a.length !== b.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.iter2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.iter2: arrays must have the same length" + } + }); } - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i], b[i]); } } @@ -120,7 +120,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -131,24 +131,24 @@ function map2(f, a, b) { let lb = b.length; if (la !== lb) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.map2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.map2: arrays must have the same length" + } + }); } if (la === 0) { return []; } let r = Caml_array.make(la, f(a[0], b[0])); - for(let i = 1; i < la; ++i){ + for (let i = 1; i < la; ++i) { r[i] = f(a[i], b[i]); } return r; } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -159,7 +159,7 @@ function mapi(f, a) { return []; } let r = Caml_array.make(l, f(0, a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -168,7 +168,7 @@ function mapi(f, a) { function to_list(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -184,7 +184,7 @@ function to_list(a) { } function list_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -203,7 +203,7 @@ function of_list(param) { let a = Caml_array.make(list_length(0, param), param.hd); let _i = 1; let _param = param.tl; - while(true) { + while (true) { let param$1 = _param; let i = _i; if (!param$1) { @@ -218,7 +218,7 @@ function of_list(param) { function fold_left(f, x, a) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -226,7 +226,7 @@ function fold_left(f, x, a) { function fold_right(f, a, x) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(a[i], r); } return r; @@ -235,7 +235,7 @@ function fold_right(f, a, x) { function exists(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -251,7 +251,7 @@ function exists(p, a) { function for_all(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return true; @@ -267,7 +267,7 @@ function for_all(p, a) { function mem(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -283,7 +283,7 @@ function mem(x, a) { function memq(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -318,16 +318,16 @@ function sort(cmp, a) { return i31; } throw new Error(Bottom, { - cause: { - RE_EXN_ID: Bottom, - _1: i - } - }); + cause: { + RE_EXN_ID: Bottom, + _1: i + } + }); }; let trickle = function (l, i, e) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); if (cmp(Caml_array.get(a, j), e) <= 0) { @@ -337,53 +337,51 @@ function sort(cmp, a) { _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return Caml_array.set(a, i$2._1, e); } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let bubble = function (l, i) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); Caml_array.set(a, i$1, Caml_array.get(a, j)); _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return i$2._1; } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let trickleup = function (_i, e) { - while(true) { + while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; if (i === father) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "array.res", - 321, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "array.res", + 321, + 4 + ] + } + }); } if (cmp(Caml_array.get(a, father), e) >= 0) { return Caml_array.set(a, i, e); @@ -397,10 +395,10 @@ function sort(cmp, a) { }; }; let l = a.length; - for(let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i){ + for (let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i) { trickle(l, i, Caml_array.get(a, i)); } - for(let i$1 = l - 1 | 0; i$1 >= 2; --i$1){ + for (let i$1 = l - 1 | 0; i$1 >= 2; --i$1) { let e = Caml_array.get(a, i$1); Caml_array.set(a, i$1, Caml_array.get(a, 0)); trickleup(bubble(i$1, 0), e); @@ -422,7 +420,7 @@ function stable_sort(cmp, a) { let _i2 = src2ofs; let _s2 = Caml_array.get(src2, src2ofs); let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -451,10 +449,10 @@ function stable_sort(cmp, a) { }; }; let isortto = function (srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { + while (j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { Caml_array.set(dst, j + 1 | 0, Caml_array.get(dst, j)); j = j - 1 | 0; }; diff --git a/lib/es6/arrayLabels.js b/lib/es6/arrayLabels.js index cf122ba8dd..db8c5e22db 100644 --- a/lib/es6/arrayLabels.js +++ b/lib/es6/arrayLabels.js @@ -15,14 +15,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f(i); } return res; @@ -30,7 +30,7 @@ function init(l, f) { function make_matrix(sx, sy, init) { let res = Caml_array.make(sx, []); - for(let x = 0; x < sx; ++x){ + for (let x = 0; x < sx; ++x) { res[x] = Caml_array.make(sy, init); } return res; @@ -59,11 +59,11 @@ function append(a1, a2) { function sub(a, ofs, len) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.sub" + } + }); } return Caml_array.sub(a, ofs, len); } @@ -71,13 +71,13 @@ function sub(a, ofs, len) { function fill(a, ofs, len, v) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.fill" + } + }); } - for(let i = ofs ,i_finish = ofs + len | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + len | 0; i < i_finish; ++i) { a[i] = v; } } @@ -85,17 +85,17 @@ function fill(a, ofs, len, v) { function blit(a1, ofs1, a2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (a1.length - len | 0) || ofs2 < 0 || ofs2 > (a2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.blit" + } + }); } Caml_array.blit(a1, ofs1, a2, ofs2, len); } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -103,13 +103,13 @@ function iter(f, a) { function iter2(f, a, b) { if (a.length !== b.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.iter2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.iter2: arrays must have the same length" + } + }); } - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i], b[i]); } } @@ -120,7 +120,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -131,24 +131,24 @@ function map2(f, a, b) { let lb = b.length; if (la !== lb) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.map2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.map2: arrays must have the same length" + } + }); } if (la === 0) { return []; } let r = Caml_array.make(la, f(a[0], b[0])); - for(let i = 1; i < la; ++i){ + for (let i = 1; i < la; ++i) { r[i] = f(a[i], b[i]); } return r; } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -159,7 +159,7 @@ function mapi(f, a) { return []; } let r = Caml_array.make(l, f(0, a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -168,7 +168,7 @@ function mapi(f, a) { function to_list(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -184,7 +184,7 @@ function to_list(a) { } function list_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -203,7 +203,7 @@ function of_list(param) { let a = Caml_array.make(list_length(0, param), param.hd); let _i = 1; let _param = param.tl; - while(true) { + while (true) { let param$1 = _param; let i = _i; if (!param$1) { @@ -218,7 +218,7 @@ function of_list(param) { function fold_left(f, x, a) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -226,7 +226,7 @@ function fold_left(f, x, a) { function fold_right(f, a, x) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(a[i], r); } return r; @@ -235,7 +235,7 @@ function fold_right(f, a, x) { function exists(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -251,7 +251,7 @@ function exists(p, a) { function for_all(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return true; @@ -267,7 +267,7 @@ function for_all(p, a) { function mem(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -283,7 +283,7 @@ function mem(x, a) { function memq(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -318,16 +318,16 @@ function sort(cmp, a) { return i31; } throw new Error(Bottom, { - cause: { - RE_EXN_ID: Bottom, - _1: i - } - }); + cause: { + RE_EXN_ID: Bottom, + _1: i + } + }); }; let trickle = function (l, i, e) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); if (cmp(Caml_array.get(a, j), e) <= 0) { @@ -337,53 +337,51 @@ function sort(cmp, a) { _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return Caml_array.set(a, i$2._1, e); } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let bubble = function (l, i) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); Caml_array.set(a, i$1, Caml_array.get(a, j)); _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return i$2._1; } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let trickleup = function (_i, e) { - while(true) { + while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; if (i === father) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "arrayLabels.res", - 321, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "arrayLabels.res", + 321, + 4 + ] + } + }); } if (cmp(Caml_array.get(a, father), e) >= 0) { return Caml_array.set(a, i, e); @@ -397,10 +395,10 @@ function sort(cmp, a) { }; }; let l = a.length; - for(let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i){ + for (let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i) { trickle(l, i, Caml_array.get(a, i)); } - for(let i$1 = l - 1 | 0; i$1 >= 2; --i$1){ + for (let i$1 = l - 1 | 0; i$1 >= 2; --i$1) { let e = Caml_array.get(a, i$1); Caml_array.set(a, i$1, Caml_array.get(a, 0)); trickleup(bubble(i$1, 0), e); @@ -422,7 +420,7 @@ function stable_sort(cmp, a) { let _i2 = src2ofs; let _s2 = Caml_array.get(src2, src2ofs); let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -451,10 +449,10 @@ function stable_sort(cmp, a) { }; }; let isortto = function (srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { + while (j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { Caml_array.set(dst, j + 1 | 0, Caml_array.get(dst, j)); j = j - 1 | 0; }; diff --git a/lib/es6/belt_Array.js b/lib/es6/belt_Array.js index ddfd231929..6ba3ca9788 100644 --- a/lib/es6/belt_Array.js +++ b/lib/es6/belt_Array.js @@ -13,15 +13,15 @@ function get(arr, i) { function getExn(arr, i) { if (!(i >= 0 && i < arr.length)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_Array.res", - 36, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_Array.res", + 36, + 2 + ] + } + }); } return arr[i]; } @@ -38,15 +38,15 @@ function set(arr, i, v) { function setExn(arr, i, v) { if (!(i >= 0 && i < arr.length)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_Array.res", - 49, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_Array.res", + 49, + 2 + ] + } + }); } arr[i] = v; } @@ -62,7 +62,7 @@ function shuffleInPlace(xs) { let random_int = function (min, max) { return Math.floor(Math.random() * (max - min | 0)) + min | 0; }; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { swapUnsafe(xs, i, random_int(i, len)); } } @@ -76,7 +76,7 @@ function shuffle(xs) { function reverseInPlace(xs) { let len = xs.length; let ofs = 0; - for(let i = 0 ,i_finish = len / 2 | 0; i < i_finish; ++i){ + for (let i = 0, i_finish = len / 2 | 0; i < i_finish; ++i) { swapUnsafe(xs, ofs + i | 0, ((ofs + len | 0) - i | 0) - 1 | 0); } } @@ -84,7 +84,7 @@ function reverseInPlace(xs) { function reverse(xs) { let len = xs.length; let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = xs[(len - 1 | 0) - i | 0]; } return result; @@ -95,7 +95,7 @@ function make(l, f) { return []; } let res = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { res[i] = f; } return res; @@ -106,7 +106,7 @@ function makeByU(l, f) { return []; } let res = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { res[i] = f(i); } return res; @@ -136,7 +136,7 @@ function range(start, finish) { return []; } let arr = new Array(cut + 1 | 0); - for(let i = 0; i <= cut; ++i){ + for (let i = 0; i <= cut; ++i) { arr[i] = start + i | 0; } return arr; @@ -150,7 +150,7 @@ function rangeBy(start, finish, step) { let nb = (cut / step | 0) + 1 | 0; let arr = new Array(nb); let cur = start; - for(let i = 0; i < nb; ++i){ + for (let i = 0; i < nb; ++i) { arr[i] = cur; cur = cur + step | 0; } @@ -162,7 +162,7 @@ function zip(xs, ys) { let leny = ys.length; let len = lenx < leny ? lenx : leny; let s = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s[i] = [ xs[i], ys[i] @@ -176,7 +176,7 @@ function zipByU(xs, ys, f) { let leny = ys.length; let len = lenx < leny ? lenx : leny; let s = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s[i] = f(xs[i], ys[i]); } return s; @@ -192,10 +192,10 @@ function concat(a1, a2) { let l1 = a1.length; let l2 = a2.length; let a1a2 = new Array(l1 + l2 | 0); - for(let i = 0; i < l1; ++i){ + for (let i = 0; i < l1; ++i) { a1a2[i] = a1[i]; } - for(let i$1 = 0; i$1 < l2; ++i$1){ + for (let i$1 = 0; i$1 < l2; ++i$1) { a1a2[l1 + i$1 | 0] = a2[i$1]; } return a1a2; @@ -204,14 +204,14 @@ function concat(a1, a2) { function concatMany(arrs) { let lenArrs = arrs.length; let totalLen = 0; - for(let i = 0; i < lenArrs; ++i){ + for (let i = 0; i < lenArrs; ++i) { totalLen = totalLen + arrs[i].length | 0; } let result = new Array(totalLen); totalLen = 0; - for(let j = 0; j < lenArrs; ++j){ + for (let j = 0; j < lenArrs; ++j) { let cur = arrs[j]; - for(let k = 0 ,k_finish = cur.length; k < k_finish; ++k){ + for (let k = 0, k_finish = cur.length; k < k_finish; ++k) { result[totalLen] = cur[k]; totalLen = totalLen + 1 | 0; } @@ -231,7 +231,7 @@ function slice(a, offset, len) { return []; } let result = new Array(copyLength); - for(let i = 0; i < copyLength; ++i){ + for (let i = 0; i < copyLength; ++i) { result[i] = a[ofs + i | 0]; } return result; @@ -242,7 +242,7 @@ function sliceToEnd(a, offset) { let ofs = offset < 0 ? Caml.int_max(lena + offset | 0, 0) : offset; let len = lena > ofs ? lena - ofs | 0 : 0; let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = a[ofs + i | 0]; } return result; @@ -259,19 +259,19 @@ function fill(a, offset, len, v) { if (fillLength <= 0) { return; } - for(let i = ofs ,i_finish = ofs + fillLength | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + fillLength | 0; i < i_finish; ++i) { a[i] = v; } } function blitUnsafe(a1, srcofs1, a2, srcofs2, blitLength) { if (srcofs2 <= srcofs1) { - for(let j = 0; j < blitLength; ++j){ + for (let j = 0; j < blitLength; ++j) { a2[j + srcofs2 | 0] = a1[j + srcofs1 | 0]; } return; } - for(let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + srcofs2 | 0] = a1[j$1 + srcofs1 | 0]; } } @@ -283,18 +283,18 @@ function blit(a1, ofs1, a2, ofs2, len) { let srcofs2 = ofs2 < 0 ? Caml.int_max(lena2 + ofs2 | 0, 0) : ofs2; let blitLength = Caml.int_min(len, Caml.int_min(lena1 - srcofs1 | 0, lena2 - srcofs2 | 0)); if (srcofs2 <= srcofs1) { - for(let j = 0; j < blitLength; ++j){ + for (let j = 0; j < blitLength; ++j) { a2[j + srcofs2 | 0] = a1[j + srcofs1 | 0]; } return; } - for(let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + srcofs2 | 0] = a1[j$1 + srcofs1 | 0]; } } function forEachU(a, f) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -308,7 +308,7 @@ function forEach(a, f) { function mapU(a, f) { let l = a.length; let r = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -334,7 +334,7 @@ function getByU(a, p) { let l = a.length; let i = 0; let r; - while(r === undefined && i < l) { + while (r === undefined && i < l) { let v = a[i]; if (p(v)) { r = Caml_option.some(v); @@ -354,7 +354,7 @@ function getIndexByU(a, p) { let l = a.length; let i = 0; let r; - while(r === undefined && i < l) { + while (r === undefined && i < l) { let v = a[i]; if (p(v)) { r = i; @@ -374,7 +374,7 @@ function keepU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; if (f(v)) { r[j] = v; @@ -396,7 +396,7 @@ function keepWithIndexU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; if (f(v, i)) { r[j] = v; @@ -418,7 +418,7 @@ function keepMapU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; let v$1 = f(v); if (v$1 !== undefined) { @@ -438,7 +438,7 @@ function keepMap(a, f) { } function forEachWithIndexU(a, f) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -452,7 +452,7 @@ function forEachWithIndex(a, f) { function mapWithIndexU(a, f) { let l = a.length; let r = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -466,7 +466,7 @@ function mapWithIndex(a, f) { function reduceU(a, x, f) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -480,7 +480,7 @@ function reduce(a, x, f) { function reduceReverseU(a, x, f) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(r, a[i]); } return r; @@ -495,7 +495,7 @@ function reduceReverse(a, x, f) { function reduceReverse2U(a, b, x, f) { let r = x; let len = Caml.int_min(a.length, b.length); - for(let i = len - 1 | 0; i >= 0; --i){ + for (let i = len - 1 | 0; i >= 0; --i) { r = f(r, a[i], b[i]); } return r; @@ -509,7 +509,7 @@ function reduceReverse2(a, b, x, f) { function reduceWithIndexU(a, x, f) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i], i); } return r; @@ -524,7 +524,7 @@ function reduceWithIndex(a, x, f) { function everyU(arr, b) { let len = arr.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len) { return true; @@ -546,7 +546,7 @@ function every(arr, f) { function someU(arr, b) { let len = arr.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len) { return false; @@ -566,7 +566,7 @@ function some(arr, f) { } function everyAux2(arr1, arr2, _i, b, len) { - while(true) { + while (true) { let i = _i; if (i === len) { return true; @@ -592,7 +592,7 @@ function every2(a, b, p) { function some2U(a, b, p) { let _i = 0; let len = Caml.int_min(a.length, b.length); - while(true) { + while (true) { let i = _i; if (i === len) { return false; @@ -636,7 +636,7 @@ function cmpU(a, b, p) { return -1; } else { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === lena) { return 0; @@ -663,7 +663,7 @@ function partitionU(a, f) { let j = 0; let a1 = new Array(l); let a2 = new Array(l); - for(let ii = 0; ii < l; ++ii){ + for (let ii = 0; ii < l; ++ii) { let v = a[ii]; if (f(v)) { a1[i] = v; @@ -691,7 +691,7 @@ function unzip(a) { let l = a.length; let a1 = new Array(l); let a2 = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let match = a[i]; a1[i] = match[0]; a2[i] = match[1]; @@ -710,7 +710,7 @@ function joinWithU(a, sep, toString) { let lastIndex = l - 1 | 0; let _i = 0; let _res = ""; - while(true) { + while (true) { let res = _res; let i = _i; if (i === lastIndex) { @@ -730,7 +730,7 @@ function joinWith(a, sep, toString) { function initU(n, f) { let v = new Array(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { v[i] = f(i); } return v; diff --git a/lib/es6/belt_HashMap.js b/lib/es6/belt_HashMap.js index abefcddf27..3305354289 100644 --- a/lib/es6/belt_HashMap.js +++ b/lib/es6/belt_HashMap.js @@ -9,7 +9,7 @@ function size(h) { } function copyBucketReHash(hash, h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -28,7 +28,7 @@ function copyBucketReHash(hash, h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(eq, key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { cell.value = info; @@ -76,10 +76,10 @@ function set0(h, key, value, eq, hash) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(hash, h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -110,7 +110,7 @@ function remove(h, key) { } else { let _prec = bucket; let _bucket = bucket.next; - while(true) { + while (true) { let bucket$1 = _bucket; let prec = _prec; if (bucket$1 === undefined) { @@ -153,7 +153,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -176,7 +176,7 @@ function has(h, key) { if (bucket !== undefined) { let _cell = bucket; let eq = h.eq; - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return true; @@ -202,7 +202,7 @@ function fromArray(arr, id) { let eq = id.eq; let len = arr.length; let v = Belt_internalBucketsType.make(hash, eq, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set0(v, match[0], match[1], eq, hash); } @@ -213,7 +213,7 @@ function mergeMany(h, arr) { let hash = h.hash; let eq = h.eq; let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set0(h, match[0], match[1], eq, hash); } diff --git a/lib/es6/belt_HashMapInt.js b/lib/es6/belt_HashMapInt.js index 2d1d6c8537..ade45ca13f 100644 --- a/lib/es6/belt_HashMapInt.js +++ b/lib/es6/belt_HashMapInt.js @@ -6,7 +6,7 @@ import * as Belt_internalBuckets from "./belt_internalBuckets.js"; import * as Belt_internalBucketsType from "./belt_internalBucketsType.js"; function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -25,7 +25,7 @@ function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { cell.value = info; @@ -73,10 +73,10 @@ function set(h, key, value) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -100,7 +100,7 @@ function remove(h, key) { } else { let _prec = bucket; let _buckets = bucket.next; - while(true) { + while (true) { let buckets = _buckets; let prec = _prec; if (buckets === undefined) { @@ -144,7 +144,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -166,7 +166,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -194,7 +194,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(v, match[0], match[1]); } @@ -203,7 +203,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(h, match[0], match[1]); } diff --git a/lib/es6/belt_HashMapString.js b/lib/es6/belt_HashMapString.js index c4352164cb..2e873f5140 100644 --- a/lib/es6/belt_HashMapString.js +++ b/lib/es6/belt_HashMapString.js @@ -6,7 +6,7 @@ import * as Belt_internalBuckets from "./belt_internalBuckets.js"; import * as Belt_internalBucketsType from "./belt_internalBucketsType.js"; function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -25,7 +25,7 @@ function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { cell.value = info; @@ -73,10 +73,10 @@ function set(h, key, value) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -100,7 +100,7 @@ function remove(h, key) { } else { let _prec = bucket; let _buckets = bucket.next; - while(true) { + while (true) { let buckets = _buckets; let prec = _prec; if (buckets === undefined) { @@ -144,7 +144,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -166,7 +166,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -194,7 +194,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(v, match[0], match[1]); } @@ -203,7 +203,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(h, match[0], match[1]); } diff --git a/lib/es6/belt_HashSet.js b/lib/es6/belt_HashSet.js index 78a9a88609..491819bec1 100644 --- a/lib/es6/belt_HashSet.js +++ b/lib/es6/belt_HashSet.js @@ -4,7 +4,7 @@ import * as Belt_internalSetBuckets from "./belt_internalSetBuckets.js"; import * as Belt_internalBucketsType from "./belt_internalBucketsType.js"; function copyBucket(hash, h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell, eq) { - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return; @@ -103,10 +103,10 @@ function add0(h, key, hash, eq) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(hash, h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -129,7 +129,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return true; @@ -159,7 +159,7 @@ function fromArray(arr, id) { let hash = id.hash; let len = arr.length; let v = Belt_internalBucketsType.make(hash, eq, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add0(v, arr[i], hash, eq); } return v; @@ -169,7 +169,7 @@ function mergeMany(h, arr) { let eq = h.eq; let hash = h.hash; let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add0(h, arr[i], hash, eq); } } diff --git a/lib/es6/belt_HashSetInt.js b/lib/es6/belt_HashSetInt.js index af39562572..d98a54f6ec 100644 --- a/lib/es6/belt_HashSetInt.js +++ b/lib/es6/belt_HashSetInt.js @@ -5,7 +5,7 @@ import * as Belt_internalSetBuckets from "./belt_internalSetBuckets.js"; import * as Belt_internalBucketsType from "./belt_internalBucketsType.js"; function copyBucket(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return; @@ -103,10 +103,10 @@ function add(h, key) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -124,7 +124,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -152,7 +152,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(v, arr[i]); } return v; @@ -160,7 +160,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(h, arr[i]); } } diff --git a/lib/es6/belt_HashSetString.js b/lib/es6/belt_HashSetString.js index 0393ba380f..3660ae441c 100644 --- a/lib/es6/belt_HashSetString.js +++ b/lib/es6/belt_HashSetString.js @@ -5,7 +5,7 @@ import * as Belt_internalSetBuckets from "./belt_internalSetBuckets.js"; import * as Belt_internalBucketsType from "./belt_internalBucketsType.js"; function copyBucket(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return; @@ -103,10 +103,10 @@ function add(h, key) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -124,7 +124,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -152,7 +152,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(v, arr[i]); } return v; @@ -160,7 +160,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(h, arr[i]); } } diff --git a/lib/es6/belt_List.js b/lib/es6/belt_List.js index e55399c63a..ea587f3fcd 100644 --- a/lib/es6/belt_List.js +++ b/lib/es6/belt_List.js @@ -16,10 +16,10 @@ function headExn(x) { return x.hd; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function tail(x) { @@ -34,10 +34,10 @@ function tailExn(x) { return x.tl; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function add(xs, x) { @@ -53,7 +53,7 @@ function get(x, n) { } else { let _x = x; let _n = n; - while(true) { + while (true) { let n$1 = _n; let x$1 = _x; if (!x$1) { @@ -72,14 +72,14 @@ function get(x, n) { function getExn(x, n) { if (n < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let _x = x; let _n = n; - while(true) { + while (true) { let n$1 = _n; let x$1 = _x; if (x$1) { @@ -91,15 +91,15 @@ function getExn(x, n) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function partitionAux(p, _cell, _precX, _precY) { - while(true) { + while (true) { let precY = _precY; let precX = _precX; let cell = _cell; @@ -126,7 +126,7 @@ function partitionAux(p, _cell, _precX, _precY) { } function splitAux(_cell, _precX, _precY) { - while(true) { + while (true) { let precY = _precY; let precX = _precX; let cell = _cell; @@ -152,7 +152,7 @@ function splitAux(_cell, _precX, _precY) { } function copyAuxCont(_cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -170,7 +170,7 @@ function copyAuxCont(_cellX, _prec) { } function copyAuxWitFilter(f, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -194,7 +194,7 @@ function copyAuxWitFilter(f, _cellX, _prec) { } function copyAuxWithFilterIndex(f, _cellX, _prec, _i) { - while(true) { + while (true) { let i = _i; let prec = _prec; let cellX = _cellX; @@ -221,7 +221,7 @@ function copyAuxWithFilterIndex(f, _cellX, _prec, _i) { } function copyAuxWitFilterMap(f, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -245,7 +245,7 @@ function copyAuxWitFilterMap(f, _cellX, _prec) { } function removeAssocAuxWithMap(_cellX, x, _prec, f) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -269,7 +269,7 @@ function removeAssocAuxWithMap(_cellX, x, _prec, f) { } function setAssocAuxWithMap(_cellX, x, k, _prec, eq) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -299,7 +299,7 @@ function setAssocAuxWithMap(_cellX, x, k, _prec, eq) { } function copyAuxWithMap(_cellX, _prec, f) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -317,7 +317,7 @@ function copyAuxWithMap(_cellX, _prec, f) { } function zipAux(_cellX, _cellY, _prec) { - while(true) { + while (true) { let prec = _prec; let cellY = _cellY; let cellX = _cellX; @@ -343,7 +343,7 @@ function zipAux(_cellX, _cellY, _prec) { } function copyAuxWithMap2(f, _cellX, _cellY, _prec) { - while(true) { + while (true) { let prec = _prec; let cellY = _cellY; let cellX = _cellX; @@ -366,7 +366,7 @@ function copyAuxWithMap2(f, _cellX, _cellY, _prec) { } function copyAuxWithMapI(f, _i, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; let i = _i; @@ -386,7 +386,7 @@ function copyAuxWithMapI(f, _i, _cellX, _prec) { } function takeAux(_n, _cell, _prec) { - while(true) { + while (true) { let prec = _prec; let cell = _cell; let n = _n; @@ -409,7 +409,7 @@ function takeAux(_n, _cell, _prec) { } function splitAtAux(_n, _cell, _prec) { - while(true) { + while (true) { let prec = _prec; let cell = _cell; let n = _n; @@ -458,7 +458,7 @@ function drop(lst, n) { } else { let _l = lst; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l = _l; if (n$1 === 0) { @@ -580,7 +580,7 @@ function makeByU(n, f) { }; let cur = headX; let i = 1; - while(i < n) { + while (i < n) { let v = { hd: f(i), tl: /* [] */0 @@ -608,7 +608,7 @@ function make(n, v) { }; let cur = headX; let i = 1; - while(i < n) { + while (i < n) { let v$1 = { hd: v, tl: /* [] */0 @@ -623,7 +623,7 @@ function make(n, v) { function length(xs) { let _x = xs; let _acc = 0; - while(true) { + while (true) { let acc = _acc; let x = _x; if (!x) { @@ -636,7 +636,7 @@ function length(xs) { } function fillAux(arr, _i, _x) { - while(true) { + while (true) { let x = _x; let i = _i; if (!x) { @@ -652,7 +652,7 @@ function fillAux(arr, _i, _x) { function fromArray(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -681,7 +681,7 @@ function shuffle(xs) { } function reverseConcat(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -701,7 +701,7 @@ function reverse(l) { } function flattenAux(_prec, _xs) { - while(true) { + while (true) { let xs = _xs; let prec = _prec; if (xs) { @@ -715,7 +715,7 @@ function flattenAux(_prec, _xs) { } function flatten(_xs) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; @@ -744,7 +744,7 @@ function concatMany(xs) { } let len$1 = xs.length; let v = xs[len$1 - 1 | 0]; - for(let i = len$1 - 2 | 0; i >= 0; --i){ + for (let i = len$1 - 2 | 0; i >= 0; --i) { v = concat(xs[i], v); } return v; @@ -753,7 +753,7 @@ function concatMany(xs) { function mapReverseU(l, f) { let _accu = /* [] */0; let _xs = l; - while(true) { + while (true) { let xs = _xs; let accu = _accu; if (!xs) { @@ -775,7 +775,7 @@ function mapReverse(l, f) { } function forEachU(_xs, f) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -795,7 +795,7 @@ function forEach(xs, f) { function forEachWithIndexU(l, f) { let _xs = l; let _i = 0; - while(true) { + while (true) { let i = _i; let xs = _xs; if (!xs) { @@ -815,7 +815,7 @@ function forEachWithIndex(l, f) { } function reduceU(_l, _accu, f) { - while(true) { + while (true) { let accu = _accu; let l = _l; if (!l) { @@ -860,7 +860,7 @@ function reduceWithIndexU(l, acc, f) { let _l = l; let _acc = acc; let _i = 0; - while(true) { + while (true) { let i = _i; let acc$1 = _acc; let l$1 = _l; @@ -884,7 +884,7 @@ function mapReverse2U(l1, l2, f) { let _l1 = l1; let _l2 = l2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1$1 = _l1; @@ -911,7 +911,7 @@ function mapReverse2(l1, l2, f) { } function forEach2U(_l1, _l2, f) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -934,7 +934,7 @@ function forEach2(l1, l2, f) { } function reduce2U(_l1, _l2, _accu, f) { - while(true) { + while (true) { let accu = _accu; let l2 = _l2; let l1 = _l1; @@ -981,7 +981,7 @@ function reduceReverse2(l1, l2, acc, f) { } function everyU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return true; @@ -1001,7 +1001,7 @@ function every(xs, p) { } function someU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1021,7 +1021,7 @@ function some(xs, p) { } function every2U(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1046,7 +1046,7 @@ function every2(l1, l2, p) { } function cmpByLength(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1066,7 +1066,7 @@ function cmpByLength(_l1, _l2) { } function cmpU(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1096,7 +1096,7 @@ function cmp(l1, l2, f) { } function eqU(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1125,7 +1125,7 @@ function eq(l1, l2, f) { } function some2U(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1150,7 +1150,7 @@ function some2(l1, l2, p) { } function hasU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1170,7 +1170,7 @@ function has(xs, x, eq) { } function getAssocU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -1191,7 +1191,7 @@ function getAssoc(xs, x, eq) { } function hasAssocU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1295,7 +1295,7 @@ function sort(xs, cmp) { } function getByU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -1316,7 +1316,7 @@ function getBy(xs, p) { } function keepU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; @@ -1345,7 +1345,7 @@ function keep(xs, p) { function keepWithIndexU(xs, p) { let _xs = xs; let _i = 0; - while(true) { + while (true) { let i = _i; let xs$1 = _xs; if (!xs$1) { @@ -1374,7 +1374,7 @@ function keepWithIndex(xs, p) { } function keepMapU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; diff --git a/lib/es6/belt_MapDict.js b/lib/es6/belt_MapDict.js index ad544897de..6237bee192 100644 --- a/lib/es6/belt_MapDict.js +++ b/lib/es6/belt_MapDict.js @@ -133,7 +133,7 @@ function remove(n, x, cmp) { function mergeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1], cmp); } @@ -255,7 +255,7 @@ function removeMany(t, keys, cmp) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { diff --git a/lib/es6/belt_MapInt.js b/lib/es6/belt_MapInt.js index ced1b1814e..76f984b312 100644 --- a/lib/es6/belt_MapInt.js +++ b/lib/es6/belt_MapInt.js @@ -127,7 +127,7 @@ function removeMany(t, keys) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { @@ -149,7 +149,7 @@ function removeMany(t, keys) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1]); } diff --git a/lib/es6/belt_MapString.js b/lib/es6/belt_MapString.js index 0880dca3cd..a1d539ed41 100644 --- a/lib/es6/belt_MapString.js +++ b/lib/es6/belt_MapString.js @@ -127,7 +127,7 @@ function removeMany(t, keys) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { @@ -149,7 +149,7 @@ function removeMany(t, keys) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1]); } diff --git a/lib/es6/belt_MutableMap.js b/lib/es6/belt_MutableMap.js index 009ef39219..16204d2d17 100644 --- a/lib/es6/belt_MutableMap.js +++ b/lib/es6/belt_MutableMap.js @@ -54,7 +54,7 @@ function remove(d, k) { } function removeArrayMutateAux(_t, xs, _i, len, cmp) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -339,7 +339,7 @@ function set(m, e, v) { function mergeManyAux(t, xs, cmp) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { let match = xs[i]; v = Belt_internalAVLtree.updateMutate(v, match[0], match[1], cmp); } diff --git a/lib/es6/belt_MutableMapInt.js b/lib/es6/belt_MutableMapInt.js index f1549c8441..242e5ec17d 100644 --- a/lib/es6/belt_MutableMapInt.js +++ b/lib/es6/belt_MutableMapInt.js @@ -257,7 +257,7 @@ function update(t, x, f) { } function removeArrayMutateAux(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { diff --git a/lib/es6/belt_MutableMapString.js b/lib/es6/belt_MutableMapString.js index 60243c3480..ecaf7f6548 100644 --- a/lib/es6/belt_MutableMapString.js +++ b/lib/es6/belt_MutableMapString.js @@ -257,7 +257,7 @@ function update(t, x, f) { } function removeArrayMutateAux(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { diff --git a/lib/es6/belt_MutableQueue.js b/lib/es6/belt_MutableQueue.js index 792e610d4b..254d27cb79 100644 --- a/lib/es6/belt_MutableQueue.js +++ b/lib/es6/belt_MutableQueue.js @@ -55,10 +55,10 @@ function peekExn(q) { return v.content; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function pop(q) { @@ -91,10 +91,10 @@ function popExn(q) { } } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function popUndefined(q) { @@ -121,7 +121,7 @@ function copy(q) { }; let _prev; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (cell !== undefined) { @@ -152,7 +152,7 @@ function mapU(q, f) { }; let _prev; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (cell !== undefined) { @@ -191,7 +191,7 @@ function size(q) { function forEachU(q, f) { let _cell = q.first; - while(true) { + while (true) { let cell = _cell; if (cell === undefined) { return; @@ -211,7 +211,7 @@ function forEach(q, f) { function reduceU(q, accu, f) { let _accu = accu; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let accu$1 = _accu; if (cell === undefined) { @@ -249,7 +249,7 @@ function transfer(q1, q2) { } function fillAux(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; if (cell === undefined) { @@ -274,7 +274,7 @@ function fromArray(arr) { first: undefined, last: undefined }; - for(let i = 0 ,i_finish = arr.length; i < i_finish; ++i){ + for (let i = 0, i_finish = arr.length; i < i_finish; ++i) { add(q, arr[i]); } return q; diff --git a/lib/es6/belt_MutableSet.js b/lib/es6/belt_MutableSet.js index 49ca11d976..1e62749b0c 100644 --- a/lib/es6/belt_MutableSet.js +++ b/lib/es6/belt_MutableSet.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len, cmp) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -174,7 +174,7 @@ function add(m, e) { function addArrayMutate(t, xs, cmp) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalAVLset.addMutate(cmp, v, xs[i]); } return v; diff --git a/lib/es6/belt_MutableSetInt.js b/lib/es6/belt_MutableSetInt.js index 1507932c69..3aba178ebd 100644 --- a/lib/es6/belt_MutableSetInt.js +++ b/lib/es6/belt_MutableSetInt.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -172,7 +172,7 @@ function add(d, k) { function addArrayMutate(t, xs) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalSetInt.addMutate(v, xs[i]); } return v; diff --git a/lib/es6/belt_MutableSetString.js b/lib/es6/belt_MutableSetString.js index 004803ecb6..fe8f1abae6 100644 --- a/lib/es6/belt_MutableSetString.js +++ b/lib/es6/belt_MutableSetString.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -172,7 +172,7 @@ function add(d, k) { function addArrayMutate(t, xs) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalSetString.addMutate(v, xs[i]); } return v; diff --git a/lib/es6/belt_MutableStack.js b/lib/es6/belt_MutableStack.js index 1197f56c81..6bac9b981f 100644 --- a/lib/es6/belt_MutableStack.js +++ b/lib/es6/belt_MutableStack.js @@ -68,7 +68,7 @@ function size(s) { if (x !== undefined) { let _x = x; let _acc = 0; - while(true) { + while (true) { let acc = _acc; let x$1 = _x; let x$2 = x$1.tail; @@ -86,7 +86,7 @@ function size(s) { function forEachU(s, f) { let _s = s.root; - while(true) { + while (true) { let s$1 = _s; if (s$1 === undefined) { return; @@ -104,7 +104,7 @@ function forEach(s, f) { } function dynamicPopIterU(s, f) { - while(true) { + while (true) { let match = s.root; if (match === undefined) { return; diff --git a/lib/es6/belt_Option.js b/lib/es6/belt_Option.js index 840279441c..ecc0fa749c 100644 --- a/lib/es6/belt_Option.js +++ b/lib/es6/belt_Option.js @@ -33,10 +33,10 @@ function getExn(x) { return Caml_option.valFromOption(x); } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function mapWithDefaultU(opt, $$default, f) { diff --git a/lib/es6/belt_Range.js b/lib/es6/belt_Range.js index 6dc8c014d2..da7395500d 100644 --- a/lib/es6/belt_Range.js +++ b/lib/es6/belt_Range.js @@ -2,7 +2,7 @@ function forEachU(s, f, action) { - for(let i = s; i <= f; ++i){ + for (let i = s; i <= f; ++i) { action(i); } } @@ -14,7 +14,7 @@ function forEach(s, f, action) { } function everyU(_s, f, p) { - while(true) { + while (true) { let s = _s; if (s > f) { return true; @@ -36,7 +36,7 @@ function every(s, f, p) { function everyByU(s, f, step, p) { if (step > 0) { let _s = s; - while(true) { + while (true) { let s$1 = _s; if (s$1 > f) { return true; @@ -59,7 +59,7 @@ function everyBy(s, f, step, p) { } function someU(_s, f, p) { - while(true) { + while (true) { let s = _s; if (s > f) { return false; @@ -81,7 +81,7 @@ function some(s, f, p) { function someByU(s, f, step, p) { if (step > 0) { let _s = s; - while(true) { + while (true) { let s$1 = _s; if (s$1 > f) { return false; diff --git a/lib/es6/belt_Result.js b/lib/es6/belt_Result.js index e3594b9633..caffcf0e41 100644 --- a/lib/es6/belt_Result.js +++ b/lib/es6/belt_Result.js @@ -6,10 +6,10 @@ function getExn(x) { return x._0; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function mapWithDefaultU(opt, $$default, f) { diff --git a/lib/es6/belt_SetDict.js b/lib/es6/belt_SetDict.js index 4231c26328..7e930e81ce 100644 --- a/lib/es6/belt_SetDict.js +++ b/lib/es6/belt_SetDict.js @@ -69,7 +69,7 @@ function remove(t, x, cmp) { function mergeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key, cmp); } @@ -79,7 +79,7 @@ function mergeMany(h, arr, cmp) { function removeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key, cmp); } diff --git a/lib/es6/belt_SetInt.js b/lib/es6/belt_SetInt.js index 6c172f6644..b40cc8e4c4 100644 --- a/lib/es6/belt_SetInt.js +++ b/lib/es6/belt_SetInt.js @@ -32,7 +32,7 @@ function add(t, x) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key); } @@ -78,7 +78,7 @@ function remove(t, x) { function removeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key); } diff --git a/lib/es6/belt_SetString.js b/lib/es6/belt_SetString.js index 3322ff29fa..b2f54a7447 100644 --- a/lib/es6/belt_SetString.js +++ b/lib/es6/belt_SetString.js @@ -32,7 +32,7 @@ function add(t, x) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key); } @@ -78,7 +78,7 @@ function remove(t, x) { function removeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key); } diff --git a/lib/es6/belt_SortArray.js b/lib/es6/belt_SortArray.js index 11810837e4..36dee355cd 100644 --- a/lib/es6/belt_SortArray.js +++ b/lib/es6/belt_SortArray.js @@ -3,7 +3,7 @@ import * as Belt_Array from "./belt_Array.js"; function sortedLengthAuxMore(xs, _prec, _acc, len, lt) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLengthU(xs, lt) { if (lt(x0, x1)) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -63,7 +63,7 @@ function isSortedU(a, cmp) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -91,7 +91,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -128,7 +128,7 @@ function unionU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -197,7 +197,7 @@ function intersectU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -252,7 +252,7 @@ function diffU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -306,10 +306,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) { } function insertionSort(src, srcofs, dst, dstofs, len, cmp) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(dst[j], e) > 0) { + while (j >= dstofs && cmp(dst[j], e) > 0) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -376,7 +376,7 @@ function binarySearchByU(sorted, key, cmp) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/es6/belt_SortArrayInt.js b/lib/es6/belt_SortArrayInt.js index 2ba1e57eef..efedb6aad0 100644 --- a/lib/es6/belt_SortArrayInt.js +++ b/lib/es6/belt_SortArrayInt.js @@ -3,7 +3,7 @@ import * as Belt_Array from "./belt_Array.js"; function sortedLengthAuxMore(xs, _prec, _acc, len) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLength(xs) { if (x0 < x1) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -57,7 +57,7 @@ function isSorted(a) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -79,7 +79,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -116,7 +116,7 @@ function union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -178,7 +178,7 @@ function intersect(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -226,7 +226,7 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -273,10 +273,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { } function insertionSort(src, srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && dst[j] > e) { + while (j >= dstofs && dst[j] > e) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -329,7 +329,7 @@ function binarySearch(sorted, key) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/es6/belt_SortArrayString.js b/lib/es6/belt_SortArrayString.js index 2ba1e57eef..efedb6aad0 100644 --- a/lib/es6/belt_SortArrayString.js +++ b/lib/es6/belt_SortArrayString.js @@ -3,7 +3,7 @@ import * as Belt_Array from "./belt_Array.js"; function sortedLengthAuxMore(xs, _prec, _acc, len) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLength(xs) { if (x0 < x1) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -57,7 +57,7 @@ function isSorted(a) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -79,7 +79,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -116,7 +116,7 @@ function union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -178,7 +178,7 @@ function intersect(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -226,7 +226,7 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -273,10 +273,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { } function insertionSort(src, srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && dst[j] > e) { + while (j >= dstofs && dst[j] > e) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -329,7 +329,7 @@ function binarySearch(sorted, key) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/es6/belt_internalAVLset.js b/lib/es6/belt_internalAVLset.js index 6f6efe8a31..82c2aa4996 100644 --- a/lib/es6/belt_internalAVLset.js +++ b/lib/es6/belt_internalAVLset.js @@ -82,7 +82,7 @@ function bal(l, v, r) { } function min0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -108,7 +108,7 @@ function minUndefined(n) { } function max0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -148,7 +148,7 @@ function isEmpty(n) { } function stackAllLeft(_v, _s) { - while(true) { + while (true) { let s = _s; let v = _v; if (v === undefined) { @@ -164,7 +164,7 @@ function stackAllLeft(_v, _s) { } function forEachU(_n, f) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -183,7 +183,7 @@ function forEach(n, f) { } function reduceU(_s, _accu, f) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (s === undefined) { @@ -202,7 +202,7 @@ function reduce(s, accu, f) { } function everyU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return true; @@ -225,7 +225,7 @@ function every(n, p) { } function someU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -346,7 +346,7 @@ function size(n) { } function toListAux(_n, _accu) { - while(true) { + while (true) { let accu = _accu; let n = _n; if (n === undefined) { @@ -366,7 +366,7 @@ function toList(s) { } function checkInvariantInternal(_v) { - while(true) { + while (true) { let v = _v; if (v === undefined) { return; @@ -380,15 +380,15 @@ function checkInvariantInternal(_v) { ) | 0; if (!(diff <= 2 && diff >= -2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_internalAVLset.res", - 319, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_internalAVLset.res", + 319, + 4 + ] + } + }); } checkInvariantInternal(l); _v = r; @@ -397,7 +397,7 @@ function checkInvariantInternal(_v) { } function fillArray(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.v; @@ -416,7 +416,7 @@ function fillArray(_n, _i, arr) { } function fillArrayWithPartition(_n, cursor, arr, p) { - while(true) { + while (true) { let n = _n; let v = n.v; let l = n.l; @@ -442,7 +442,7 @@ function fillArrayWithPartition(_n, cursor, arr, p) { } function fillArrayWithFilter(_n, _i, arr, p) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.v; @@ -472,28 +472,28 @@ function toArray(n) { function fromSortedArrayRevAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - return singleton(arr[off]); + return singleton(arr[off]); case 2 : - let x0 = arr[off]; - let x1 = arr[off - 1 | 0]; - return { - v: x1, - h: 2, - l: singleton(x0), - r: undefined - }; + let x0 = arr[off]; + let x1 = arr[off - 1 | 0]; + return { + v: x1, + h: 2, + l: singleton(x0), + r: undefined + }; case 3 : - let x0$1 = arr[off]; - let x1$1 = arr[off - 1 | 0]; - let x2 = arr[off - 2 | 0]; - return { - v: x1$1, - h: 2, - l: singleton(x0$1), - r: singleton(x2) - }; + let x0$1 = arr[off]; + let x1$1 = arr[off - 1 | 0]; + let x2 = arr[off - 2 | 0]; + return { + v: x1$1, + h: 2, + l: singleton(x0$1), + r: singleton(x2) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayRevAux(arr, off, nl); @@ -506,28 +506,28 @@ function fromSortedArrayRevAux(arr, off, len) { function fromSortedArrayAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - return singleton(arr[off]); + return singleton(arr[off]); case 2 : - let x0 = arr[off]; - let x1 = arr[off + 1 | 0]; - return { - v: x1, - h: 2, - l: singleton(x0), - r: undefined - }; + let x0 = arr[off]; + let x1 = arr[off + 1 | 0]; + return { + v: x1, + h: 2, + l: singleton(x0), + r: undefined + }; case 3 : - let x0$1 = arr[off]; - let x1$1 = arr[off + 1 | 0]; - let x2 = arr[off + 2 | 0]; - return { - v: x1$1, - h: 2, - l: singleton(x0$1), - r: singleton(x2) - }; + let x0$1 = arr[off]; + let x1$1 = arr[off + 1 | 0]; + let x2 = arr[off + 2 | 0]; + return { + v: x1$1, + h: 2, + l: singleton(x0$1), + r: singleton(x2) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayAux(arr, off, nl); @@ -613,7 +613,7 @@ function partitionCopy(n, p) { } function has(_t, x, cmp) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -634,7 +634,7 @@ function cmp(s1, s2, cmp$1) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -665,7 +665,7 @@ function eq(s1, s2, c) { } function subset(_s1, _s2, cmp) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -705,7 +705,7 @@ function subset(_s1, _s2, cmp) { } function get(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -721,7 +721,7 @@ function get(_n, x, cmp) { } function getUndefined(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -737,7 +737,7 @@ function getUndefined(_n, x, cmp) { } function getExn(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -749,10 +749,10 @@ function getExn(_n, x, cmp) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -885,7 +885,7 @@ function fromArray(xs, cmp) { next = -next | 0; result = fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(cmp, result, xs[i]); } return result; diff --git a/lib/es6/belt_internalAVLtree.js b/lib/es6/belt_internalAVLtree.js index b2406181e3..759a7b964b 100644 --- a/lib/es6/belt_internalAVLtree.js +++ b/lib/es6/belt_internalAVLtree.js @@ -104,7 +104,7 @@ function bal(l, x, d, r) { } function minKey0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -130,7 +130,7 @@ function minKeyUndefined(n) { } function maxKey0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -156,7 +156,7 @@ function maxKeyUndefined(n) { } function minKV0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -185,7 +185,7 @@ function minUndefined(n) { } function maxKV0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -229,7 +229,7 @@ function isEmpty(x) { } function stackAllLeft(_v, _s) { - while(true) { + while (true) { let s = _s; let v = _v; if (v === undefined) { @@ -275,7 +275,7 @@ function findFirstBy(n, p) { } function forEachU(_n, f) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -339,7 +339,7 @@ function mapWithKey(n, f) { } function reduceU(_m, _accu, f) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (m === undefined) { @@ -362,7 +362,7 @@ function reduce(m, accu, f) { } function everyU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return true; @@ -385,7 +385,7 @@ function every(n, p) { } function someU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -570,7 +570,7 @@ function size(n) { } function toListAux(_n, _accu) { - while(true) { + while (true) { let accu = _accu; let n = _n; if (n === undefined) { @@ -597,7 +597,7 @@ function toList(s) { } function checkInvariantInternal(_v) { - while(true) { + while (true) { let v = _v; if (v === undefined) { return; @@ -607,15 +607,15 @@ function checkInvariantInternal(_v) { let diff = treeHeight(l) - treeHeight(r) | 0; if (!(diff <= 2 && diff >= -2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_internalAVLtree.res", - 457, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_internalAVLtree.res", + 457, + 4 + ] + } + }); } checkInvariantInternal(l); _v = r; @@ -624,7 +624,7 @@ function checkInvariantInternal(_v) { } function fillArrayKey(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.k; @@ -643,7 +643,7 @@ function fillArrayKey(_n, _i, arr) { } function fillArrayValue(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let l = n.l; @@ -661,7 +661,7 @@ function fillArrayValue(_n, _i, arr) { } function fillArray(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let l = n.l; @@ -715,36 +715,36 @@ function valuesToArray(n) { function fromSortedArrayRevAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - let match = arr[off]; - return singleton(match[0], match[1]); + let match = arr[off]; + return singleton(match[0], match[1]); case 2 : - let match_0 = arr[off]; - let match_1 = arr[off - 1 | 0]; - let match$1 = match_1; - let match$2 = match_0; - return { - k: match$1[0], - v: match$1[1], - h: 2, - l: singleton(match$2[0], match$2[1]), - r: undefined - }; + let match_0 = arr[off]; + let match_1 = arr[off - 1 | 0]; + let match$1 = match_1; + let match$2 = match_0; + return { + k: match$1[0], + v: match$1[1], + h: 2, + l: singleton(match$2[0], match$2[1]), + r: undefined + }; case 3 : - let match_0$1 = arr[off]; - let match_1$1 = arr[off - 1 | 0]; - let match_2 = arr[off - 2 | 0]; - let match$3 = match_2; - let match$4 = match_1$1; - let match$5 = match_0$1; - return { - k: match$4[0], - v: match$4[1], - h: 2, - l: singleton(match$5[0], match$5[1]), - r: singleton(match$3[0], match$3[1]) - }; + let match_0$1 = arr[off]; + let match_1$1 = arr[off - 1 | 0]; + let match_2 = arr[off - 2 | 0]; + let match$3 = match_2; + let match$4 = match_1$1; + let match$5 = match_0$1; + return { + k: match$4[0], + v: match$4[1], + h: 2, + l: singleton(match$5[0], match$5[1]), + r: singleton(match$3[0], match$3[1]) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayRevAux(arr, off, nl); @@ -757,36 +757,36 @@ function fromSortedArrayRevAux(arr, off, len) { function fromSortedArrayAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - let match = arr[off]; - return singleton(match[0], match[1]); + let match = arr[off]; + return singleton(match[0], match[1]); case 2 : - let match_0 = arr[off]; - let match_1 = arr[off + 1 | 0]; - let match$1 = match_1; - let match$2 = match_0; - return { - k: match$1[0], - v: match$1[1], - h: 2, - l: singleton(match$2[0], match$2[1]), - r: undefined - }; + let match_0 = arr[off]; + let match_1 = arr[off + 1 | 0]; + let match$1 = match_1; + let match$2 = match_0; + return { + k: match$1[0], + v: match$1[1], + h: 2, + l: singleton(match$2[0], match$2[1]), + r: undefined + }; case 3 : - let match_0$1 = arr[off]; - let match_1$1 = arr[off + 1 | 0]; - let match_2 = arr[off + 2 | 0]; - let match$3 = match_2; - let match$4 = match_1$1; - let match$5 = match_0$1; - return { - k: match$4[0], - v: match$4[1], - h: 2, - l: singleton(match$5[0], match$5[1]), - r: singleton(match$3[0], match$3[1]) - }; + let match_0$1 = arr[off]; + let match_1$1 = arr[off + 1 | 0]; + let match_2 = arr[off + 2 | 0]; + let match$3 = match_2; + let match$4 = match_1$1; + let match$5 = match_0$1; + return { + k: match$4[0], + v: match$4[1], + h: 2, + l: singleton(match$5[0], match$5[1]), + r: singleton(match$3[0], match$3[1]) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayAux(arr, off, nl); @@ -806,7 +806,7 @@ function cmpU(s1, s2, kcmp, vcmp) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -848,7 +848,7 @@ function eqU(s1, s2, kcmp, veq) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -878,7 +878,7 @@ function eq(s1, s2, kcmp, veq) { } function get(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -894,7 +894,7 @@ function get(_n, x, cmp) { } function getUndefined(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -910,7 +910,7 @@ function getUndefined(_n, x, cmp) { } function getExn(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -922,15 +922,15 @@ function getExn(_n, x, cmp) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -946,7 +946,7 @@ function getWithDefault(_n, x, def, cmp) { } function has(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -1083,7 +1083,7 @@ function fromArray(xs, cmp) { next = -next | 0; result = fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = updateMutate(result, match[0], match[1], cmp); } diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index 7842375964..94e0ac4419 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -4,7 +4,7 @@ import * as Belt_Array from "./belt_Array.js"; import * as Caml_option from "./caml_option.js"; function copyAuxCont(_c, _prec) { - while(true) { + while (true) { let prec = _prec; let c = _c; if (c === undefined) { @@ -38,7 +38,7 @@ function copyBucket(c) { function copyBuckets(buckets) { let len = buckets.length; let newBuckets = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { newBuckets[i] = copyBucket(buckets[i]); } return newBuckets; @@ -54,7 +54,7 @@ function copy(x) { } function bucketLength(_accu, _buckets) { - while(true) { + while (true) { let buckets = _buckets; let accu = _accu; if (buckets === undefined) { @@ -67,7 +67,7 @@ function bucketLength(_accu, _buckets) { } function do_bucket_iter(f, _buckets) { - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -80,7 +80,7 @@ function do_bucket_iter(f, _buckets) { function forEachU(h, f) { let d = h.buckets; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { do_bucket_iter(f, d[i]); } } @@ -92,7 +92,7 @@ function forEach(h, f) { } function do_bucket_fold(f, _b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (b === undefined) { @@ -107,7 +107,7 @@ function do_bucket_fold(f, _b, _accu) { function reduceU(h, init, f) { let d = h.buckets; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = do_bucket_fold(f, d[i], accu); } return accu; @@ -152,7 +152,7 @@ function logStats(h) { } function filterMapInplaceBucket(f, h, i, _prec, _cell) { - while(true) { + while (true) { let cell = _cell; let prec = _prec; let n = cell.next; @@ -188,7 +188,7 @@ function filterMapInplaceBucket(f, h, i, _prec, _cell) { function keepMapInPlaceU(h, f) { let h_buckets = h.buckets; - for(let i = 0 ,i_finish = h_buckets.length; i < i_finish; ++i){ + for (let i = 0, i_finish = h_buckets.length; i < i_finish; ++i) { let v = h_buckets[i]; if (v !== undefined) { filterMapInplaceBucket(f, h, i, undefined, v); @@ -204,7 +204,7 @@ function keepMapInPlace(h, f) { } function fillArray(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = [ @@ -222,7 +222,7 @@ function fillArray(_i, arr, _cell) { } function fillArrayMap(_i, arr, _cell, f) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = f(cell); @@ -240,7 +240,7 @@ function linear(h, f) { let d = h.buckets; let current = 0; let arr = new Array(h.size); - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { let cell = d[i]; if (cell !== undefined) { current = fillArrayMap(current, arr, cell, f); diff --git a/lib/es6/belt_internalBucketsType.js b/lib/es6/belt_internalBucketsType.js index 39d523f98a..d2101f53bf 100644 --- a/lib/es6/belt_internalBucketsType.js +++ b/lib/es6/belt_internalBucketsType.js @@ -2,7 +2,7 @@ function power_2_above(_x, n) { - while(true) { + while (true) { let x = _x; if (x >= n) { return x; @@ -29,7 +29,7 @@ function clear(h) { h.size = 0; let h_buckets = h.buckets; let len = h_buckets.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { h_buckets[i] = undefined; } } diff --git a/lib/es6/belt_internalMapInt.js b/lib/es6/belt_internalMapInt.js index 845b33e8f4..ca244dd3dd 100644 --- a/lib/es6/belt_internalMapInt.js +++ b/lib/es6/belt_internalMapInt.js @@ -22,7 +22,7 @@ function add(t, x, data) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -37,7 +37,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -52,7 +52,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -63,15 +63,15 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -86,7 +86,7 @@ function getWithDefault(_n, x, def) { } function has(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -215,7 +215,7 @@ function merge(s1, s2, f) { } function compareAux(_e1, _e2, vcmp) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -259,7 +259,7 @@ function cmp(s1, s2, f) { } function eqAux(_e1, _e2, eq) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -331,7 +331,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLtree.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = addMutate(result, match[0], match[1]); } diff --git a/lib/es6/belt_internalMapString.js b/lib/es6/belt_internalMapString.js index d264f68795..4f84afba47 100644 --- a/lib/es6/belt_internalMapString.js +++ b/lib/es6/belt_internalMapString.js @@ -22,7 +22,7 @@ function add(t, x, data) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -37,7 +37,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -52,7 +52,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -63,15 +63,15 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -86,7 +86,7 @@ function getWithDefault(_n, x, def) { } function has(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -215,7 +215,7 @@ function merge(s1, s2, f) { } function compareAux(_e1, _e2, vcmp) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -259,7 +259,7 @@ function cmp(s1, s2, f) { } function eqAux(_e1, _e2, eq) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -331,7 +331,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLtree.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = addMutate(result, match[0], match[1]); } diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index e4b289dd09..167dc5d38f 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -3,7 +3,7 @@ import * as Belt_Array from "./belt_Array.js"; function copyAuxCont(_c, _prec) { - while(true) { + while (true) { let prec = _prec; let c = _c; if (c === undefined) { @@ -35,7 +35,7 @@ function copyBucket(c) { function copyBuckets(buckets) { let len = buckets.length; let newBuckets = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { newBuckets[i] = copyBucket(buckets[i]); } return newBuckets; @@ -51,7 +51,7 @@ function copy(x) { } function bucketLength(_accu, _buckets) { - while(true) { + while (true) { let buckets = _buckets; let accu = _accu; if (buckets === undefined) { @@ -64,7 +64,7 @@ function bucketLength(_accu, _buckets) { } function doBucketIter(f, _buckets) { - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -77,7 +77,7 @@ function doBucketIter(f, _buckets) { function forEachU(h, f) { let d = h.buckets; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { doBucketIter(f, d[i]); } } @@ -89,7 +89,7 @@ function forEach(h, f) { } function fillArray(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = cell.key; @@ -107,7 +107,7 @@ function toArray(h) { let d = h.buckets; let current = 0; let arr = new Array(h.size); - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { let cell = d[i]; if (cell !== undefined) { current = fillArray(current, arr, cell); @@ -118,7 +118,7 @@ function toArray(h) { } function doBucketFold(f, _b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (b === undefined) { @@ -133,7 +133,7 @@ function doBucketFold(f, _b, _accu) { function reduceU(h, init, f) { let d = h.buckets; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = doBucketFold(f, d[i], accu); } return accu; diff --git a/lib/es6/belt_internalSetInt.js b/lib/es6/belt_internalSetInt.js index 94952bb5c6..25243c2d97 100644 --- a/lib/es6/belt_internalSetInt.js +++ b/lib/es6/belt_internalSetInt.js @@ -4,7 +4,7 @@ import * as Belt_SortArrayInt from "./belt_SortArrayInt.js"; import * as Belt_internalAVLset from "./belt_internalAVLset.js"; function has(_t, x) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -19,7 +19,7 @@ function has(_t, x) { } function compareAux(_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -62,7 +62,7 @@ function eq(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -101,7 +101,7 @@ function subset(_s1, _s2) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -116,7 +116,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -131,7 +131,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -142,10 +142,10 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -180,7 +180,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLset.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(result, xs[i]); } return result; diff --git a/lib/es6/belt_internalSetString.js b/lib/es6/belt_internalSetString.js index 120bbcf0bd..cf752d348b 100644 --- a/lib/es6/belt_internalSetString.js +++ b/lib/es6/belt_internalSetString.js @@ -4,7 +4,7 @@ import * as Belt_internalAVLset from "./belt_internalAVLset.js"; import * as Belt_SortArrayString from "./belt_SortArrayString.js"; function has(_t, x) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -19,7 +19,7 @@ function has(_t, x) { } function compareAux(_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -62,7 +62,7 @@ function eq(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -101,7 +101,7 @@ function subset(_s1, _s2) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -116,7 +116,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -131,7 +131,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -142,10 +142,10 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -180,7 +180,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLset.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(result, xs[i]); } return result; diff --git a/lib/es6/buffer.js b/lib/es6/buffer.js index a396c734a2..13da86c768 100644 --- a/lib/es6/buffer.js +++ b/lib/es6/buffer.js @@ -27,11 +27,11 @@ function to_bytes(b) { function sub(b, ofs, len) { if (ofs < 0 || len < 0 || ofs > (b.position - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.sub" + } + }); } return Bytes.sub_string(b.buffer, ofs, len); } @@ -39,11 +39,11 @@ function sub(b, ofs, len) { function blit(src, srcoff, dst, dstoff, len) { if (len < 0 || srcoff < 0 || srcoff > (src.position - len | 0) || dstoff < 0 || dstoff > (dst.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.blit" + } + }); } Bytes.blit(src.buffer, srcoff, dst, dstoff, len); } @@ -51,11 +51,11 @@ function blit(src, srcoff, dst, dstoff, len) { function nth(b, ofs) { if (ofs < 0 || ofs >= b.position) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.nth" + } + }); } return b.buffer[ofs]; } @@ -77,7 +77,7 @@ function reset(b) { function resize(b, more) { let len = b.length; let new_len = len; - while((b.position + more | 0) > new_len) { + while ((b.position + more | 0) > new_len) { new_len = (new_len << 1); }; let new_buffer = Caml_bytes.create(new_len); @@ -99,15 +99,15 @@ function add_utf_8_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 98, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 98, + 18 + ] + } + }); } if (u$1 <= 127) { return add_char(b, u$1); @@ -146,30 +146,30 @@ function add_utf_8_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 127, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 127, + 9 + ] + } + }); } function add_utf_16be_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 132, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 132, + 18 + ] + } + }); } if (u$1 <= 65535) { let pos = b.position; @@ -197,30 +197,30 @@ function add_utf_16be_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 154, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 154, + 9 + ] + } + }); } function add_utf_16le_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 159, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 159, + 18 + ] + } + }); } if (u$1 <= 65535) { let pos = b.position; @@ -248,25 +248,25 @@ function add_utf_16le_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 181, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 181, + 9 + ] + } + }); } function add_substring(b, s, offset, len) { if (offset < 0 || len < 0 || offset > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.add_substring/add_subbytes" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.add_substring/add_subbytes" + } + }); } let new_position = b.position + len | 0; if (new_position > b.length) { @@ -306,30 +306,30 @@ function closing(param) { return /* '}' */125; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 216, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 216, + 9 + ] + } + }); } function advance_to_closing(opening, closing, k, s, start) { let _k = k; let _i = start; let lim = s.length; - while(true) { + while (true) { let i = _i; let k$1 = _k; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (Caml_string.get(s, i) === opening) { _i = i + 1 | 0; @@ -352,7 +352,7 @@ function advance_to_closing(opening, closing, k, s, start) { function advance_to_non_alpha(s, start) { let _i = start; let lim = s.length; - while(true) { + while (true) { let i = _i; if (i >= lim) { return lim; @@ -384,10 +384,10 @@ function advance_to_non_alpha(s, start) { function find_ident(s, start, lim) { if (start >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml_string.get(s, start); if (c !== 40 && c !== 123) { @@ -409,7 +409,7 @@ function add_substitute(b, f, s) { let lim = s.length; let _previous = /* ' ' */32; let _i = 0; - while(true) { + while (true) { let i = _i; let previous = _previous; if (i >= lim) { @@ -456,11 +456,11 @@ function add_substitute(b, f, s) { function truncate(b, len) { if (len < 0 || len > b.position) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.truncate" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.truncate" + } + }); } b.position = len; } diff --git a/lib/es6/bytes.js b/lib/es6/bytes.js index 39bf696da3..ef34d50b27 100644 --- a/lib/es6/bytes.js +++ b/lib/es6/bytes.js @@ -9,7 +9,7 @@ function unsafe_fill(s, i, l, c) { if (l <= 0) { return; } - for(let k = i ,k_finish = l + i | 0; k < k_finish; ++k){ + for (let k = i, k_finish = l + i | 0; k < k_finish; ++k) { s[k] = c; } } @@ -23,7 +23,7 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a = (s1.length - i2 | 0) - 1 | 0; let range_b = len - 1 | 0; let range = range_a > range_b ? range_b : range_a; - for(let j = range; j >= 0; --j){ + for (let j = range; j >= 0; --j) { s1[i2 + j | 0] = s1[i1 + j | 0]; } return; @@ -34,22 +34,22 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a$1 = (s1.length - i1 | 0) - 1 | 0; let range_b$1 = len - 1 | 0; let range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(let k = 0; k <= range$1; ++k){ + for (let k = 0; k <= range$1; ++k) { s1[i2 + k | 0] = s1[i1 + k | 0]; } return; } let off1 = s1.length - i1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[i2 + i | 0] = s1[i1 + i | 0]; } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[i2 + i$2 | 0] = /* '\000' */0; } } @@ -62,7 +62,7 @@ function make(n, c) { function init(n, f) { let s = Caml_bytes.create(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { s[i] = f(i); } return s; @@ -86,10 +86,10 @@ function to_string(a) { return String.fromCharCode.apply(null, a); } let offset = 0; - while(s_len > 0) { + while (s_len > 0) { let next = s_len < 1024 ? s_len : 1024; let tmp_bytes = new Array(next); - for(let k = 0; k < next; ++k){ + for (let k = 0; k < next; ++k) { tmp_bytes[k] = a[k + offset | 0]; } s = s + String.fromCharCode.apply(null, tmp_bytes); @@ -102,7 +102,7 @@ function to_string(a) { function of_string(s) { let len = s.length; let res = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { res[i] = s.codePointAt(i); } return res; @@ -111,11 +111,11 @@ function of_string(s) { function sub(s, ofs, len) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.sub / Bytes.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.sub / Bytes.sub" + } + }); } let r = Caml_bytes.create(len); unsafe_blit(s, ofs, r, 0, len); @@ -139,22 +139,22 @@ function $plus$plus(a, b) { return c; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } if (match$1) { return c; } if (match$2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } return c; } @@ -181,11 +181,11 @@ function extend(s, left, right) { function fill(s, ofs, len, c) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.fill / Bytes.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.fill / Bytes.fill" + } + }); } unsafe_fill(s, ofs, len, c); } @@ -193,11 +193,11 @@ function fill(s, ofs, len, c) { function blit(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.blit" + } + }); } unsafe_blit(s1, ofs1, s2, ofs2, len); } @@ -205,38 +205,38 @@ function blit(s1, ofs1, s2, ofs2, len) { function blit_string(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.blit / Bytes.blit_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.blit / Bytes.blit_string" + } + }); } if (len <= 0) { return; } let off1 = s1.length - ofs1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[ofs2 + i | 0] = s1.codePointAt(ofs1 + i | 0); } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[ofs2 + i$1 | 0] = s1.codePointAt(ofs1 + i$1 | 0); } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[ofs2 + i$2 | 0] = /* '\000' */0; } } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -246,15 +246,15 @@ function ensure_ge(x, y) { return x; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.concat" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.concat" + } + }); } function sum_lengths(_acc, seplen, _param) { - while(true) { + while (true) { let param = _param; let acc = _acc; if (!param) { @@ -279,7 +279,7 @@ function concat(sep, param) { let dst = Caml_bytes.create(sum_lengths(0, seplen, param)); let _pos = 0; let _param = param; - while(true) { + while (true) { let param$1 = _param; let pos = _pos; if (!param$1) { @@ -319,11 +319,11 @@ function is_space(param) { function trim(s) { let len = s.length; let i = 0; - while(i < len && is_space(s[i])) { + while (i < len && is_space(s[i])) { i = i + 1 | 0; }; let j = len - 1 | 0; - while(j >= i && is_space(s[j])) { + while (j >= i && is_space(s[j])) { j = j - 1 | 0; }; if (j >= i) { @@ -335,7 +335,7 @@ function trim(s) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -358,7 +358,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -382,20 +382,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -406,32 +406,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } @@ -444,7 +442,7 @@ function map(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(s[i]); } return r; @@ -456,7 +454,7 @@ function mapi(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, s[i]); } return r; @@ -488,14 +486,14 @@ function uncapitalize_ascii(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -510,7 +508,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -531,11 +529,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -544,24 +542,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -578,17 +576,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -608,11 +606,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -621,24 +619,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -649,24 +646,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/es6/bytesLabels.js b/lib/es6/bytesLabels.js index 39bf696da3..ef34d50b27 100644 --- a/lib/es6/bytesLabels.js +++ b/lib/es6/bytesLabels.js @@ -9,7 +9,7 @@ function unsafe_fill(s, i, l, c) { if (l <= 0) { return; } - for(let k = i ,k_finish = l + i | 0; k < k_finish; ++k){ + for (let k = i, k_finish = l + i | 0; k < k_finish; ++k) { s[k] = c; } } @@ -23,7 +23,7 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a = (s1.length - i2 | 0) - 1 | 0; let range_b = len - 1 | 0; let range = range_a > range_b ? range_b : range_a; - for(let j = range; j >= 0; --j){ + for (let j = range; j >= 0; --j) { s1[i2 + j | 0] = s1[i1 + j | 0]; } return; @@ -34,22 +34,22 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a$1 = (s1.length - i1 | 0) - 1 | 0; let range_b$1 = len - 1 | 0; let range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(let k = 0; k <= range$1; ++k){ + for (let k = 0; k <= range$1; ++k) { s1[i2 + k | 0] = s1[i1 + k | 0]; } return; } let off1 = s1.length - i1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[i2 + i | 0] = s1[i1 + i | 0]; } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[i2 + i$2 | 0] = /* '\000' */0; } } @@ -62,7 +62,7 @@ function make(n, c) { function init(n, f) { let s = Caml_bytes.create(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { s[i] = f(i); } return s; @@ -86,10 +86,10 @@ function to_string(a) { return String.fromCharCode.apply(null, a); } let offset = 0; - while(s_len > 0) { + while (s_len > 0) { let next = s_len < 1024 ? s_len : 1024; let tmp_bytes = new Array(next); - for(let k = 0; k < next; ++k){ + for (let k = 0; k < next; ++k) { tmp_bytes[k] = a[k + offset | 0]; } s = s + String.fromCharCode.apply(null, tmp_bytes); @@ -102,7 +102,7 @@ function to_string(a) { function of_string(s) { let len = s.length; let res = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { res[i] = s.codePointAt(i); } return res; @@ -111,11 +111,11 @@ function of_string(s) { function sub(s, ofs, len) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.sub / Bytes.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.sub / Bytes.sub" + } + }); } let r = Caml_bytes.create(len); unsafe_blit(s, ofs, r, 0, len); @@ -139,22 +139,22 @@ function $plus$plus(a, b) { return c; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } if (match$1) { return c; } if (match$2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } return c; } @@ -181,11 +181,11 @@ function extend(s, left, right) { function fill(s, ofs, len, c) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.fill / Bytes.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.fill / Bytes.fill" + } + }); } unsafe_fill(s, ofs, len, c); } @@ -193,11 +193,11 @@ function fill(s, ofs, len, c) { function blit(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.blit" + } + }); } unsafe_blit(s1, ofs1, s2, ofs2, len); } @@ -205,38 +205,38 @@ function blit(s1, ofs1, s2, ofs2, len) { function blit_string(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.blit / Bytes.blit_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.blit / Bytes.blit_string" + } + }); } if (len <= 0) { return; } let off1 = s1.length - ofs1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[ofs2 + i | 0] = s1.codePointAt(ofs1 + i | 0); } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[ofs2 + i$1 | 0] = s1.codePointAt(ofs1 + i$1 | 0); } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[ofs2 + i$2 | 0] = /* '\000' */0; } } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -246,15 +246,15 @@ function ensure_ge(x, y) { return x; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.concat" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.concat" + } + }); } function sum_lengths(_acc, seplen, _param) { - while(true) { + while (true) { let param = _param; let acc = _acc; if (!param) { @@ -279,7 +279,7 @@ function concat(sep, param) { let dst = Caml_bytes.create(sum_lengths(0, seplen, param)); let _pos = 0; let _param = param; - while(true) { + while (true) { let param$1 = _param; let pos = _pos; if (!param$1) { @@ -319,11 +319,11 @@ function is_space(param) { function trim(s) { let len = s.length; let i = 0; - while(i < len && is_space(s[i])) { + while (i < len && is_space(s[i])) { i = i + 1 | 0; }; let j = len - 1 | 0; - while(j >= i && is_space(s[j])) { + while (j >= i && is_space(s[j])) { j = j - 1 | 0; }; if (j >= i) { @@ -335,7 +335,7 @@ function trim(s) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -358,7 +358,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -382,20 +382,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -406,32 +406,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } @@ -444,7 +442,7 @@ function map(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(s[i]); } return r; @@ -456,7 +454,7 @@ function mapi(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, s[i]); } return r; @@ -488,14 +486,14 @@ function uncapitalize_ascii(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -510,7 +508,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -531,11 +529,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -544,24 +542,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -578,17 +576,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -608,11 +606,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -621,24 +619,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -649,24 +646,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/es6/caml_array.js b/lib/es6/caml_array.js index 80fad5d5c2..692a92b75e 100644 --- a/lib/es6/caml_array.js +++ b/lib/es6/caml_array.js @@ -5,7 +5,7 @@ function sub(x, offset, len) { let result = new Array(len); let j = 0; let i = offset; - while(j < len) { + while (j < len) { result[j] = x[i]; j = j + 1 | 0; i = i + 1 | 0; @@ -14,7 +14,7 @@ function sub(x, offset, len) { } function len(_acc, _l) { - while(true) { + while (true) { let l = _l; let acc = _acc; if (!l) { @@ -27,7 +27,7 @@ function len(_acc, _l) { } function fill(arr, _i, _l) { - while(true) { + while (true) { let l = _l; let i = _i; if (!l) { @@ -37,7 +37,7 @@ function fill(arr, _i, _l) { let l$1 = x.length; let k = i; let j = 0; - while(j < l$1) { + while (j < l$1) { arr[k] = x[j]; k = k + 1 | 0; j = j + 1 | 0; @@ -58,11 +58,11 @@ function concat(l) { function set(xs, index, newval) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } xs[index] = newval; } @@ -70,18 +70,18 @@ function set(xs, index, newval) { function get(xs, index) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return xs[index]; } function make(len, init) { let b = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { b[i] = init; } return b; @@ -89,7 +89,7 @@ function make(len, init) { function make_float(len) { let b = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { b[i] = 0; } return b; @@ -97,12 +97,12 @@ function make_float(len) { function blit(a1, i1, a2, i2, len) { if (i2 <= i1) { - for(let j = 0; j < len; ++j){ + for (let j = 0; j < len; ++j) { a2[j + i2 | 0] = a1[j + i1 | 0]; } return; } - for(let j$1 = len - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = len - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + i2 | 0] = a1[j$1 + i1 | 0]; } } diff --git a/lib/es6/caml_bigint.js b/lib/es6/caml_bigint.js index 82eb6a5c15..bdac616c54 100644 --- a/lib/es6/caml_bigint.js +++ b/lib/es6/caml_bigint.js @@ -4,10 +4,10 @@ function div(x, y) { if (y === 0n) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x / y; } @@ -15,10 +15,10 @@ function div(x, y) { function mod_(x, y) { if (y === 0n) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x % y; } diff --git a/lib/es6/caml_bytes.js b/lib/es6/caml_bytes.js index 423dc9b0e8..72ae5a5032 100644 --- a/lib/es6/caml_bytes.js +++ b/lib/es6/caml_bytes.js @@ -4,11 +4,11 @@ function set(s, i, ch) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } s[i] = ch; } @@ -16,11 +16,11 @@ function set(s, i, ch) { function get(s, i) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return s[i]; } @@ -28,21 +28,21 @@ function get(s, i) { function create(len) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.create" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.create" + } + }); } let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = /* '\000' */0; } return result; } function bytes_compare_aux(s1, s2, _off, len, def) { - while(true) { + while (true) { let off = _off; if (off >= len) { return def; @@ -77,7 +77,7 @@ function bytes_equal(s1, s2) { let len2 = s2.length; if (len1 === len2) { let _off = 0; - while(true) { + while (true) { let off = _off; if (off === len1) { return true; diff --git a/lib/es6/caml_format.js b/lib/es6/caml_format.js index 5cdc04e050..debf240abf 100644 --- a/lib/es6/caml_format.js +++ b/lib/es6/caml_format.js @@ -26,14 +26,13 @@ function parse_digit(c) { function int_of_string_base(x) { switch (x) { case "Oct" : - return 8; + return 8; case "Hex" : - return 16; + return 16; case "Dec" : - return 10; + return 10; case "Bin" : - return 2; - + return 2; } } @@ -44,14 +43,12 @@ function parse_sign_and_base(s) { let match = s.codePointAt(i); switch (match) { case 43 : - i = i + 1 | 0; - break; + i = i + 1 | 0; + break; case 45 : - sign = -1; - i = i + 1 | 0; - break; - default: - + sign = -1; + i = i + 1 | 0; + break; } if (s.codePointAt(i) === /* '0' */48) { let match$1 = s.codePointAt(i + 1 | 0); @@ -60,12 +57,12 @@ function parse_sign_and_base(s) { if (match$1 < 121) { switch (match$1) { case 111 : - base = "Oct"; - i = i + 2 | 0; - break; + base = "Oct"; + i = i + 2 | 0; + break; case 117 : - i = i + 2 | 0; - break; + i = i + 2 | 0; + break; case 112 : case 113 : case 114 : @@ -73,12 +70,11 @@ function parse_sign_and_base(s) { case 116 : case 118 : case 119 : - break; + break; case 120 : - base = "Hex"; - i = i + 2 | 0; - break; - + base = "Hex"; + i = i + 2 | 0; + break; } } @@ -91,12 +87,12 @@ function parse_sign_and_base(s) { if (match$1 >= 79) { switch (match$1) { case 79 : - base = "Oct"; - i = i + 2 | 0; - break; + base = "Oct"; + i = i + 2 | 0; + break; case 85 : - i = i + 2 | 0; - break; + i = i + 2 | 0; + break; case 80 : case 81 : case 82 : @@ -104,12 +100,11 @@ function parse_sign_and_base(s) { case 84 : case 86 : case 87 : - break; + break; case 88 : - base = "Hex"; - i = i + 2 | 0; - break; - + base = "Hex"; + i = i + 2 | 0; + break; } } @@ -135,14 +130,14 @@ function int_of_string(s) { let d = parse_digit(c); if (d < 0 || d >= base) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } let aux = function (_acc, _k) { - while(true) { + while (true) { let k = _k; let acc = _acc; if (k === len) { @@ -156,20 +151,20 @@ function int_of_string(s) { let v = parse_digit(a); if (v < 0 || v >= base) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } let acc$1 = base * acc + v; if (acc$1 > threshold) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } _k = k + 1 | 0; _acc = acc$1; @@ -180,11 +175,11 @@ function int_of_string(s) { let or_res = res | 0; if (base === 10 && res !== or_res) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } return or_res; } @@ -198,41 +193,40 @@ function int64_of_string(s) { let threshold; switch (hbase) { case "Oct" : - threshold = [ - 536870911, - 4294967295 - ]; - break; + threshold = [ + 536870911, + 4294967295 + ]; + break; case "Hex" : - threshold = [ - 268435455, - 4294967295 - ]; - break; + threshold = [ + 268435455, + 4294967295 + ]; + break; case "Dec" : - threshold = [ - 429496729, - 2576980377 - ]; - break; + threshold = [ + 429496729, + 2576980377 + ]; + break; case "Bin" : - threshold = Caml_int64.max_int; - break; - + threshold = Caml_int64.max_int; + break; } let len = s.length; let c = i < len ? s.codePointAt(i) : /* '\000' */0; let d = Caml_int64.of_int32(parse_digit(c)); if (Caml.i64_lt(d, Caml_int64.zero) || Caml.i64_ge(d, base)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } let aux = function (_acc, _k) { - while(true) { + while (true) { let k = _k; let acc = _acc; if (k === len) { @@ -246,11 +240,11 @@ function int64_of_string(s) { let v = Caml_int64.of_int32(parse_digit(a)); if (Caml.i64_lt(v, Caml_int64.zero) || Caml.i64_ge(v, base) || Caml.i64_gt(acc, threshold)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } let acc$1 = Caml_int64.add(Caml_int64.mul(base, acc), v); _k = k + 1 | 0; @@ -265,11 +259,11 @@ function int64_of_string(s) { 10 ]) && Caml.i64_neq(res, or_res)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } return or_res; } @@ -277,12 +271,11 @@ function int64_of_string(s) { function int_of_base(x) { switch (x) { case "Oct" : - return 8; + return 8; case "Hex" : - return 16; + return 16; case "Dec" : - return 10; - + return 10; } } @@ -298,11 +291,11 @@ function parse_format(fmt) { let len = fmt.length; if (len > 31) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "format_int: format too long" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "format_int: format too long" + } + }); } let f = { justify: "+", @@ -318,7 +311,7 @@ function parse_format(fmt) { conv: "f" }; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= len) { return f; @@ -332,27 +325,27 @@ function parse_format(fmt) { } else { switch (c) { case 88 : - f.base = "Hex"; - f.uppercase = true; - _i = i + 1 | 0; - continue; + f.base = "Hex"; + f.uppercase = true; + _i = i + 1 | 0; + continue; case 101 : case 102 : case 103 : - exit = 5; - break; + exit = 5; + break; case 100 : case 105 : - exit = 4; - break; + exit = 4; + break; case 111 : - f.base = "Oct"; - _i = i + 1 | 0; - continue; + f.base = "Oct"; + _i = i + 1 | 0; + continue; case 117 : - f.base = "Dec"; - _i = i + 1 | 0; - continue; + f.base = "Dec"; + _i = i + 1 | 0; + continue; case 89 : case 90 : case 91 : @@ -377,13 +370,12 @@ function parse_format(fmt) { case 116 : case 118 : case 119 : - exit = 1; - break; + exit = 1; + break; case 120 : - f.base = "Hex"; - _i = i + 1 | 0; - continue; - + f.base = "Hex"; + _i = i + 1 | 0; + continue; } } } else if (c >= 72) { @@ -398,33 +390,33 @@ function parse_format(fmt) { } else { switch (c) { case 35 : - f.alternate = true; - _i = i + 1 | 0; - continue; + f.alternate = true; + _i = i + 1 | 0; + continue; case 32 : case 43 : - exit = 2; - break; + exit = 2; + break; case 45 : - f.justify = "-"; - _i = i + 1 | 0; - continue; + f.justify = "-"; + _i = i + 1 | 0; + continue; case 46 : - f.prec = 0; - let j = i + 1 | 0; - while((function () { - let w = fmt.codePointAt(j) - 48 | 0; - return w >= 0 && w <= 9; - })()) { - f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; - j = j + 1 | 0; - }; - _i = j; - continue; + f.prec = 0; + let j = i + 1 | 0; + while ((function () { + let w = fmt.codePointAt(j) - 48 | 0; + return w >= 0 && w <= 9; + })()) { + f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; + j = j + 1 | 0; + }; + _i = j; + continue; case 48 : - f.filter = "0"; - _i = i + 1 | 0; - continue; + f.filter = "0"; + _i = i + 1 | 0; + continue; case 49 : case 50 : case 51 : @@ -434,43 +426,42 @@ function parse_format(fmt) { case 55 : case 56 : case 57 : - exit = 3; - break; + exit = 3; + break; default: exit = 1; } } switch (exit) { case 1 : - _i = i + 1 | 0; - continue; + _i = i + 1 | 0; + continue; case 2 : - f.signstyle = String.fromCharCode(c); - _i = i + 1 | 0; - continue; + f.signstyle = String.fromCharCode(c); + _i = i + 1 | 0; + continue; case 3 : - f.width = 0; - let j$1 = i; - while((function () { - let w = fmt.codePointAt(j$1) - 48 | 0; - return w >= 0 && w <= 9; - })()) { - f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; - j$1 = j$1 + 1 | 0; - }; - _i = j$1; - continue; + f.width = 0; + let j$1 = i; + while ((function () { + let w = fmt.codePointAt(j$1) - 48 | 0; + return w >= 0 && w <= 9; + })()) { + f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; + j$1 = j$1 + 1 | 0; + }; + _i = j$1; + continue; case 4 : - f.signedconv = true; - f.base = "Dec"; - _i = i + 1 | 0; - continue; + f.signedconv = true; + f.base = "Dec"; + _i = i + 1 | 0; + continue; case 5 : - f.signedconv = true; - f.conv = String.fromCharCode(c); - _i = i + 1 | 0; - continue; - + f.signedconv = true; + f.conv = String.fromCharCode(c); + _i = i + 1 | 0; + continue; } }; } @@ -499,7 +490,7 @@ function finish_formatting(config, rawbuffer) { } let buffer = ""; if (justify === "+" && filter === " ") { - for(let _for = len; _for < width; ++_for){ + for (let _for = len; _for < width; ++_for) { buffer = buffer + filter; } } @@ -518,13 +509,13 @@ function finish_formatting(config, rawbuffer) { buffer = buffer + "0x"; } if (justify === "+" && filter === "0") { - for(let _for$1 = len; _for$1 < width; ++_for$1){ + for (let _for$1 = len; _for$1 < width; ++_for$1) { buffer = buffer + filter; } } buffer = uppercase ? buffer + rawbuffer.toUpperCase() : buffer + rawbuffer; if (justify === "-") { - for(let _for$2 = len; _for$2 < width; ++_for$2){ + for (let _for$2 = len; _for$2 < width; ++_for$2) { buffer = buffer + " "; } } @@ -588,7 +579,7 @@ function oct_of_int64(x) { ], match[0]); let modulus = match[1]; s = cvtbl[Caml_int64.to_int32(modulus)] + s; - while(Caml.i64_neq(quotient, Caml_int64.zero)) { + while (Caml.i64_neq(quotient, Caml_int64.zero)) { let match$1 = Caml_int64.div_mod(quotient, wbase); quotient = match$1[0]; modulus = match$1[1]; @@ -599,7 +590,7 @@ function oct_of_int64(x) { let quotient$1 = match$2[0]; let modulus$1 = match$2[1]; s = cvtbl[Caml_int64.to_int32(modulus$1)] + s; - while(Caml.i64_neq(quotient$1, Caml_int64.zero)) { + while (Caml.i64_neq(quotient$1, Caml_int64.zero)) { let match$3 = Caml_int64.div_mod(quotient$1, wbase); quotient$1 = match$3[0]; modulus$1 = match$3[1]; @@ -619,15 +610,14 @@ function int64_format(fmt, x) { let s; switch (match) { case "Oct" : - s = oct_of_int64(x$1); - break; + s = oct_of_int64(x$1); + break; case "Hex" : - s = Caml_int64.to_hex(x$1); - break; + s = Caml_int64.to_hex(x$1); + break; case "Dec" : - s = dec_of_pos_int64(x$1); - break; - + s = dec_of_pos_int64(x$1); + break; } let fill_s; if (f.prec >= 0) { @@ -652,62 +642,60 @@ function format_float(fmt, x) { let match = f.conv; switch (match) { case "e" : - s = x$1.toExponential(prec); - let i = s.length; - if (s.codePointAt(i - 3 | 0) === /* 'e' */101) { - s = s.slice(0, i - 1 | 0) + ("0" + s.slice(i - 1 | 0)); - } - break; + s = x$1.toExponential(prec); + let i = s.length; + if (s.codePointAt(i - 3 | 0) === /* 'e' */101) { + s = s.slice(0, i - 1 | 0) + ("0" + s.slice(i - 1 | 0)); + } + break; case "f" : - s = x$1.toFixed(prec); - break; + s = x$1.toFixed(prec); + break; case "g" : - let prec$1 = prec !== 0 ? prec : 1; - s = x$1.toExponential(prec$1 - 1 | 0); - let j = s.indexOf("e"); - let exp = Number(s.slice(j + 1 | 0)) | 0; - if (exp < -4 || x$1 >= 1e21 || x$1.toFixed().length > prec$1) { - let i$1 = j - 1 | 0; - while(s.codePointAt(i$1) === /* '0' */48) { - i$1 = i$1 - 1 | 0; - }; - if (s.codePointAt(i$1) === /* '.' */46) { - i$1 = i$1 - 1 | 0; - } - s = s.slice(0, i$1 + 1 | 0) + s.slice(j); - let i$2 = s.length; - if (s.codePointAt(i$2 - 3 | 0) === /* 'e' */101) { - s = s.slice(0, i$2 - 1 | 0) + ("0" + s.slice(i$2 - 1 | 0)); - } - + let prec$1 = prec !== 0 ? prec : 1; + s = x$1.toExponential(prec$1 - 1 | 0); + let j = s.indexOf("e"); + let exp = Number(s.slice(j + 1 | 0)) | 0; + if (exp < -4 || x$1 >= 1e21 || x$1.toFixed().length > prec$1) { + let i$1 = j - 1 | 0; + while (s.codePointAt(i$1) === /* '0' */48) { + i$1 = i$1 - 1 | 0; + }; + if (s.codePointAt(i$1) === /* '.' */46) { + i$1 = i$1 - 1 | 0; + } + s = s.slice(0, i$1 + 1 | 0) + s.slice(j); + let i$2 = s.length; + if (s.codePointAt(i$2 - 3 | 0) === /* 'e' */101) { + s = s.slice(0, i$2 - 1 | 0) + ("0" + s.slice(i$2 - 1 | 0)); + } + + } else { + let p = prec$1; + if (exp < 0) { + p = p - (exp + 1 | 0) | 0; + s = x$1.toFixed(p); } else { - let p = prec$1; - if (exp < 0) { - p = p - (exp + 1 | 0) | 0; - s = x$1.toFixed(p); - } else { - while((function () { - s = x$1.toFixed(p); - return s.length > (prec$1 + 1 | 0); - })()) { - p = p - 1 | 0; - }; - } - if (p !== 0) { - let k = s.length - 1 | 0; - while(s.codePointAt(k) === /* '0' */48) { - k = k - 1 | 0; - }; - if (s.codePointAt(k) === /* '.' */46) { - k = k - 1 | 0; - } - s = s.slice(0, k + 1 | 0); + while ((function () { + s = x$1.toFixed(p); + return s.length > (prec$1 + 1 | 0); + })()) { + p = p - 1 | 0; + }; + } + if (p !== 0) { + let k = s.length - 1 | 0; + while (s.codePointAt(k) === /* '0' */48) { + k = k - 1 | 0; + }; + if (s.codePointAt(k) === /* '.' */46) { + k = k - 1 | 0; } - + s = s.slice(0, k + 1 | 0); } - break; - default: - + + } + break; } } else { s = "inf"; diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index 41be4c6ac6..054d821630 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -52,7 +52,7 @@ function hash(count, _limit, seed, obj) { let num = count; push_back(queue, obj); num = num - 1 | 0; - while(queue.length !== 0 && num > 0) { + while (queue.length !== 0 && num > 0) { let obj$1 = unsafe_pop(queue); if (typeof obj$1 === "number") { let u$1 = obj$1 | 0; @@ -72,7 +72,7 @@ function hash(count, _limit, seed, obj) { s = Caml_hash_primitive.hash_mix_int(s, tag); let v = size - 1 | 0; let block = v < num ? v : num; - for(let i = 0; i <= block; ++i){ + for (let i = 0; i <= block; ++i) { push_back(queue, obj$1[i]); } } diff --git a/lib/es6/caml_hash_primitive.js b/lib/es6/caml_hash_primitive.js index 2407c206c0..bd5d59943e 100644 --- a/lib/es6/caml_hash_primitive.js +++ b/lib/es6/caml_hash_primitive.js @@ -27,7 +27,7 @@ function hash_mix_string(h, s) { let len = s.length; let block = (len / 4 | 0) - 1 | 0; let hash = h; - for(let i = 0; i <= block; ++i){ + for (let i = 0; i <= block; ++i) { let j = (i << 2); let w = s.charCodeAt(j) | (s.charCodeAt(j + 1 | 0) << 8) | (s.charCodeAt(j + 2 | 0) << 16) | (s.charCodeAt(j + 3 | 0) << 24); hash = hash_mix_int(hash, w); diff --git a/lib/es6/caml_int32.js b/lib/es6/caml_int32.js index d1e7064277..b5cd97b472 100644 --- a/lib/es6/caml_int32.js +++ b/lib/es6/caml_int32.js @@ -4,10 +4,10 @@ function div(x, y) { if (y === 0) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x / y | 0; } @@ -15,10 +15,10 @@ function div(x, y) { function mod_(x, y) { if (y === 0) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x % y; } diff --git a/lib/es6/caml_int64.js b/lib/es6/caml_int64.js index be9d57507b..14bae1175a 100644 --- a/lib/es6/caml_int64.js +++ b/lib/es6/caml_int64.js @@ -191,7 +191,7 @@ function is_zero(x) { } function mul(_this, _other) { - while(true) { + while (true) { let other = _other; let $$this = _this; let lo; @@ -374,7 +374,7 @@ function to_string(self) { } function div(_self, _other) { - while(true) { + while (true) { let other = _other; let self = _self; let self_hi = self[0]; @@ -384,10 +384,10 @@ function div(_self, _other) { exit$1 = 2; } else { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } if (exit$1 === 2) { if (self_hi !== -2147483648) { @@ -455,14 +455,14 @@ function div(_self, _other) { } let res = zero; let rem$1 = self; - while(Caml.i64_ge(rem$1, other)) { + while (Caml.i64_ge(rem$1, other)) { let b = Math.floor(to_float(rem$1) / to_float(other)); let approx$1 = 1 > b ? 1 : b; let log2 = Math.ceil(Math.log(approx$1) / Math.LN2); let delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); let approxRes = of_float(approx$1); let approxRem = mul(approxRes, other); - while(approxRem[0] < 0 || Caml.i64_gt(approxRem, rem$1)) { + while (approxRem[0] < 0 || Caml.i64_gt(approxRem, rem$1)) { approx$1 = approx$1 - delta; approxRes = of_float(approx$1); approxRem = mul(approxRes, other); diff --git a/lib/es6/caml_md5.js b/lib/es6/caml_md5.js index f25333fb91..8ae9fe01f9 100644 --- a/lib/es6/caml_md5.js +++ b/lib/es6/caml_md5.js @@ -130,30 +130,30 @@ function md5_string(s, start, len) { state[1] = -271733879; state[2] = -1732584194; state[3] = 271733878; - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { md5blk[i] = 0; } let i_end = n / 64 | 0; - for(let i$1 = 1; i$1 <= i_end; ++i$1){ - for(let j = 0; j <= 15; ++j){ + for (let i$1 = 1; i$1 <= i_end; ++i$1) { + for (let j = 0; j <= 15; ++j) { let k = ((i$1 << 6) - 64 | 0) + (j << 2) | 0; md5blk[j] = ((s$1.charCodeAt(k) + (s$1.charCodeAt(k + 1 | 0) << 8) | 0) + (s$1.charCodeAt(k + 2 | 0) << 16) | 0) + (s$1.charCodeAt(k + 3 | 0) << 24) | 0; } cycle(state, md5blk); } let s_tail = s$1.slice((i_end << 6)); - for(let kk = 0; kk <= 15; ++kk){ + for (let kk = 0; kk <= 15; ++kk) { md5blk[kk] = 0; } let i_end$1 = s_tail.length - 1 | 0; - for(let i$2 = 0; i$2 <= i_end$1; ++i$2){ + for (let i$2 = 0; i$2 <= i_end$1; ++i$2) { md5blk[i$2 / 4 | 0] = md5blk[i$2 / 4 | 0] | (s_tail.charCodeAt(i$2) << (i$2 % 4 << 3)); } let i$3 = i_end$1 + 1 | 0; md5blk[i$3 / 4 | 0] = md5blk[i$3 / 4 | 0] | (128 << (i$3 % 4 << 3)); if (i$3 > 55) { cycle(state, md5blk); - for(let i$4 = 0; i$4 <= 15; ++i$4){ + for (let i$4 = 0; i$4 <= 15; ++i$4) { md5blk[i$4] = 0; } } diff --git a/lib/es6/caml_module.js b/lib/es6/caml_module.js index 29fd105708..55a5dc88d5 100644 --- a/lib/es6/caml_module.js +++ b/lib/es6/caml_module.js @@ -5,28 +5,27 @@ import * as Caml_obj from "./caml_obj.js"; function init_mod(loc, shape) { let undef_module = function (param) { throw new Error("Undefined_recursive_module", { - cause: { - RE_EXN_ID: "Undefined_recursive_module", - _1: loc - } - }); + cause: { + RE_EXN_ID: "Undefined_recursive_module", + _1: loc + } + }); }; let loop = function (shape, struct_, idx) { if (typeof shape !== "object") { switch (shape) { case "Function" : case "Lazy" : - struct_[idx] = undef_module; - return; + struct_[idx] = undef_module; + return; case "Class" : - struct_[idx] = [ - undef_module, - undef_module, - undef_module, - 0 - ]; - return; - + struct_[idx] = [ + undef_module, + undef_module, + undef_module, + 0 + ]; + return; } } else { if (shape.TAG === "Module") { @@ -34,7 +33,7 @@ function init_mod(loc, shape) { let v = {}; struct_[idx] = v; let len = comps.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = comps[i]; loop(match[0], v, match[1]); } @@ -55,19 +54,18 @@ function update_mod(shape, o, n) { if (typeof shape !== "object") { switch (shape) { case "Function" : - parent[i] = n; - return; + parent[i] = n; + return; case "Lazy" : case "Class" : - return Caml_obj.update_dummy(o, n); - + return Caml_obj.update_dummy(o, n); } } else { if (shape.TAG !== "Module") { return; } let comps = shape._0; - for(let i$1 = 0 ,i_finish = comps.length; i$1 < i_finish; ++i$1){ + for (let i$1 = 0, i_finish = comps.length; i$1 < i_finish; ++i$1) { let match = comps[i$1]; let name = match[1]; aux(match[0], o[name], n[name], o, name); @@ -77,19 +75,19 @@ function update_mod(shape, o, n) { }; if (typeof shape !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "caml_module.res", - 109, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "caml_module.res", + 109, + 9 + ] + } + }); } if (shape.TAG === "Module") { let comps = shape._0; - for(let i = 0 ,i_finish = comps.length; i < i_finish; ++i){ + for (let i = 0, i_finish = comps.length; i < i_finish; ++i) { let match = comps[i]; let name = match[1]; aux(match[0], o[name], n[name], o, name); @@ -97,15 +95,15 @@ function update_mod(shape, o, n) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "caml_module.res", - 109, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "caml_module.res", + 109, + 9 + ] + } + }); } export { diff --git a/lib/es6/caml_obj.js b/lib/es6/caml_obj.js index ac65acfb10..8fc4b04320 100644 --- a/lib/es6/caml_obj.js +++ b/lib/es6/caml_obj.js @@ -44,46 +44,44 @@ function compare(a, b) { let b_type = typeof b; switch (a_type) { case "bigint" : - if (b_type === "bigint") { - return Caml.float_compare(a, b); - } - break; + if (b_type === "bigint") { + return Caml.float_compare(a, b); + } + break; case "boolean" : - if (b_type === "boolean") { - return Caml.bool_compare(a, b); - } - break; + if (b_type === "boolean") { + return Caml.bool_compare(a, b); + } + break; case "function" : - if (b_type === "function") { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "compare: functional value" - } - }); - } - break; + if (b_type === "function") { + throw new Error("Invalid_argument", { + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "compare: functional value" + } + }); + } + break; case "number" : - if (b_type === "number") { - return Caml.float_compare(a, b); - } - break; + if (b_type === "number") { + return Caml.float_compare(a, b); + } + break; case "string" : - if (b_type === "string") { - return Caml.string_compare(a, b); - } else { - return 1; - } + if (b_type === "string") { + return Caml.string_compare(a, b); + } else { + return 1; + } case "undefined" : - return -1; - default: - + return -1; } switch (b_type) { case "string" : - return -1; + return -1; case "undefined" : - return 1; + return 1; default: if (a_type === "boolean") { return 1; @@ -139,11 +137,11 @@ function compare(a, b) { } if (tag_a === 251) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: abstract value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: abstract value" + } + }); } if (tag_a !== tag_b) { if (tag_a < tag_b) { @@ -157,7 +155,7 @@ function compare(a, b) { if (len_a === len_b) { if (Array.isArray(a)) { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len_a) { return 0; @@ -176,7 +174,7 @@ function compare(a, b) { } } else if (len_a < len_b) { let _i$1 = 0; - while(true) { + while (true) { let i$1 = _i$1; if (i$1 === len_a) { return -1; @@ -190,7 +188,7 @@ function compare(a, b) { }; } else { let _i$2 = 0; - while(true) { + while (true) { let i$2 = _i$2; if (i$2 === len_b) { return 1; @@ -269,11 +267,11 @@ function equal(a, b) { let b_type = typeof b; if (a_type === "function" || b_type === "function") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: functional value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: functional value" + } + }); } if (b_type === "number" || b_type === "bigint" || b_type === "undefined" || b === null) { return false; @@ -285,11 +283,11 @@ function equal(a, b) { } if (tag_a === 251) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: abstract value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: abstract value" + } + }); } if (tag_a !== tag_b) { return false; @@ -299,7 +297,7 @@ function equal(a, b) { if (len_a === len_b) { if (Array.isArray(a)) { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len_a) { return true; diff --git a/lib/es6/caml_string.js b/lib/es6/caml_string.js index 4ed21b8024..8fe93ba893 100644 --- a/lib/es6/caml_string.js +++ b/lib/es6/caml_string.js @@ -4,11 +4,11 @@ function get(s, i) { if (i >= s.length || i < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return s.codePointAt(i); } diff --git a/lib/es6/caml_sys.js b/lib/es6/caml_sys.js index d0a2aa2bea..c1b42a6668 100644 --- a/lib/es6/caml_sys.js +++ b/lib/es6/caml_sys.js @@ -4,20 +4,20 @@ function sys_getenv(s) { if (typeof process === "undefined" || process.env === undefined) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let x = process.env[s]; if (x !== undefined) { return x; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let os_type = (function(_){ @@ -74,20 +74,20 @@ function sys_exit(exit_code) { function sys_is_directory(_s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "sys_is_directory not implemented" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "sys_is_directory not implemented" + } + }); } function sys_file_exists(_s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "sys_file_exists not implemented" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "sys_file_exists not implemented" + } + }); } export { diff --git a/lib/es6/camlinternalLazy.js b/lib/es6/camlinternalLazy.js index cf6061cc29..4e8978398a 100644 --- a/lib/es6/camlinternalLazy.js +++ b/lib/es6/camlinternalLazy.js @@ -17,10 +17,10 @@ function forward_with_closure(blk, closure) { function raise_undefined() { throw new Error(Undefined, { - cause: { - RE_EXN_ID: Undefined - } - }); + cause: { + RE_EXN_ID: Undefined + } + }); } function force(lzv) { @@ -31,16 +31,15 @@ function force(lzv) { lzv.VAL = raise_undefined; try { return forward_with_closure(lzv, closure); - } - catch (e){ + } catch (e) { lzv.VAL = (function () { throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); }); throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } } } diff --git a/lib/es6/char.js b/lib/es6/char.js index 3e41fcddf6..f9da73cd4f 100644 --- a/lib/es6/char.js +++ b/lib/es6/char.js @@ -5,11 +5,11 @@ import * as Bytes from "./bytes.js"; function chr(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Char.chr" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Char.chr" + } + }); } return n; } @@ -31,11 +31,11 @@ function escaped(param) { } else { switch (param) { case 8 : - return "\\b"; + return "\\b"; case 9 : - return "\\t"; + return "\\t"; case 10 : - return "\\n"; + return "\\n"; case 0 : case 1 : case 2 : @@ -46,31 +46,29 @@ function escaped(param) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - return "\\r"; - + return "\\r"; } } switch (exit) { case 1 : - let s = [ - 0, - 0, - 0, - 0 - ]; - s[0] = /* '\\' */92; - s[1] = 48 + (param / 100 | 0) | 0; - s[2] = 48 + (param / 10 | 0) % 10 | 0; - s[3] = 48 + param % 10 | 0; - return Bytes.to_string(s); + let s = [ + 0, + 0, + 0, + 0 + ]; + s[0] = /* '\\' */92; + s[1] = 48 + (param / 100 | 0) | 0; + s[2] = 48 + (param / 10 | 0) % 10 | 0; + s[3] = 48 + param % 10 | 0; + return Bytes.to_string(s); case 2 : - let s$1 = [0]; - s$1[0] = param; - return Bytes.to_string(s$1); - + let s$1 = [0]; + s$1[0] = param; + return Bytes.to_string(s$1); } } diff --git a/lib/es6/curry.js b/lib/es6/curry.js index 6ce524794b..00af2a55d5 100644 --- a/lib/es6/curry.js +++ b/lib/es6/curry.js @@ -3,7 +3,7 @@ import * as Caml_array from "./caml_array.js"; function app(_f, _args) { - while(true) { + while (true) { let args = _args; let f = _f; let init_arity = f.length; @@ -31,31 +31,31 @@ function _1(o, a0) { } else { switch (arity) { case 1 : - return o(a0); + return o(a0); case 2 : - return function (param) { - return o(a0, param); - }; + return function (param) { + return o(a0, param); + }; case 3 : - return function (param, param$1) { - return o(a0, param, param$1); - }; + return function (param, param$1) { + return o(a0, param, param$1); + }; case 4 : - return function (param, param$1, param$2) { - return o(a0, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, param, param$1, param$2); + }; case 5 : - return function (param, param$1, param$2, param$3) { - return o(a0, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, param, param$1, param$2, param$3); + }; case 6 : - return function (param, param$1, param$2, param$3, param$4) { - return o(a0, param, param$1, param$2, param$3, param$4); - }; + return function (param, param$1, param$2, param$3, param$4) { + return o(a0, param, param$1, param$2, param$3, param$4); + }; case 7 : - return function (param, param$1, param$2, param$3, param$4, param$5) { - return o(a0, param, param$1, param$2, param$3, param$4, param$5); - }; + return function (param, param$1, param$2, param$3, param$4, param$5) { + return o(a0, param, param$1, param$2, param$3, param$4, param$5); + }; default: return app(o, [a0]); } @@ -80,29 +80,29 @@ function _2(o, a0, a1) { } else { switch (arity) { case 1 : - return app(o(a0), [a1]); + return app(o(a0), [a1]); case 2 : - return o(a0, a1); + return o(a0, a1); case 3 : - return function (param) { - return o(a0, a1, param); - }; + return function (param) { + return o(a0, a1, param); + }; case 4 : - return function (param, param$1) { - return o(a0, a1, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, param, param$1); + }; case 5 : - return function (param, param$1, param$2) { - return o(a0, a1, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, param, param$1, param$2); + }; case 6 : - return function (param, param$1, param$2, param$3) { - return o(a0, a1, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, a1, param, param$1, param$2, param$3); + }; case 7 : - return function (param, param$1, param$2, param$3, param$4) { - return o(a0, a1, param, param$1, param$2, param$3, param$4); - }; + return function (param, param$1, param$2, param$3, param$4) { + return o(a0, a1, param, param$1, param$2, param$3, param$4); + }; default: return app(o, [ a0, @@ -130,30 +130,30 @@ function _3(o, a0, a1, a2) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2 - ]); + return app(o(a0), [ + a1, + a2 + ]); case 2 : - return app(o(a0, a1), [a2]); + return app(o(a0, a1), [a2]); case 3 : - return o(a0, a1, a2); + return o(a0, a1, a2); case 4 : - return function (param) { - return o(a0, a1, a2, param); - }; + return function (param) { + return o(a0, a1, a2, param); + }; case 5 : - return function (param, param$1) { - return o(a0, a1, a2, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, param, param$1); + }; case 6 : - return function (param, param$1, param$2) { - return o(a0, a1, a2, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, a2, param, param$1, param$2); + }; case 7 : - return function (param, param$1, param$2, param$3) { - return o(a0, a1, a2, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, a1, a2, param, param$1, param$2, param$3); + }; default: return app(o, [ a0, @@ -182,32 +182,32 @@ function _4(o, a0, a1, a2, a3) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3 - ]); + return app(o(a0), [ + a1, + a2, + a3 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3 - ]); + return app(o(a0, a1), [ + a2, + a3 + ]); case 3 : - return app(o(a0, a1, a2), [a3]); + return app(o(a0, a1, a2), [a3]); case 4 : - return o(a0, a1, a2, a3); + return o(a0, a1, a2, a3); case 5 : - return function (param) { - return o(a0, a1, a2, a3, param); - }; + return function (param) { + return o(a0, a1, a2, a3, param); + }; case 6 : - return function (param, param$1) { - return o(a0, a1, a2, a3, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, a3, param, param$1); + }; case 7 : - return function (param, param$1, param$2) { - return o(a0, a1, a2, a3, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, a2, a3, param, param$1, param$2); + }; default: return app(o, [ a0, @@ -237,35 +237,35 @@ function _5(o, a0, a1, a2, a3, a4) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4 - ]); + return app(o(a0, a1, a2), [ + a3, + a4 + ]); case 4 : - return app(o(a0, a1, a2, a3), [a4]); + return app(o(a0, a1, a2, a3), [a4]); case 5 : - return o(a0, a1, a2, a3, a4); + return o(a0, a1, a2, a3, a4); case 6 : - return function (param) { - return o(a0, a1, a2, a3, a4, param); - }; + return function (param) { + return o(a0, a1, a2, a3, a4, param); + }; case 7 : - return function (param, param$1) { - return o(a0, a1, a2, a3, a4, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, a3, a4, param, param$1); + }; default: return app(o, [ a0, @@ -296,39 +296,39 @@ function _6(o, a0, a1, a2, a3, a4, a5) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [a5]); + return app(o(a0, a1, a2, a3, a4), [a5]); case 6 : - return o(a0, a1, a2, a3, a4, a5); + return o(a0, a1, a2, a3, a4, a5); case 7 : - return function (param) { - return o(a0, a1, a2, a3, a4, a5, param); - }; + return function (param) { + return o(a0, a1, a2, a3, a4, a5, param); + }; default: return app(o, [ a0, @@ -360,44 +360,44 @@ function _7(o, a0, a1, a2, a3, a4, a5, a6) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5, + a6 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5, + a6 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5, + a6 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5, + a6 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6 - ]); + return app(o(a0, a1, a2, a3, a4), [ + a5, + a6 + ]); case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [a6]); + return app(o(a0, a1, a2, a3, a4, a5), [a6]); case 7 : - return o(a0, a1, a2, a3, a4, a5, a6); + return o(a0, a1, a2, a3, a4, a5, a6); default: return app(o, [ a0, @@ -430,52 +430,52 @@ function _8(o, a0, a1, a2, a3, a4, a5, a6, a7) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5, + a6, + a7 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5, + a6, + a7 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2, a3, a4), [ + a5, + a6, + a7 + ]); case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [ - a6, - a7 - ]); + return app(o(a0, a1, a2, a3, a4, a5), [ + a6, + a7 + ]); case 7 : - return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); + return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); default: return app(o, [ a0, diff --git a/lib/es6/digest.js b/lib/es6/digest.js index d321133827..b5a203d3d8 100644 --- a/lib/es6/digest.js +++ b/lib/es6/digest.js @@ -18,11 +18,11 @@ function bytes(b) { function substring(str, ofs, len) { if (ofs < 0 || len < 0 || ofs > (str.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.substring" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.substring" + } + }); } return Caml_md5.md5_string(str, ofs, len); } @@ -40,14 +40,14 @@ function char_hex(n) { function to_hex(d) { if (d.length !== 16) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.to_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.to_hex" + } + }); } let result = Caml_bytes.create(32); - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { let x = Caml_string.get(d, i); result[(i << 1)] = char_hex((x >>> 4)); result[(i << 1) + 1 | 0] = char_hex(x & 15); @@ -58,42 +58,42 @@ function to_hex(d) { function from_hex(s) { if (s.length !== 32) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } let digit = function (c) { if (c >= 65) { if (c >= 97) { if (c >= 103) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return (c - /* 'a' */97 | 0) + 10 | 0; } if (c >= 71) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return (c - /* 'A' */65 | 0) + 10 | 0; } if (c > 57 || c < 48) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return c - /* '0' */48 | 0; }; @@ -101,7 +101,7 @@ function from_hex(s) { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { Caml_bytes.set(result, i, Char.chr(byte((i << 1)))); } return Bytes.unsafe_to_string(result); diff --git a/lib/es6/filename.js b/lib/es6/filename.js index 1c278eaa94..7eff32f9f3 100644 --- a/lib/es6/filename.js +++ b/lib/es6/filename.js @@ -13,7 +13,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { return current_dir_name; } else { let _n = name.length - 1 | 0; - while(true) { + while (true) { let n = _n; if (n < 0) { return $$String.sub(name, 0, 1); @@ -21,7 +21,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { if (!is_dir_sep(name, n)) { let _n$1 = n; let p = n + 1 | 0; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 < 0) { return $$String.sub(name, 0, p); @@ -44,21 +44,21 @@ function generic_dirname(is_dir_sep, current_dir_name, name) { return current_dir_name; } else { let _n = name.length - 1 | 0; - while(true) { + while (true) { let n = _n; if (n < 0) { return $$String.sub(name, 0, 1); } if (!is_dir_sep(name, n)) { let _n$1 = n; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 < 0) { return current_dir_name; } if (is_dir_sep(name, n$1)) { let _n$2 = n$1; - while(true) { + while (true) { let n$2 = _n$2; if (n$2 < 0) { return $$String.sub(name, 0, 1); @@ -118,15 +118,14 @@ let temp_dir_name; try { temp_dir_name = Caml_sys.sys_getenv("TMPDIR"); -} -catch (raw_exn){ +} catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { temp_dir_name = "/tmp"; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -135,7 +134,7 @@ function quote(x) { let l = x.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '\'' */39); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { if (Caml_string.get(x, i) === /* '\'' */39) { Buffer.add_string(b, quotequote); } else { @@ -201,15 +200,14 @@ let temp_dir_name$1; try { temp_dir_name$1 = Caml_sys.sys_getenv("TEMP"); -} -catch (raw_exn$1){ +} catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { temp_dir_name$1 = "."; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } @@ -218,7 +216,7 @@ function quote$1(s) { let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); let loop = function (_i) { - while(true) { + while (true) { let i = _i; if (i === l) { return Buffer.add_char(b, /* '"' */34); @@ -236,7 +234,7 @@ function quote$1(s) { }; }; let loop_bs = function (_n, _i) { - while(true) { + while (true) { let i = _i; let n = _n; if (i === l) { @@ -259,7 +257,7 @@ function quote$1(s) { }; }; let add_bs = function (n) { - for(let _j = 1; _j <= n; ++_j){ + for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } }; @@ -321,35 +319,35 @@ let match; switch (Sys.os_type) { case "Cygwin" : - match = [ - current_dir_name$2, - "..", - "/", - is_dir_sep$1, - is_relative$1, - is_implicit$1, - check_suffix$1, - temp_dir_name, - quote, - basename$2, - dirname$2 - ]; - break; + match = [ + current_dir_name$2, + "..", + "/", + is_dir_sep$1, + is_relative$1, + is_implicit$1, + check_suffix$1, + temp_dir_name, + quote, + basename$2, + dirname$2 + ]; + break; case "Win32" : - match = [ - current_dir_name$1, - "..", - "\\", - is_dir_sep$1, - is_relative$1, - is_implicit$1, - check_suffix$1, - temp_dir_name$1, - quote$1, - basename$1, - dirname$1 - ]; - break; + match = [ + current_dir_name$1, + "..", + "\\", + is_dir_sep$1, + is_relative$1, + is_implicit$1, + check_suffix$1, + temp_dir_name$1, + quote$1, + basename$1, + dirname$1 + ]; + break; default: match = [ current_dir_name, @@ -385,25 +383,25 @@ function chop_suffix(name, suff) { let n = name.length - suff.length | 0; if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Filename.chop_suffix" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Filename.chop_suffix" + } + }); } return $$String.sub(name, 0, n); } function extension_len(name) { let _i = name.length - 1 | 0; - while(true) { + while (true) { let i = _i; if (i < 0 || is_dir_sep$2(name, i)) { return 0; } if (Caml_string.get(name, i) === /* '.' */46) { let _i$1 = i - 1 | 0; - while(true) { + while (true) { let i$1 = _i$1; if (i$1 < 0 || is_dir_sep$2(name, i$1)) { return 0; @@ -433,11 +431,11 @@ function chop_extension(name) { let l = extension_len(name); if (l === 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Filename.chop_extension" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Filename.chop_extension" + } + }); } return $$String.sub(name, 0, name.length - l | 0); } diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index db2acdd716..9e2005ad19 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -52,8 +52,7 @@ function make_lexer(keywords) { let ident_or_keyword = function (id) { try { return Hashtbl.find(kwd_table, id); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return { @@ -62,32 +61,31 @@ function make_lexer(keywords) { }; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; let keyword_or_error = function (c) { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "Illegal character " + s - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "Illegal character " + s + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; let next_token = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return; @@ -105,81 +103,80 @@ function make_lexer(keywords) { case 13 : case 26 : case 32 : - Stream.junk(strm__); - continue; + Stream.junk(strm__); + continue; case 34 : - Stream.junk(strm__); - reset_buffer(); - return { - TAG: "String", - _0: string(strm__) - }; + Stream.junk(strm__); + reset_buffer(); + return { + TAG: "String", + _0: string(strm__) + }; case 39 : - Stream.junk(strm__); - let c$1; - try { - c$1 = char(strm__); + Stream.junk(strm__); + let c$1; + try { + c$1 = char(strm__); + } catch (raw_exn) { + let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.RE_EXN_ID === Stream.Failure) { + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } - catch (raw_exn){ - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === Stream.Failure) { - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + throw new Error(exn.RE_EXN_ID, { + cause: exn + }); + } + let match = Stream.peek(strm__); + if (match !== undefined) { + if (match !== 39) { + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } - let match = Stream.peek(strm__); - if (match !== undefined) { - if (match !== 39) { - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - Stream.junk(strm__); - return { - TAG: "Char", - _0: c$1 - }; + Stream.junk(strm__); + return { + TAG: "Char", + _0: c$1 + }; + } + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" } - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + }); case 40 : + Stream.junk(strm__); + let match$1 = Stream.peek(strm__); + if (match$1 === 42) { Stream.junk(strm__); - let match$1 = Stream.peek(strm__); - if (match$1 === 42) { - Stream.junk(strm__); - comment(strm__); - return next_token(strm__); - } else { - return keyword_or_error(/* '(' */40); - } + comment(strm__); + return next_token(strm__); + } else { + return keyword_or_error(/* '(' */40); + } case 45 : + Stream.junk(strm__); + let c$2 = Stream.peek(strm__); + if (c$2 !== undefined && !(c$2 > 57 || c$2 < 48)) { Stream.junk(strm__); - let c$2 = Stream.peek(strm__); - if (c$2 !== undefined && !(c$2 > 57 || c$2 < 48)) { - Stream.junk(strm__); - reset_buffer(); - store(/* '-' */45); - store(c$2); - return number(strm__); - } else { - reset_buffer(); - store(/* '-' */45); - return ident2(strm__); - } + reset_buffer(); + store(/* '-' */45); + store(c$2); + return number(strm__); + } else { + reset_buffer(); + store(/* '-' */45); + return ident2(strm__); + } case 48 : case 49 : case 50 : @@ -190,8 +187,8 @@ function make_lexer(keywords) { case 55 : case 56 : case 57 : - exit = 4; - break; + exit = 4; + break; case 0 : case 1 : case 2 : @@ -223,8 +220,8 @@ function make_lexer(keywords) { case 44 : case 46 : case 59 : - exit = 1; - break; + exit = 1; + break; case 33 : case 35 : case 36 : @@ -239,22 +236,21 @@ function make_lexer(keywords) { case 62 : case 63 : case 64 : - exit = 3; - break; - + exit = 3; + break; } } } else { switch (c) { case 92 : case 94 : - exit = 3; - break; + exit = 3; + break; case 91 : case 93 : case 96 : - exit = 1; - break; + exit = 1; + break; default: exit = 2; } @@ -268,55 +264,54 @@ function make_lexer(keywords) { } switch (exit) { case 1 : - Stream.junk(strm__); - return keyword_or_error(c); + Stream.junk(strm__); + return keyword_or_error(c); case 2 : - Stream.junk(strm__); - reset_buffer(); - store(c); - while(true) { - let c$3 = Stream.peek(strm__); - if (c$3 === undefined) { - return ident_or_keyword(get_string()); - } - if (c$3 >= 91) { - if (c$3 > 122 || c$3 < 95) { - if (c$3 > 255 || c$3 < 192) { - return ident_or_keyword(get_string()); - } - - } else if (c$3 === 96) { - return ident_or_keyword(get_string()); - } - - } else if (c$3 >= 48) { - if (!(c$3 > 64 || c$3 < 58)) { + Stream.junk(strm__); + reset_buffer(); + store(c); + while (true) { + let c$3 = Stream.peek(strm__); + if (c$3 === undefined) { + return ident_or_keyword(get_string()); + } + if (c$3 >= 91) { + if (c$3 > 122 || c$3 < 95) { + if (c$3 > 255 || c$3 < 192) { return ident_or_keyword(get_string()); } - } else if (c$3 !== 39) { + } else if (c$3 === 96) { return ident_or_keyword(get_string()); } - Stream.junk(strm__); - store(c$3); - continue; - }; - case 3 : + + } else if (c$3 >= 48) { + if (!(c$3 > 64 || c$3 < 58)) { + return ident_or_keyword(get_string()); + } + + } else if (c$3 !== 39) { + return ident_or_keyword(get_string()); + } Stream.junk(strm__); - reset_buffer(); - store(c); - return ident2(strm__); + store(c$3); + continue; + }; + case 3 : + Stream.junk(strm__); + reset_buffer(); + store(c); + return ident2(strm__); case 4 : - Stream.junk(strm__); - reset_buffer(); - store(c); - return number(strm__); - + Stream.junk(strm__); + reset_buffer(); + store(c); + return number(strm__); } }; }; let ident2 = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return ident_or_keyword(get_string()); @@ -358,7 +353,7 @@ function make_lexer(keywords) { case 56 : case 57 : case 59 : - return ident_or_keyword(get_string()); + return ident_or_keyword(get_string()); case 33 : case 35 : case 36 : @@ -374,8 +369,7 @@ function make_lexer(keywords) { case 62 : case 63 : case 64 : - break; - + break; } } Stream.junk(strm__); @@ -384,7 +378,7 @@ function make_lexer(keywords) { }; }; let number = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c !== undefined) { if (c >= 58) { @@ -404,7 +398,7 @@ function make_lexer(keywords) { } else { Stream.junk(strm__); store(/* '.' */46); - while(true) { + while (true) { let c$1 = Stream.peek(strm__); if (c$1 !== undefined) { if (c$1 > 101 || c$1 < 69) { @@ -445,7 +439,7 @@ function make_lexer(keywords) { } }; let end_exponent_part = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return { @@ -465,7 +459,7 @@ function make_lexer(keywords) { }; }; let string = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 34) { @@ -478,20 +472,19 @@ function make_lexer(keywords) { let c$1; try { c$1 = escape(strm__); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stream.Failure) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } store(c$1); continue; @@ -500,10 +493,10 @@ function make_lexer(keywords) { return get_string(); } throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); }; }; let char = function (strm__) { @@ -516,27 +509,26 @@ function make_lexer(keywords) { Stream.junk(strm__); try { return escape(strm__); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stream.Failure) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; let escape = function (strm__) { @@ -545,14 +537,14 @@ function make_lexer(keywords) { if (c1 >= 58) { switch (c1) { case 110 : - Stream.junk(strm__); - return /* '\n' */10; + Stream.junk(strm__); + return /* '\n' */10; case 114 : - Stream.junk(strm__); - return /* '\r' */13; + Stream.junk(strm__); + return /* '\r' */13; case 116 : - Stream.junk(strm__); - return /* '\t' */9; + Stream.junk(strm__); + return /* '\t' */9; default: Stream.junk(strm__); return c1; @@ -564,106 +556,106 @@ function make_lexer(keywords) { if (c2 !== undefined) { if (c2 > 57 || c2 < 48) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } Stream.junk(strm__); let c3 = Stream.peek(strm__); if (c3 !== undefined) { if (c3 > 57 || c3 < 48) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - Stream.junk(strm__); - return Char.chr((Math.imul(c1 - 48 | 0, 100) + Math.imul(c2 - 48 | 0, 10) | 0) + (c3 - 48 | 0) | 0); - } - throw new Error(Stream.$$Error, { cause: { RE_EXN_ID: Stream.$$Error, _1: "" } }); + } + Stream.junk(strm__); + return Char.chr((Math.imul(c1 - 48 | 0, 100) + Math.imul(c2 - 48 | 0, 10) | 0) + (c3 - 48 | 0) | 0); + } + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } Stream.junk(strm__); return c1; } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; let comment = function (strm__) { - while(true) { + while (true) { let match = Stream.peek(strm__); if (match !== undefined) { switch (match) { case 40 : - Stream.junk(strm__); - let match$1 = Stream.peek(strm__); - if (match$1 !== undefined) { - if (match$1 !== 42) { - Stream.junk(strm__); - return comment(strm__); - } else { - Stream.junk(strm__); - comment(strm__); - return comment(strm__); - } + Stream.junk(strm__); + let match$1 = Stream.peek(strm__); + if (match$1 !== undefined) { + if (match$1 !== 42) { + Stream.junk(strm__); + return comment(strm__); + } else { + Stream.junk(strm__); + comment(strm__); + return comment(strm__); } - throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + } + throw new Error(Stream.Failure, { + cause: { + RE_EXN_ID: Stream.Failure + } + }); case 42 : - Stream.junk(strm__); - while(true) { - let match$2 = Stream.peek(strm__); - if (match$2 !== undefined) { - if (match$2 !== 41) { - if (match$2 !== 42) { - Stream.junk(strm__); - return comment(strm__); - } + Stream.junk(strm__); + while (true) { + let match$2 = Stream.peek(strm__); + if (match$2 !== undefined) { + if (match$2 !== 41) { + if (match$2 !== 42) { Stream.junk(strm__); - continue; + return comment(strm__); } Stream.junk(strm__); - return; + continue; } - throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); - }; + Stream.junk(strm__); + return; + } + throw new Error(Stream.Failure, { + cause: { + RE_EXN_ID: Stream.Failure + } + }); + }; default: Stream.junk(strm__); continue; } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; }; diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index c0ea9129b9..6a8a0e8b92 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -43,7 +43,7 @@ let prng = CamlinternalLazy.from_fun(function () { }); function power_2_above(_x, n) { - while(true) { + while (true) { let x = _x; if (x >= n) { return x; @@ -71,7 +71,7 @@ function create(randomOpt, initial_size) { function clear(h) { h.size = 0; let len = h.data.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { Caml_array.set(h.data, i, "Empty"); } } @@ -95,7 +95,7 @@ function copy_bucketlist(param) { let data = param.data; let next = param.next; let loop = function (_prec, _param) { - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -112,15 +112,15 @@ function copy_bucketlist(param) { }; if (typeof prec !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "hashtbl.res", - 110, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "hashtbl.res", + 110, + 19 + ] + } + }); } prec.next = r; _param = next; @@ -163,7 +163,7 @@ function resize(indexfun, h) { let inplace = h.initial_size >= 0; h.data = ndata; let insert_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -189,13 +189,13 @@ function resize(indexfun, h) { continue; }; }; - for(let i = 0; i < osize; ++i){ + for (let i = 0; i < osize; ++i) { insert_bucket(Caml_array.get(odata, i)); } if (!inplace) { return; } - for(let i$1 = 0; i$1 < nsize; ++i$1){ + for (let i$1 = 0; i$1 < nsize; ++i$1) { let tail = Caml_array.get(ndata_tail, i$1); if (typeof tail === "object") { tail.next = "Empty"; @@ -228,7 +228,7 @@ function remove(h, key) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -255,10 +255,10 @@ function find(h, key) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -268,10 +268,10 @@ function find(h, key) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -281,10 +281,10 @@ function find(h, key) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -293,14 +293,14 @@ function find(h, key) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -344,7 +344,7 @@ function find_opt(h, key) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -363,7 +363,7 @@ function find_opt(h, key) { function find_all(h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -385,7 +385,7 @@ function find_all(h, key) { } function replace_bucket(key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -424,7 +424,7 @@ function replace(h, key, data) { function mem(h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -441,7 +441,7 @@ function mem(h, key) { function iter(f, h) { let do_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -460,7 +460,7 @@ function iter(f, h) { } try { let d = h.data; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { do_bucket(Caml_array.get(d, i)); } if (!old_trav) { @@ -468,22 +468,21 @@ function iter(f, h) { } else { return; } - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function filter_map_inplace_bucket(f, h, i, _prec, _param) { - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -522,27 +521,26 @@ function filter_map_inplace(f, h) { flip_ongoing_traversal(h); } try { - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { filter_map_inplace_bucket(f, h, i, "Empty", Caml_array.get(h.data, i)); } return; - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function fold(f, h, init) { let do_bucket = function (_b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (typeof b !== "object") { @@ -563,29 +561,28 @@ function fold(f, h, init) { try { let d = h.data; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = do_bucket(Caml_array.get(d, i), accu); } if (!old_trav) { flip_ongoing_traversal(h); } return accu; - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function bucket_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -638,7 +635,7 @@ function MakeSeeded(H) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -664,10 +661,10 @@ function MakeSeeded(H) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -677,10 +674,10 @@ function MakeSeeded(H) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -690,10 +687,10 @@ function MakeSeeded(H) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -702,14 +699,14 @@ function MakeSeeded(H) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -752,7 +749,7 @@ function MakeSeeded(H) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -770,7 +767,7 @@ function MakeSeeded(H) { }; let find_all = function (h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -791,7 +788,7 @@ function MakeSeeded(H) { return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; let replace_bucket = function (key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -828,7 +825,7 @@ function MakeSeeded(H) { }; let mem = function (h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -886,7 +883,7 @@ function Make(H) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -912,10 +909,10 @@ function Make(H) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -925,10 +922,10 @@ function Make(H) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -938,10 +935,10 @@ function Make(H) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -950,14 +947,14 @@ function Make(H) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -1000,7 +997,7 @@ function Make(H) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1018,7 +1015,7 @@ function Make(H) { }; let find_all = function (h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -1039,7 +1036,7 @@ function Make(H) { return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; let replace_bucket = function (key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1076,7 +1073,7 @@ function Make(H) { }; let mem = function (h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; diff --git a/lib/es6/int32.js b/lib/es6/int32.js index 6c511f43e4..044b7687ef 100644 --- a/lib/es6/int32.js +++ b/lib/es6/int32.js @@ -31,15 +31,14 @@ function to_string(n) { function of_string_opt(s) { try { return Caml_format.int_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/es6/int64.js b/lib/es6/int64.js index c437037663..1c102d7b2f 100644 --- a/lib/es6/int64.js +++ b/lib/es6/int64.js @@ -24,15 +24,14 @@ function lognot(n) { function of_string_opt(s) { try { return Caml_format.int64_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/es6/js_dict.js b/lib/es6/js_dict.js index aada879bc8..3aae438cf0 100644 --- a/lib/es6/js_dict.js +++ b/lib/es6/js_dict.js @@ -17,7 +17,7 @@ function entries(dict) { let keys = Object.keys(dict); let l = keys.length; let values = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let key = keys[i]; values[i] = [ key, @@ -31,7 +31,7 @@ function values(dict) { let keys = Object.keys(dict); let l = keys.length; let values$1 = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { values$1[i] = dict[keys[i]]; } return values$1; @@ -40,7 +40,7 @@ function values(dict) { function fromList(entries) { let dict = {}; let _x = entries; - while(true) { + while (true) { let x = _x; if (!x) { return dict; @@ -55,7 +55,7 @@ function fromList(entries) { function fromArray(entries) { let dict = {}; let l = entries.length; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let match = entries[i]; dict[match[0]] = match[1]; } @@ -66,7 +66,7 @@ function map(f, source) { let target = {}; let keys = Object.keys(source); let l = keys.length; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let key = keys[i]; target[key] = f(source[key]); } diff --git a/lib/es6/js_exn.js b/lib/es6/js_exn.js index 6df4f31f32..5d9a1f8fa9 100644 --- a/lib/es6/js_exn.js +++ b/lib/es6/js_exn.js @@ -3,44 +3,44 @@ function raiseError(str) { throw new Error(new Error(str).RE_EXN_ID, { - cause: new Error(str) - }); + cause: new Error(str) + }); } function raiseEvalError(str) { throw new Error(new EvalError(str).RE_EXN_ID, { - cause: new EvalError(str) - }); + cause: new EvalError(str) + }); } function raiseRangeError(str) { throw new Error(new RangeError(str).RE_EXN_ID, { - cause: new RangeError(str) - }); + cause: new RangeError(str) + }); } function raiseReferenceError(str) { throw new Error(new ReferenceError(str).RE_EXN_ID, { - cause: new ReferenceError(str) - }); + cause: new ReferenceError(str) + }); } function raiseSyntaxError(str) { throw new Error(new SyntaxError(str).RE_EXN_ID, { - cause: new SyntaxError(str) - }); + cause: new SyntaxError(str) + }); } function raiseTypeError(str) { throw new Error(new TypeError(str).RE_EXN_ID, { - cause: new TypeError(str) - }); + cause: new TypeError(str) + }); } function raiseUriError(str) { throw new Error(new URIError(str).RE_EXN_ID, { - cause: new URIError(str) - }); + cause: new URIError(str) + }); } let $$Error$1 = "JsError"; diff --git a/lib/es6/js_json.js b/lib/es6/js_json.js index 03cb589c08..398110bc67 100644 --- a/lib/es6/js_json.js +++ b/lib/es6/js_json.js @@ -39,22 +39,21 @@ function classify(x) { function test(x, v) { switch (v) { case "String" : - return typeof x === "string"; + return typeof x === "string"; case "Number" : - return typeof x === "number"; + return typeof x === "number"; case "Object" : - if (x !== null && typeof x === "object") { - return !Array.isArray(x); - } else { - return false; - } + if (x !== null && typeof x === "object") { + return !Array.isArray(x); + } else { + return false; + } case "Array" : - return Array.isArray(x); + return Array.isArray(x); case "Boolean" : - return typeof x === "boolean"; + return typeof x === "boolean"; case "Null" : - return x === null; - + return x === null; } } diff --git a/lib/es6/js_null.js b/lib/es6/js_null.js index c6706e56a8..4a30b70360 100644 --- a/lib/es6/js_null.js +++ b/lib/es6/js_null.js @@ -11,8 +11,8 @@ function getExn(f) { return f; } throw new Error(new Error("Js.Null.getExn").RE_EXN_ID, { - cause: new Error("Js.Null.getExn") - }); + cause: new Error("Js.Null.getExn") + }); } function bind(x, f) { diff --git a/lib/es6/js_option.js b/lib/es6/js_option.js index 73e0a2f8ad..b24505acab 100644 --- a/lib/es6/js_option.js +++ b/lib/es6/js_option.js @@ -27,8 +27,8 @@ function getExn(x) { return Caml_option.valFromOption(x); } throw new Error(new Error("getExn").RE_EXN_ID, { - cause: new Error("getExn") - }); + cause: new Error("getExn") + }); } function equal(eq, a, b) { diff --git a/lib/es6/js_types.js b/lib/es6/js_types.js index 4cefeba96a..a8a165b63b 100644 --- a/lib/es6/js_types.js +++ b/lib/es6/js_types.js @@ -49,24 +49,23 @@ function classify(x) { function test(x, v) { switch (v) { case "Undefined" : - return typeof x === "undefined"; + return typeof x === "undefined"; case "Null" : - return x === null; + return x === null; case "Boolean" : - return typeof x === "boolean"; + return typeof x === "boolean"; case "Number" : - return typeof x === "number"; + return typeof x === "number"; case "String" : - return typeof x === "string"; + return typeof x === "string"; case "Function" : - return typeof x === "function"; + return typeof x === "function"; case "Object" : - return typeof x === "object"; + return typeof x === "object"; case "Symbol" : - return typeof x === "symbol"; + return typeof x === "symbol"; case "BigInt" : - return typeof x === "bigint"; - + return typeof x === "bigint"; } } diff --git a/lib/es6/js_undefined.js b/lib/es6/js_undefined.js index 68411f013f..762283d3da 100644 --- a/lib/es6/js_undefined.js +++ b/lib/es6/js_undefined.js @@ -15,8 +15,8 @@ function getExn(f) { return f; } throw new Error(new Error("Js.Undefined.getExn").RE_EXN_ID, { - cause: new Error("Js.Undefined.getExn") - }); + cause: new Error("Js.Undefined.getExn") + }); } function bind(x, f) { diff --git a/lib/es6/lexing.js b/lib/es6/lexing.js index e2f6ccdb75..ab69f5bfac 100644 --- a/lib/es6/lexing.js +++ b/lib/es6/lexing.js @@ -55,11 +55,11 @@ function from_function(f) { let newlen = (x.lex_buffer.length << 1); if (((x.lex_buffer_len - x.lex_start_pos | 0) + n | 0) > newlen) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Lexing.lex_refill: cannot grow buffer" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Lexing.lex_refill: cannot grow buffer" + } + }); } let newbuf = Caml_bytes.create(newlen); Bytes.blit(x.lex_buffer, x.lex_start_pos, newbuf, 0, x.lex_buffer_len - x.lex_start_pos | 0); @@ -72,7 +72,7 @@ function from_function(f) { x.lex_last_pos = x.lex_last_pos - s | 0; x.lex_buffer_len = x.lex_buffer_len - s | 0; let t = x.lex_mem; - for(let i = 0 ,i_finish = t.length; i < i_finish; ++i){ + for (let i = 0, i_finish = t.length; i < i_finish; ++i) { let v = Caml_array.get(t, i); if (v >= 0) { Caml_array.set(t, i, v - s | 0); diff --git a/lib/es6/list.js b/lib/es6/list.js index 02a588f97a..27207c1d45 100644 --- a/lib/es6/list.js +++ b/lib/es6/list.js @@ -7,7 +7,7 @@ import * as Caml_option from "./caml_option.js"; function length(l) { let _len = 0; let _param = l; - while(true) { + while (true) { let param = _param; let len = _len; if (!param) { @@ -31,11 +31,11 @@ function hd(param) { return param.hd; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "hd" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "hd" + } + }); } function tl(param) { @@ -43,25 +43,25 @@ function tl(param) { return param.tl; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "tl" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "tl" + } + }); } function nth(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (l$1) { @@ -73,26 +73,26 @@ function nth(l, n) { continue; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "nth" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "nth" + } + }); }; } function nth_opt(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (!l$1) { @@ -108,7 +108,7 @@ function nth_opt(l, n) { } function rev_append(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -128,7 +128,7 @@ function rev(l) { } function init_tailrec_aux(_acc, _i, n, f) { - while(true) { + while (true) { let i = _i; let acc = _acc; if (i >= n) { @@ -157,11 +157,11 @@ function init_aux(i, n, f) { function init(len, f) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.init" + } + }); } if (len > 10000) { return rev_append(init_tailrec_aux(/* [] */0, 0, len, f), /* [] */0); @@ -207,7 +207,7 @@ function mapi$1(f, l) { function rev_map(f, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -223,7 +223,7 @@ function rev_map(f, l) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -237,7 +237,7 @@ function iter(f, _param) { function iteri(f, l) { let _i = 0; let _param = l; - while(true) { + while (true) { let param = _param; let i = _i; if (!param) { @@ -251,7 +251,7 @@ function iteri(f, l) { } function fold_left(f, _accu, _l) { - while(true) { + while (true) { let l = _l; let accu = _accu; if (!l) { @@ -281,28 +281,28 @@ function map2(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } function rev_map2(f, l1, l2) { let _accu = /* [] */0; let _l1 = l1; let _l2 = l2; - while(true) { + while (true) { let l2$1 = _l2; let l1$1 = _l1; let accu = _accu; @@ -317,26 +317,26 @@ function rev_map2(f, l1, l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } if (l2$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } return accu; }; } function iter2(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -347,26 +347,26 @@ function iter2(f, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); } if (!l2) { return; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); }; } function fold_left2(f, _accu, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; let accu = _accu; @@ -378,19 +378,19 @@ function fold_left2(f, _accu, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } return accu; }; @@ -402,25 +402,25 @@ function fold_right2(f, l1, l2, accu) { return f(l1.hd, l2.hd, fold_right2(f, l1.tl, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return true; @@ -434,7 +434,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -448,7 +448,7 @@ function exists(p, _param) { } function for_all2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -461,26 +461,26 @@ function for_all2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); } if (!l2) { return true; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); }; } function exists2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -493,26 +493,26 @@ function exists2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); } if (!l2) { return false; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); }; } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -526,7 +526,7 @@ function mem(x, _param) { } function memq(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -540,7 +540,7 @@ function memq(x, _param) { } function assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -551,15 +551,15 @@ function assoc(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assoc_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -574,7 +574,7 @@ function assoc_opt(x, _param) { } function assq(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -585,15 +585,15 @@ function assq(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assq_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -608,7 +608,7 @@ function assq_opt(x, _param) { } function mem_assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -622,7 +622,7 @@ function mem_assoc(x, _param) { } function mem_assq(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -668,7 +668,7 @@ function remove_assq(x, param) { } function find(p, _param) { - while(true) { + while (true) { let param = _param; if (param) { let x = param.hd; @@ -679,15 +679,15 @@ function find(p, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function find_opt(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -704,7 +704,7 @@ function find_opt(p, _param) { function find_all(p, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -729,7 +729,7 @@ function partition(p, l) { let _yes = /* [] */0; let _no = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let no = _no; let yes = _yes; @@ -791,21 +791,21 @@ function combine(l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } function merge(cmp, l1, l2) { @@ -831,7 +831,7 @@ function merge(cmp, l1, l2) { } function chop(_k, _l) { - while(true) { + while (true) { let l = _l; let k = _k; if (k === 0) { @@ -843,15 +843,15 @@ function chop(_k, _l) { continue; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "list.res", - 420, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "list.res", + 420, + 11 + ] + } + }); }; } @@ -974,7 +974,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1120,7 +1120,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1348,7 +1348,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1579,7 +1579,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1628,7 +1628,7 @@ function sort_uniq(cmp, l) { } function compare_lengths(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1648,7 +1648,7 @@ function compare_lengths(_l1, _l2) { } function compare_length_with(_l, _n) { - while(true) { + while (true) { let n = _n; let l = _l; if (!l) { diff --git a/lib/es6/listLabels.js b/lib/es6/listLabels.js index a12d7fcd6d..46744d700a 100644 --- a/lib/es6/listLabels.js +++ b/lib/es6/listLabels.js @@ -7,7 +7,7 @@ import * as Caml_option from "./caml_option.js"; function length(l) { let _len = 0; let _param = l; - while(true) { + while (true) { let param = _param; let len = _len; if (!param) { @@ -31,11 +31,11 @@ function hd(param) { return param.hd; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "hd" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "hd" + } + }); } function tl(param) { @@ -43,25 +43,25 @@ function tl(param) { return param.tl; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "tl" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "tl" + } + }); } function nth(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (l$1) { @@ -73,26 +73,26 @@ function nth(l, n) { continue; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "nth" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "nth" + } + }); }; } function nth_opt(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (!l$1) { @@ -108,7 +108,7 @@ function nth_opt(l, n) { } function rev_append(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -128,7 +128,7 @@ function rev(l) { } function init_tailrec_aux(_acc, _i, n, f) { - while(true) { + while (true) { let i = _i; let acc = _acc; if (i >= n) { @@ -157,11 +157,11 @@ function init_aux(i, n, f) { function init(len, f) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.init" + } + }); } if (len > 10000) { return rev_append(init_tailrec_aux(/* [] */0, 0, len, f), /* [] */0); @@ -207,7 +207,7 @@ function mapi$1(f, l) { function rev_map(f, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -223,7 +223,7 @@ function rev_map(f, l) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -237,7 +237,7 @@ function iter(f, _param) { function iteri(f, l) { let _i = 0; let _param = l; - while(true) { + while (true) { let param = _param; let i = _i; if (!param) { @@ -251,7 +251,7 @@ function iteri(f, l) { } function fold_left(f, _accu, _l) { - while(true) { + while (true) { let l = _l; let accu = _accu; if (!l) { @@ -281,28 +281,28 @@ function map2(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } function rev_map2(f, l1, l2) { let _accu = /* [] */0; let _l1 = l1; let _l2 = l2; - while(true) { + while (true) { let l2$1 = _l2; let l1$1 = _l1; let accu = _accu; @@ -317,26 +317,26 @@ function rev_map2(f, l1, l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } if (l2$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } return accu; }; } function iter2(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -347,26 +347,26 @@ function iter2(f, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); } if (!l2) { return; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); }; } function fold_left2(f, _accu, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; let accu = _accu; @@ -378,19 +378,19 @@ function fold_left2(f, _accu, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } return accu; }; @@ -402,25 +402,25 @@ function fold_right2(f, l1, l2, accu) { return f(l1.hd, l2.hd, fold_right2(f, l1.tl, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return true; @@ -434,7 +434,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -448,7 +448,7 @@ function exists(p, _param) { } function for_all2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -461,26 +461,26 @@ function for_all2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); } if (!l2) { return true; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); }; } function exists2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -493,26 +493,26 @@ function exists2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); } if (!l2) { return false; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); }; } function mem(x, _set) { - while(true) { + while (true) { let set = _set; if (!set) { return false; @@ -526,7 +526,7 @@ function mem(x, _set) { } function memq(x, _set) { - while(true) { + while (true) { let set = _set; if (!set) { return false; @@ -540,7 +540,7 @@ function memq(x, _set) { } function assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -551,15 +551,15 @@ function assoc(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assoc_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -574,7 +574,7 @@ function assoc_opt(x, _param) { } function assq(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -585,15 +585,15 @@ function assq(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assq_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -608,7 +608,7 @@ function assq_opt(x, _param) { } function mem_assoc(x, _map) { - while(true) { + while (true) { let map = _map; if (!map) { return false; @@ -622,7 +622,7 @@ function mem_assoc(x, _map) { } function mem_assq(x, _map) { - while(true) { + while (true) { let map = _map; if (!map) { return false; @@ -668,7 +668,7 @@ function remove_assq(x, param) { } function find(p, _param) { - while(true) { + while (true) { let param = _param; if (param) { let x = param.hd; @@ -679,15 +679,15 @@ function find(p, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function find_opt(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -704,7 +704,7 @@ function find_opt(p, _param) { function find_all(p, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -729,7 +729,7 @@ function partition(p, l) { let _yes = /* [] */0; let _no = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let no = _no; let yes = _yes; @@ -791,21 +791,21 @@ function combine(l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } function merge(cmp, l1, l2) { @@ -831,7 +831,7 @@ function merge(cmp, l1, l2) { } function chop(_k, _l) { - while(true) { + while (true) { let l = _l; let k = _k; if (k === 0) { @@ -843,15 +843,15 @@ function chop(_k, _l) { continue; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "listLabels.res", - 420, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "listLabels.res", + 420, + 11 + ] + } + }); }; } @@ -974,7 +974,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1120,7 +1120,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1348,7 +1348,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1579,7 +1579,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1628,7 +1628,7 @@ function sort_uniq(cmp, l) { } function compare_lengths(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1648,7 +1648,7 @@ function compare_lengths(_l1, _l2) { } function compare_length_with(_l, _n) { - while(true) { + while (true) { let n = _n; let l = _l; if (!l) { diff --git a/lib/es6/map.js b/lib/es6/map.js index 9add13e742..1204bf6025 100644 --- a/lib/es6/map.js +++ b/lib/es6/map.js @@ -40,11 +40,11 @@ function Make(funarg) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -57,11 +57,11 @@ function Make(funarg) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -75,11 +75,11 @@ function Make(funarg) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -92,11 +92,11 @@ function Make(funarg) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -151,14 +151,14 @@ function Make(funarg) { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = funarg.compare(x, param.v); if (c === 0) { @@ -169,21 +169,21 @@ function Make(funarg) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -209,7 +209,7 @@ function Make(funarg) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -219,7 +219,7 @@ function Make(funarg) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -245,21 +245,21 @@ function Make(funarg) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -285,7 +285,7 @@ function Make(funarg) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -295,7 +295,7 @@ function Make(funarg) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -321,7 +321,7 @@ function Make(funarg) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -335,7 +335,7 @@ function Make(funarg) { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -349,14 +349,14 @@ function Make(funarg) { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -370,7 +370,7 @@ function Make(funarg) { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -387,14 +387,14 @@ function Make(funarg) { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -408,7 +408,7 @@ function Make(funarg) { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -427,11 +427,11 @@ function Make(funarg) { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -533,7 +533,7 @@ function Make(funarg) { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -578,7 +578,7 @@ function Make(funarg) { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -590,7 +590,7 @@ function Make(funarg) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -606,7 +606,7 @@ function Make(funarg) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -720,15 +720,15 @@ function Make(funarg) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -816,7 +816,7 @@ function Make(funarg) { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -836,7 +836,7 @@ function Make(funarg) { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -865,7 +865,7 @@ function Make(funarg) { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -897,7 +897,7 @@ function Make(funarg) { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { diff --git a/lib/es6/mapLabels.js b/lib/es6/mapLabels.js index d6fe21fdf5..af3164d63e 100644 --- a/lib/es6/mapLabels.js +++ b/lib/es6/mapLabels.js @@ -40,11 +40,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -57,11 +57,11 @@ function Make(Ord) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -75,11 +75,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -92,11 +92,11 @@ function Make(Ord) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -151,14 +151,14 @@ function Make(Ord) { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Ord.compare(x, param.v); if (c === 0) { @@ -169,7 +169,7 @@ function Make(Ord) { }; }; let find_first_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -191,14 +191,14 @@ function Make(Ord) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -209,7 +209,7 @@ function Make(Ord) { }; }; let find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -231,7 +231,7 @@ function Make(Ord) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -245,7 +245,7 @@ function Make(Ord) { }; }; let find_last_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -267,14 +267,14 @@ function Make(Ord) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -285,7 +285,7 @@ function Make(Ord) { }; }; let find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -307,7 +307,7 @@ function Make(Ord) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -321,7 +321,7 @@ function Make(Ord) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -335,7 +335,7 @@ function Make(Ord) { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -349,14 +349,14 @@ function Make(Ord) { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -370,7 +370,7 @@ function Make(Ord) { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -387,14 +387,14 @@ function Make(Ord) { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -408,7 +408,7 @@ function Make(Ord) { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -427,11 +427,11 @@ function Make(Ord) { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -533,7 +533,7 @@ function Make(Ord) { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -578,7 +578,7 @@ function Make(Ord) { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -590,7 +590,7 @@ function Make(Ord) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -606,7 +606,7 @@ function Make(Ord) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -720,15 +720,15 @@ function Make(Ord) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -816,7 +816,7 @@ function Make(Ord) { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -836,7 +836,7 @@ function Make(Ord) { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -865,7 +865,7 @@ function Make(Ord) { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -897,7 +897,7 @@ function Make(Ord) { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index d90e8d2957..36efe9670a 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -70,11 +70,11 @@ let $$Map = { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -87,11 +87,11 @@ let $$Map = { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -105,11 +105,11 @@ let $$Map = { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -122,11 +122,11 @@ let $$Map = { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -181,14 +181,14 @@ let $$Map = { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = funarg.compare(x, param.v); if (c === 0) { @@ -199,7 +199,7 @@ let $$Map = { }; }; let find_first_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -221,14 +221,14 @@ let $$Map = { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -239,7 +239,7 @@ let $$Map = { }; }; let find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -261,7 +261,7 @@ let $$Map = { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -275,7 +275,7 @@ let $$Map = { }; }; let find_last_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -297,14 +297,14 @@ let $$Map = { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -315,7 +315,7 @@ let $$Map = { }; }; let find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -337,7 +337,7 @@ let $$Map = { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -351,7 +351,7 @@ let $$Map = { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -365,7 +365,7 @@ let $$Map = { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -379,14 +379,14 @@ let $$Map = { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -400,7 +400,7 @@ let $$Map = { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -417,14 +417,14 @@ let $$Map = { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -438,7 +438,7 @@ let $$Map = { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -457,11 +457,11 @@ let $$Map = { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -563,7 +563,7 @@ let $$Map = { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -608,7 +608,7 @@ let $$Map = { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -620,7 +620,7 @@ let $$Map = { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -636,7 +636,7 @@ let $$Map = { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -750,15 +750,15 @@ let $$Map = { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -846,7 +846,7 @@ let $$Map = { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -866,7 +866,7 @@ let $$Map = { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -895,7 +895,7 @@ let $$Map = { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -927,7 +927,7 @@ let $$Map = { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1016,11 +1016,11 @@ let $$Set = { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -1032,11 +1032,11 @@ let $$Set = { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -1049,11 +1049,11 @@ let $$Set = { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -1065,11 +1065,11 @@ let $$Set = { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -1144,14 +1144,14 @@ let $$Set = { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1162,7 +1162,7 @@ let $$Set = { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1176,14 +1176,14 @@ let $$Set = { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -1194,7 +1194,7 @@ let $$Set = { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1210,11 +1210,11 @@ let $$Set = { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1283,7 +1283,7 @@ let $$Set = { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1383,7 +1383,7 @@ let $$Set = { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -1400,7 +1400,7 @@ let $$Set = { }; }; let compare_aux = function (_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1429,7 +1429,7 @@ let $$Set = { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -1479,7 +1479,7 @@ let $$Set = { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1491,7 +1491,7 @@ let $$Set = { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -1503,7 +1503,7 @@ let $$Set = { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1519,7 +1519,7 @@ let $$Set = { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1589,7 +1589,7 @@ let $$Set = { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1607,14 +1607,14 @@ let $$Set = { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = funarg.compare(x, v); @@ -1626,7 +1626,7 @@ let $$Set = { }; }; let find_first_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1643,14 +1643,14 @@ let $$Set = { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -1661,7 +1661,7 @@ let $$Set = { }; }; let find_first_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1678,7 +1678,7 @@ let $$Set = { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1692,7 +1692,7 @@ let $$Set = { }; }; let find_last_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1709,14 +1709,14 @@ let $$Set = { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -1727,7 +1727,7 @@ let $$Set = { }; }; let find_last_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1744,7 +1744,7 @@ let $$Set = { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1758,7 +1758,7 @@ let $$Set = { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1799,28 +1799,54 @@ let $$Set = { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1831,52 +1857,24 @@ let $$Set = { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -1889,15 +1887,15 @@ let $$Set = { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l), l)[0]; }; diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index a17af3f6e4..bf77a01d44 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -74,68 +74,65 @@ function yyparse(tables, start, lexer, lexbuf) { try { let _cmd = "Start"; let _arg; - while(true) { + while (true) { let arg = _arg; let cmd = _cmd; let match = Caml_parser.parse_engine(tables, env, cmd, arg); switch (match) { case "Read_token" : - let t = lexer(lexbuf); - env.symb_start = lexbuf.lex_start_p; - env.symb_end = lexbuf.lex_curr_p; - _arg = t; - _cmd = "Token_read"; - continue; + let t = lexer(lexbuf); + env.symb_start = lexbuf.lex_start_p; + env.symb_end = lexbuf.lex_curr_p; + _arg = t; + _cmd = "Token_read"; + continue; case "Raise_parse_error" : - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); case "Grow_stacks_1" : - grow_stacks(); - _arg = undefined; - _cmd = "Stacks_grown_1"; - continue; + grow_stacks(); + _arg = undefined; + _cmd = "Stacks_grown_1"; + continue; case "Grow_stacks_2" : - grow_stacks(); - _arg = undefined; - _cmd = "Stacks_grown_2"; - continue; + grow_stacks(); + _arg = undefined; + _cmd = "Stacks_grown_2"; + continue; case "Compute_semantic_action" : - let match$1; - try { + let match$1; + try { + match$1 = [ + "Semantic_action_computed", + Caml_array.get(tables.actions, env.rule_number)(env) + ]; + } catch (raw_exn) { + let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.RE_EXN_ID === Parse_error) { match$1 = [ - "Semantic_action_computed", - Caml_array.get(tables.actions, env.rule_number)(env) + "Error_detected", + undefined ]; + } else { + throw new Error(exn.RE_EXN_ID, { + cause: exn + }); } - catch (raw_exn){ - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === Parse_error) { - match$1 = [ - "Error_detected", - undefined - ]; - } else { - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } - } - _arg = match$1[1]; - _cmd = match$1[0]; - continue; + } + _arg = match$1[1]; + _cmd = match$1[0]; + continue; case "Call_error_function" : - tables.error_function("syntax error"); - _arg = undefined; - _cmd = "Error_detected"; - continue; - + tables.error_function("syntax error"); + _arg = undefined; + _cmd = "Error_detected"; + continue; } }; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); let curr_char = env.curr_char; env.asp = init_asp; @@ -156,8 +153,8 @@ function yyparse(tables, start, lexer, lexbuf) { } }); throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } @@ -167,7 +164,7 @@ function peek_val(env, n) { function symbol_start_pos() { let _i = env.rule_len; - while(true) { + while (true) { let i = _i; if (i <= 0) { return Caml_array.get(env.symb_end_stack, env.asp); diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index 255eeeffc4..a80ead8cb4 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -8,20 +8,20 @@ import * as Caml_js_exceptions from "./caml_js_exceptions.js"; function failwith(s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); } function invalid_arg(s) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } let Exit = /* @__PURE__ */Caml_exceptions.create("Pervasives.Exit"); @@ -59,11 +59,11 @@ function classify_float(x) { function char_of_int(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "char_of_int" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "char_of_int" + } + }); } return n; } @@ -79,25 +79,25 @@ function string_of_bool(b) { function bool_of_string(param) { switch (param) { case "false" : - return false; + return false; case "true" : - return true; + return true; default: throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "bool_of_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "bool_of_string" + } + }); } } function bool_of_string_opt(param) { switch (param) { case "false" : - return false; + return false; case "true" : - return true; + return true; default: return; } @@ -106,22 +106,21 @@ function bool_of_string_opt(param) { function int_of_string_opt(s) { try { return Caml_format.int_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function valid_float_lexem(s) { let l = s.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= l) { return s + "."; @@ -149,15 +148,14 @@ function string_of_float(f) { function float_of_string_opt(s) { try { return Caml_format.float_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/es6/queue.js b/lib/es6/queue.js index 36d67dbb71..72b301fa5f 100644 --- a/lib/es6/queue.js +++ b/lib/es6/queue.js @@ -42,20 +42,20 @@ function peek(q) { return match.content; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function take(q) { let match = q.first; if (typeof match !== "object") { throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } let content = match.content; let next = match.next; @@ -76,7 +76,7 @@ function copy(q) { }; let _prev = "Nil"; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (typeof cell !== "object") { @@ -110,7 +110,7 @@ function length(q) { function iter(f, q) { let _cell = q.first; - while(true) { + while (true) { let cell = _cell; if (typeof cell !== "object") { return; @@ -125,7 +125,7 @@ function iter(f, q) { function fold(f, accu, q) { let _accu = accu; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let accu$1 = _accu; if (typeof cell !== "object") { diff --git a/lib/es6/random.js b/lib/es6/random.js index e2e703067e..4f58498949 100644 --- a/lib/es6/random.js +++ b/lib/es6/random.js @@ -27,13 +27,13 @@ function full_init(s, seed) { }; let seed$1 = seed.length === 0 ? [0] : seed; let l = seed$1.length; - for(let i = 0; i <= 54; ++i){ + for (let i = 0; i <= 54; ++i) { Caml_array.set(s.st, i, i); } let accu = "x"; - for(let i$1 = 0 ,i_finish = 54 + ( + for (let i$1 = 0, i_finish = 54 + ( 55 > l ? 55 : l - ) | 0; i$1 <= i_finish; ++i$1){ + ) | 0; i$1 <= i_finish; ++i$1) { let j = i$1 % 55; let k = i$1 % l; accu = combine(accu, Caml_array.get(seed$1, k)); @@ -76,13 +76,13 @@ function bits(s) { function int(s, bound) { if (bound > 1073741823 || bound <= 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int" + } + }); } - while(true) { + while (true) { let r = bits(s); let v = r % bound; if ((r - v | 0) <= ((1073741823 - bound | 0) + 1 | 0)) { @@ -95,13 +95,13 @@ function int(s, bound) { function int32(s, bound) { if (bound <= 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int32" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int32" + } + }); } - while(true) { + while (true) { let b1 = bits(s); let b2 = ((bits(s) & 1) << 30); let r = b1 | b2; @@ -116,13 +116,13 @@ function int32(s, bound) { function int64(s, bound) { if (Caml.i64_le(bound, Caml_int64.zero)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int64" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int64" + } + }); } - while(true) { + while (true) { let b1 = Caml_int64.of_int32(bits(s)); let b2 = Caml_int64.lsl_(Caml_int64.of_int32(bits(s)), 30); let b3 = Caml_int64.lsl_(Caml_int64.of_int32(bits(s) & 7), 60); diff --git a/lib/es6/runtime_deriving.js b/lib/es6/runtime_deriving.js index e2b665fdb9..36b9eb01d8 100644 --- a/lib/es6/runtime_deriving.js +++ b/lib/es6/runtime_deriving.js @@ -4,10 +4,10 @@ function raiseWhenNotFound(x) { if (x == null) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } return x; } diff --git a/lib/es6/set.js b/lib/es6/set.js index 2808ee5d78..764a62ec36 100644 --- a/lib/es6/set.js +++ b/lib/es6/set.js @@ -32,11 +32,11 @@ function Make(funarg) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -48,11 +48,11 @@ function Make(funarg) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -65,11 +65,11 @@ function Make(funarg) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -81,11 +81,11 @@ function Make(funarg) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -160,14 +160,14 @@ function Make(funarg) { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -178,7 +178,7 @@ function Make(funarg) { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -192,14 +192,14 @@ function Make(funarg) { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -210,7 +210,7 @@ function Make(funarg) { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -226,11 +226,11 @@ function Make(funarg) { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -290,7 +290,7 @@ function Make(funarg) { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -396,7 +396,7 @@ function Make(funarg) { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -415,7 +415,7 @@ function Make(funarg) { let compare = function (s1, s2) { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -441,7 +441,7 @@ function Make(funarg) { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -491,7 +491,7 @@ function Make(funarg) { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -503,7 +503,7 @@ function Make(funarg) { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -515,7 +515,7 @@ function Make(funarg) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -531,7 +531,7 @@ function Make(funarg) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -601,7 +601,7 @@ function Make(funarg) { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -619,14 +619,14 @@ function Make(funarg) { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = funarg.compare(x, v); @@ -638,20 +638,20 @@ function Make(funarg) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -672,7 +672,7 @@ function Make(funarg) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -681,7 +681,7 @@ function Make(funarg) { if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -702,20 +702,20 @@ function Make(funarg) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -736,7 +736,7 @@ function Make(funarg) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -745,7 +745,7 @@ function Make(funarg) { if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -766,7 +766,7 @@ function Make(funarg) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -825,28 +825,54 @@ function Make(funarg) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -857,52 +883,24 @@ function Make(funarg) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -915,15 +913,15 @@ function Make(funarg) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l$1), l$1)[0]; } else { diff --git a/lib/es6/setLabels.js b/lib/es6/setLabels.js index 3097a1f8f3..0d96269262 100644 --- a/lib/es6/setLabels.js +++ b/lib/es6/setLabels.js @@ -32,11 +32,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -48,11 +48,11 @@ function Make(Ord) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -65,11 +65,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -81,11 +81,11 @@ function Make(Ord) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -160,14 +160,14 @@ function Make(Ord) { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -178,7 +178,7 @@ function Make(Ord) { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -192,14 +192,14 @@ function Make(Ord) { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -210,7 +210,7 @@ function Make(Ord) { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -226,11 +226,11 @@ function Make(Ord) { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -299,7 +299,7 @@ function Make(Ord) { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -399,7 +399,7 @@ function Make(Ord) { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -416,7 +416,7 @@ function Make(Ord) { }; }; let compare_aux = function (_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -445,7 +445,7 @@ function Make(Ord) { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -495,7 +495,7 @@ function Make(Ord) { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -507,7 +507,7 @@ function Make(Ord) { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -519,7 +519,7 @@ function Make(Ord) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -535,7 +535,7 @@ function Make(Ord) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -605,7 +605,7 @@ function Make(Ord) { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -623,14 +623,14 @@ function Make(Ord) { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = Ord.compare(x, v); @@ -642,7 +642,7 @@ function Make(Ord) { }; }; let find_first_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -659,14 +659,14 @@ function Make(Ord) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -677,7 +677,7 @@ function Make(Ord) { }; }; let find_first_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -694,7 +694,7 @@ function Make(Ord) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -708,7 +708,7 @@ function Make(Ord) { }; }; let find_last_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -725,14 +725,14 @@ function Make(Ord) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -743,7 +743,7 @@ function Make(Ord) { }; }; let find_last_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -760,7 +760,7 @@ function Make(Ord) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -774,7 +774,7 @@ function Make(Ord) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -815,28 +815,54 @@ function Make(Ord) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -847,52 +873,24 @@ function Make(Ord) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -905,15 +903,15 @@ function Make(Ord) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l), l)[0]; }; diff --git a/lib/es6/sort.js b/lib/es6/sort.js index 64395cfd55..f2c66fedfa 100644 --- a/lib/es6/sort.js +++ b/lib/es6/sort.js @@ -72,7 +72,7 @@ function list(order, l) { } }; let _param = initlist(l); - while(true) { + while (true) { let param = _param; if (!param) { return /* [] */0; @@ -93,7 +93,7 @@ function swap(arr, i, j) { function array(cmp, arr) { let qsort = function (_lo, _hi) { - while(true) { + while (true) { let hi = _hi; let lo = _lo; if ((hi - lo | 0) < 6) { @@ -115,17 +115,17 @@ function array(cmp, arr) { let j = hi - 1 | 0; if (!cmp(pivot, arr[hi]) || !cmp(arr[lo], pivot)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Sort.array" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Sort.array" + } + }); } - while(i < j) { - while(!cmp(pivot, arr[i])) { + while (i < j) { + while (!cmp(pivot, arr[i])) { i = i + 1 | 0; }; - while(!cmp(arr[j], pivot)) { + while (!cmp(arr[j], pivot)) { j = j - 1 | 0; }; if (i < j) { @@ -145,12 +145,12 @@ function array(cmp, arr) { }; }; qsort(0, arr.length - 1 | 0); - for(let i = 1 ,i_finish = arr.length; i < i_finish; ++i){ + for (let i = 1, i_finish = arr.length; i < i_finish; ++i) { let val_i = arr[i]; if (!cmp(arr[i - 1 | 0], val_i)) { arr[i] = arr[i - 1 | 0]; let j = i - 1 | 0; - while(j >= 1 && !cmp(arr[j - 1 | 0], val_i)) { + while (j >= 1 && !cmp(arr[j - 1 | 0], val_i)) { arr[j] = arr[j - 1 | 0]; j = j - 1 | 0; }; diff --git a/lib/es6/stack.js b/lib/es6/stack.js index dd86dd733d..147171622d 100644 --- a/lib/es6/stack.js +++ b/lib/es6/stack.js @@ -40,10 +40,10 @@ function pop(s) { return match.hd; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function top(s) { @@ -52,10 +52,10 @@ function top(s) { return match.hd; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function is_empty(s) { diff --git a/lib/es6/stream.js b/lib/es6/stream.js index a6bf804d7b..548760f914 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -28,118 +28,116 @@ function data(param) { } function get_data(count, _d) { - while(true) { + while (true) { let d = _d; if (typeof d !== "object") { return d; } switch (d.TAG) { case "Scons" : - return d; + return d; case "Sapp" : - let d2 = d._1; - let match = get_data(count, d._0); - if (typeof match !== "object") { - _d = d2; - continue; - } - if (match.TAG === "Scons") { - return { - TAG: "Scons", - _0: match._0, - _1: { - TAG: "Sapp", - _0: match._1, - _1: d2 - } - }; - } - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stream.res", - 53, - 13 - ] - } - }); - case "Slazy" : - _d = CamlinternalLazy.force(d._0); + let d2 = d._1; + let match = get_data(count, d._0); + if (typeof match !== "object") { + _d = d2; continue; - case "Sgen" : - let g = d._0; - let match$1 = g.curr; - if (match$1 !== undefined) { - let a = Caml_option.valFromOption(match$1); - if (a !== undefined) { - g.curr = undefined; - return { - TAG: "Scons", - _0: Caml_option.valFromOption(a), - _1: d - }; - } else { - return "Sempty"; + } + if (match.TAG === "Scons") { + return { + TAG: "Scons", + _0: match._0, + _1: { + TAG: "Sapp", + _0: match._1, + _1: d2 } + }; + } + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stream.res", + 53, + 13 + ] } - let a$1 = g.func(count); - if (a$1 !== undefined) { + }); + case "Slazy" : + _d = CamlinternalLazy.force(d._0); + continue; + case "Sgen" : + let g = d._0; + let match$1 = g.curr; + if (match$1 !== undefined) { + let a = Caml_option.valFromOption(match$1); + if (a !== undefined) { + g.curr = undefined; return { TAG: "Scons", - _0: Caml_option.valFromOption(a$1), + _0: Caml_option.valFromOption(a), _1: d }; } else { - g.curr = Caml_option.some(undefined); return "Sempty"; } - + } + let a$1 = g.func(count); + if (a$1 !== undefined) { + return { + TAG: "Scons", + _0: Caml_option.valFromOption(a$1), + _1: d + }; + } else { + g.curr = Caml_option.some(undefined); + return "Sempty"; + } } }; } function peek_data(s) { - while(true) { + while (true) { let f = s.data; if (typeof f !== "object") { return; } switch (f.TAG) { case "Scons" : - return Caml_option.some(f._0); + return Caml_option.some(f._0); case "Sapp" : - let d = get_data(s.count, s.data); - if (typeof d !== "object") { - return; - } - if (d.TAG === "Scons") { - s.data = d; - return Caml_option.some(d._0); + let d = get_data(s.count, s.data); + if (typeof d !== "object") { + return; + } + if (d.TAG === "Scons") { + s.data = d; + return Caml_option.some(d._0); + } + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stream.res", + 83, + 13 + ] } - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stream.res", - 83, - 13 - ] - } - }); + }); case "Slazy" : - s.data = CamlinternalLazy.force(f._0); - continue; + s.data = CamlinternalLazy.force(f._0); + continue; case "Sgen" : - let g = f._0; - let a = g.curr; - if (a !== undefined) { - return Caml_option.valFromOption(a); - } - let x = g.func(s.count); - g.curr = Caml_option.some(x); - return x; - + let g = f._0; + let a = g.curr; + if (a !== undefined) { + return Caml_option.valFromOption(a); + } + let x = g.func(s.count); + g.curr = Caml_option.some(x); + return x; } }; } @@ -152,25 +150,23 @@ function peek(param) { } function junk_data(s) { - while(true) { + while (true) { let g = s.data; if (typeof g === "object") { switch (g.TAG) { case "Scons" : + s.count = s.count + 1 | 0; + s.data = g._1; + return; + case "Sgen" : + let g$1 = g._0; + let match = g$1.curr; + if (match !== undefined) { s.count = s.count + 1 | 0; - s.data = g._1; + g$1.curr = undefined; return; - case "Sgen" : - let g$1 = g._0; - let match = g$1.curr; - if (match !== undefined) { - s.count = s.count + 1 | 0; - g$1.curr = undefined; - return; - } - break; - default: - + } + break; } } let match$1 = peek_data(s); @@ -239,10 +235,10 @@ function next(s) { return Caml_option.valFromOption(a); } throw new Error(Failure, { - cause: { - RE_EXN_ID: Failure - } - }); + cause: { + RE_EXN_ID: Failure + } + }); } function empty(s) { @@ -251,15 +247,15 @@ function empty(s) { return; } throw new Error(Failure, { - cause: { - RE_EXN_ID: Failure - } - }); + cause: { + RE_EXN_ID: Failure + } + }); } function iter(f, strm) { let do_rec = function () { - while(true) { + while (true) { let a = peek(strm); if (a === undefined) { return; @@ -432,26 +428,25 @@ function dump_data(f, param) { } switch (param.TAG) { case "Scons" : - console.log("Scons ("); - f(param._0); - console.log(", "); - dump_data(f, param._1); - console.log(")"); - return; + console.log("Scons ("); + f(param._0); + console.log(", "); + dump_data(f, param._1); + console.log(")"); + return; case "Sapp" : - console.log("Sapp ("); - dump_data(f, param._0); - console.log(", "); - dump_data(f, param._1); - console.log(")"); - return; + console.log("Sapp ("); + dump_data(f, param._0); + console.log(", "); + dump_data(f, param._1); + console.log(")"); + return; case "Slazy" : - console.log("Slazy"); - return; + console.log("Slazy"); + return; case "Sgen" : - console.log("Sgen"); - return; - + console.log("Sgen"); + return; } } diff --git a/lib/es6/string.js b/lib/es6/string.js index 80b4bd8637..c19e2db03c 100644 --- a/lib/es6/string.js +++ b/lib/es6/string.js @@ -19,13 +19,13 @@ function concat(sep, xs) { } function iter(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(s.codePointAt(i)); } } function iteri(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(i, s.codePointAt(i)); } } @@ -56,7 +56,7 @@ function trim(s) { function escaped(s) { let needs_escape = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= s.length) { return false; @@ -87,14 +87,14 @@ function escaped(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -109,7 +109,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -130,11 +130,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -143,24 +143,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -177,17 +177,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -207,11 +207,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -220,24 +220,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -248,24 +247,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -294,7 +292,7 @@ function equal(a, b) { function split_on_char(sep, s) { let r = /* [] */0; let j = s.length; - for(let i = s.length - 1 | 0; i >= 0; --i){ + for (let i = s.length - 1 | 0; i >= 0; --i) { if (s.codePointAt(i) === sep) { r = { hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), diff --git a/lib/es6/stringLabels.js b/lib/es6/stringLabels.js index 38232f9ba9..74f7f99d18 100644 --- a/lib/es6/stringLabels.js +++ b/lib/es6/stringLabels.js @@ -21,13 +21,13 @@ function concat(sep, xs) { } function iter(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(s.codePointAt(i)); } } function iteri(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(i, s.codePointAt(i)); } } @@ -58,7 +58,7 @@ function trim(s) { function escaped(s) { let needs_escape = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= s.length) { return false; @@ -89,14 +89,14 @@ function escaped(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -111,7 +111,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -132,11 +132,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -145,24 +145,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -179,17 +179,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -209,11 +209,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -222,24 +222,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -250,24 +249,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -296,7 +294,7 @@ function equal(a, b) { function split_on_char(sep, s) { let r = /* [] */0; let j = s.length; - for(let i = s.length - 1 | 0; i >= 0; --i){ + for (let i = s.length - 1 | 0; i >= 0; --i) { if (s.codePointAt(i) === sep) { r = { hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), diff --git a/lib/es6/uchar.js b/lib/es6/uchar.js index f98c218a31..c75c5caada 100644 --- a/lib/es6/uchar.js +++ b/lib/es6/uchar.js @@ -17,11 +17,11 @@ function succ(u) { } if (u === 1114111) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "U+10FFFF has no successor" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "U+10FFFF has no successor" + } + }); } return u + 1 | 0; } @@ -32,11 +32,11 @@ function pred(u) { } if (u === 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "U+0000 has no predecessor" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "U+0000 has no predecessor" + } + }); } return u - 1 | 0; } @@ -57,11 +57,11 @@ function of_int(i) { } let s = err_not_sv(i); throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } function is_char(u) { @@ -78,11 +78,11 @@ function to_char(u) { } let s = err_not_latin1(u); throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } function unsafe_to_char(prim) { diff --git a/lib/js/arg.js b/lib/js/arg.js index 192e936c98..e06814b14b 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -21,7 +21,7 @@ let Help = /* @__PURE__ */Caml_exceptions.create("Arg.Help"); let Stop = /* @__PURE__ */Caml_exceptions.create("Arg.Stop"); function assoc3(x, _l) { - while(true) { + while (true) { let l = _l; if (l) { let match = l.hd; @@ -32,10 +32,10 @@ function assoc3(x, _l) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -60,14 +60,14 @@ function make_symlist(prefix, sep, suffix, l) { function help_action() { throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Unknown", - _0: "-help" - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Unknown", + _0: "-help" + } + } + }); } function add_help(speclist) { @@ -75,8 +75,7 @@ function add_help(speclist) { try { assoc3("-help", speclist); add1 = /* [] */0; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { add1 = { @@ -92,16 +91,15 @@ function add_help(speclist) { }; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } let add2; try { assoc3("--help", speclist); add2 = /* [] */0; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { add2 = { @@ -117,8 +115,8 @@ function add_help(speclist) { }; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } return Pervasives.$at(speclist, Pervasives.$at(add1, add2)); @@ -158,45 +156,42 @@ let current = { function bool_of_string_opt(x) { try { return Pervasives.bool_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Invalid_argument") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function int_of_string_opt(x) { try { return Caml_format.int_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function float_of_string_opt(x) { try { return Caml_format.float_of_string(x); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -207,25 +202,24 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist let progname = initpos < argv.contents.length ? Caml_array.get(argv.contents, initpos) : "(?)"; switch (error.TAG) { case "Unknown" : - let s = error._0; - switch (s) { - case "--help" : - case "-help" : - break; - default: - Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n"); - } - break; + let s = error._0; + switch (s) { + case "--help" : + case "-help" : + break; + default: + Buffer.add_string(b, progname + ": unknown option '" + s + "'.\n"); + } + break; case "Wrong" : - Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n"); - break; + Buffer.add_string(b, progname + ": wrong argument '" + error._1 + "'; option '" + error._0 + "' expects " + error._2 + ".\n"); + break; case "Missing" : - Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n"); - break; + Buffer.add_string(b, progname + ": option '" + error._0 + "' needs an argument.\n"); + break; case "Message" : - Buffer.add_string(b, progname + ": " + error._0 + ".\n"); - break; - + Buffer.add_string(b, progname + ": " + error._0 + ".\n"); + break; } usage_b(b, speclist.contents, errmsg); if (Caml_obj.equal(error, { @@ -247,7 +241,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } }; current.contents = current.contents + 1 | 0; - while(current.contents < argv.contents.length) { + while (current.contents < argv.contents.length) { try { let s = Caml_array.get(argv.contents, current.contents); if (s.length >= 1 && Caml_string.get(s, 0) === /* '-' */45) { @@ -257,8 +251,7 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist assoc3(s, speclist.contents), undefined ]; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { try { @@ -267,28 +260,27 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist assoc3(match$1[0], speclist.contents), match$1[1] ]; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Unknown", - _0: s - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Unknown", + _0: s + } + } + }); } throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } let follow = match[1]; @@ -297,16 +289,16 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return; } throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: follow, - _2: "no argument" - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: follow, + _2: "no argument" + } + } + }); }; let get_arg = function () { if (follow !== undefined) { @@ -316,14 +308,14 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist return Caml_array.get(argv.contents, current.contents + 1 | 0); } throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Missing", - _0: s - } - } - }); + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Missing", + _0: s + } + } + }); }; let consume_arg = function () { if (follow !== undefined) { @@ -336,198 +328,196 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist let treat_action = function (f) { switch (f.TAG) { case "Unit" : - return f._0(); + return f._0(); case "Bool" : - let arg = get_arg(); - let s$1 = bool_of_string_opt(arg); - if (s$1 !== undefined) { - f._0(s$1); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg, - _2: "a boolean" - } - } - }); - } - return consume_arg(); + let arg = get_arg(); + let s$1 = bool_of_string_opt(arg); + if (s$1 !== undefined) { + f._0(s$1); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg, + _2: "a boolean" + } + } + }); + } + return consume_arg(); case "Set" : - no_arg(); - f._0.contents = true; - return; + no_arg(); + f._0.contents = true; + return; case "Clear" : - no_arg(); - f._0.contents = false; - return; + no_arg(); + f._0.contents = false; + return; case "String" : - let arg$1 = get_arg(); - f._0(arg$1); - return consume_arg(); + let arg$1 = get_arg(); + f._0(arg$1); + return consume_arg(); case "Set_string" : - f._0.contents = get_arg(); - return consume_arg(); + f._0.contents = get_arg(); + return consume_arg(); case "Int" : - let arg$2 = get_arg(); - let x = int_of_string_opt(arg$2); - if (x !== undefined) { - f._0(x); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$2, - _2: "an integer" - } - } - }); - } - return consume_arg(); + let arg$2 = get_arg(); + let x = int_of_string_opt(arg$2); + if (x !== undefined) { + f._0(x); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$2, + _2: "an integer" + } + } + }); + } + return consume_arg(); case "Set_int" : - let arg$3 = get_arg(); - let x$1 = int_of_string_opt(arg$3); - if (x$1 !== undefined) { - f._0.contents = x$1; - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$3, - _2: "an integer" - } - } - }); - } - return consume_arg(); + let arg$3 = get_arg(); + let x$1 = int_of_string_opt(arg$3); + if (x$1 !== undefined) { + f._0.contents = x$1; + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$3, + _2: "an integer" + } + } + }); + } + return consume_arg(); case "Float" : - let arg$4 = get_arg(); - let x$2 = float_of_string_opt(arg$4); - if (x$2 !== undefined) { - f._0(x$2); - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$4, - _2: "a float" - } - } - }); - } - return consume_arg(); + let arg$4 = get_arg(); + let x$2 = float_of_string_opt(arg$4); + if (x$2 !== undefined) { + f._0(x$2); + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$4, + _2: "a float" + } + } + }); + } + return consume_arg(); case "Set_float" : - let arg$5 = get_arg(); - let x$3 = float_of_string_opt(arg$5); - if (x$3 !== undefined) { - f._0.contents = x$3; - } else { - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$5, - _2: "a float" - } - } - }); - } - return consume_arg(); + let arg$5 = get_arg(); + let x$3 = float_of_string_opt(arg$5); + if (x$3 !== undefined) { + f._0.contents = x$3; + } else { + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$5, + _2: "a float" + } + } + }); + } + return consume_arg(); case "Tuple" : - return List.iter(treat_action, f._0); + return List.iter(treat_action, f._0); case "Symbol" : - let symb = f._0; - let arg$6 = get_arg(); - if (List.mem(arg$6, symb)) { - f._1(arg$6); - return consume_arg(); + let symb = f._0; + let arg$6 = get_arg(); + if (List.mem(arg$6, symb)) { + f._1(arg$6); + return consume_arg(); + } + throw new Error(Stop, { + cause: { + RE_EXN_ID: Stop, + _1: { + TAG: "Wrong", + _0: s, + _1: arg$6, + _2: "one of: " + make_symlist("", " ", "", symb) + } } - throw new Error(Stop, { - cause: { - RE_EXN_ID: Stop, - _1: { - TAG: "Wrong", - _0: s, - _1: arg$6, - _2: "one of: " + make_symlist("", " ", "", symb) - } - } - }); + }); case "Rest" : - let f$1 = f._0; - while(current.contents < (argv.contents.length - 1 | 0)) { - f$1(Caml_array.get(argv.contents, current.contents + 1 | 0)); - consume_arg(); - }; - return; - case "Expand" : - if (!allow_expand) { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic" - } - }); - } - let arg$7 = get_arg(); - let newarg = f._0(arg$7); + let f$1 = f._0; + while (current.contents < (argv.contents.length - 1 | 0)) { + f$1(Caml_array.get(argv.contents, current.contents + 1 | 0)); consume_arg(); - let before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); - let after = $$Array.sub(argv.contents, current.contents + 1 | 0, (argv.contents.length - current.contents | 0) - 1 | 0); - argv.contents = Caml_array.concat({ - hd: before, - tl: { - hd: newarg, - tl: { - hd: after, - tl: /* [] */0 - } + }; + return; + case "Expand" : + if (!allow_expand) { + throw new Error("Invalid_argument", { + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Arg.Expand is is only allowed with Arg.parse_and_expand_argv_dynamic" } }); - return; - + } + let arg$7 = get_arg(); + let newarg = f._0(arg$7); + consume_arg(); + let before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); + let after = $$Array.sub(argv.contents, current.contents + 1 | 0, (argv.contents.length - current.contents | 0) - 1 | 0); + argv.contents = Caml_array.concat({ + hd: before, + tl: { + hd: newarg, + tl: { + hd: after, + tl: /* [] */0 + } + } + }); + return; } }; treat_action(match[0]); } else { anonfun(s); } - } - catch (raw_m){ + } catch (raw_m) { let m = Caml_js_exceptions.internalToOCamlException(raw_m); if (m.RE_EXN_ID === Bad) { throw new Error(convert_error({ - TAG: "Message", - _0: m._1 - }).RE_EXN_ID, { - cause: convert_error({ - TAG: "Message", - _0: m._1 - }) - }); + TAG: "Message", + _0: m._1 + }).RE_EXN_ID, { + cause: convert_error({ + TAG: "Message", + _0: m._1 + }) + }); } if (m.RE_EXN_ID === Stop) { throw new Error(convert_error(m._1).RE_EXN_ID, { - cause: convert_error(m._1) - }); + cause: convert_error(m._1) + }); } throw new Error(m.RE_EXN_ID, { - cause: m - }); + cause: m + }); } current.contents = current.contents + 1 | 0; }; @@ -554,8 +544,7 @@ function parse_argv(currentOpt, argv, speclist, anonfun, errmsg) { function parse(l, f, msg) { try { return parse_argv(undefined, Sys.argv, l, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -566,16 +555,15 @@ function parse(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } function parse_dynamic(l, f, msg) { try { return parse_argv_dynamic(undefined, Sys.argv, l, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -586,8 +574,8 @@ function parse_dynamic(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } @@ -603,8 +591,7 @@ function parse_expand(l, f, msg) { contents: current.contents }; return parse_and_expand_argv_dynamic(current$1, argv, spec, f, msg); - } - catch (raw_msg){ + } catch (raw_msg) { let msg$1 = Caml_js_exceptions.internalToOCamlException(raw_msg); if (msg$1.RE_EXN_ID === Bad) { console.log(msg$1._1); @@ -615,15 +602,15 @@ function parse_expand(l, f, msg) { return Pervasives.exit(0); } throw new Error(msg$1.RE_EXN_ID, { - cause: msg$1 - }); + cause: msg$1 + }); } } function second_word(s) { let len = s.length; let loop = function (_n) { - while(true) { + while (true) { let n = _n; if (n >= len) { return len; @@ -638,8 +625,7 @@ function second_word(s) { let n; try { n = $$String.index(s, /* '\t' */9); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { let exit = 0; @@ -647,15 +633,14 @@ function second_word(s) { try { n$1 = $$String.index(s, /* ' ' */32); exit = 2; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { return len; } throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } if (exit === 2) { return loop(n$1 + 1 | 0); @@ -663,8 +648,8 @@ function second_word(s) { } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } return loop(n + 1 | 0); diff --git a/lib/js/array.js b/lib/js/array.js index 9407d2ffc0..81d2af9cb4 100644 --- a/lib/js/array.js +++ b/lib/js/array.js @@ -15,14 +15,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f(i); } return res; @@ -30,7 +30,7 @@ function init(l, f) { function make_matrix(sx, sy, init) { let res = Caml_array.make(sx, []); - for(let x = 0; x < sx; ++x){ + for (let x = 0; x < sx; ++x) { res[x] = Caml_array.make(sy, init); } return res; @@ -59,11 +59,11 @@ function append(a1, a2) { function sub(a, ofs, len) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.sub" + } + }); } return Caml_array.sub(a, ofs, len); } @@ -71,13 +71,13 @@ function sub(a, ofs, len) { function fill(a, ofs, len, v) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.fill" + } + }); } - for(let i = ofs ,i_finish = ofs + len | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + len | 0; i < i_finish; ++i) { a[i] = v; } } @@ -85,17 +85,17 @@ function fill(a, ofs, len, v) { function blit(a1, ofs1, a2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (a1.length - len | 0) || ofs2 < 0 || ofs2 > (a2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.blit" + } + }); } Caml_array.blit(a1, ofs1, a2, ofs2, len); } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -103,13 +103,13 @@ function iter(f, a) { function iter2(f, a, b) { if (a.length !== b.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.iter2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.iter2: arrays must have the same length" + } + }); } - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i], b[i]); } } @@ -120,7 +120,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -131,24 +131,24 @@ function map2(f, a, b) { let lb = b.length; if (la !== lb) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.map2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.map2: arrays must have the same length" + } + }); } if (la === 0) { return []; } let r = Caml_array.make(la, f(a[0], b[0])); - for(let i = 1; i < la; ++i){ + for (let i = 1; i < la; ++i) { r[i] = f(a[i], b[i]); } return r; } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -159,7 +159,7 @@ function mapi(f, a) { return []; } let r = Caml_array.make(l, f(0, a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -168,7 +168,7 @@ function mapi(f, a) { function to_list(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -184,7 +184,7 @@ function to_list(a) { } function list_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -203,7 +203,7 @@ function of_list(param) { let a = Caml_array.make(list_length(0, param), param.hd); let _i = 1; let _param = param.tl; - while(true) { + while (true) { let param$1 = _param; let i = _i; if (!param$1) { @@ -218,7 +218,7 @@ function of_list(param) { function fold_left(f, x, a) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -226,7 +226,7 @@ function fold_left(f, x, a) { function fold_right(f, a, x) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(a[i], r); } return r; @@ -235,7 +235,7 @@ function fold_right(f, a, x) { function exists(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -251,7 +251,7 @@ function exists(p, a) { function for_all(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return true; @@ -267,7 +267,7 @@ function for_all(p, a) { function mem(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -283,7 +283,7 @@ function mem(x, a) { function memq(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -318,16 +318,16 @@ function sort(cmp, a) { return i31; } throw new Error(Bottom, { - cause: { - RE_EXN_ID: Bottom, - _1: i - } - }); + cause: { + RE_EXN_ID: Bottom, + _1: i + } + }); }; let trickle = function (l, i, e) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); if (cmp(Caml_array.get(a, j), e) <= 0) { @@ -337,53 +337,51 @@ function sort(cmp, a) { _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return Caml_array.set(a, i$2._1, e); } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let bubble = function (l, i) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); Caml_array.set(a, i$1, Caml_array.get(a, j)); _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return i$2._1; } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let trickleup = function (_i, e) { - while(true) { + while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; if (i === father) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "array.res", - 321, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "array.res", + 321, + 4 + ] + } + }); } if (cmp(Caml_array.get(a, father), e) >= 0) { return Caml_array.set(a, i, e); @@ -397,10 +395,10 @@ function sort(cmp, a) { }; }; let l = a.length; - for(let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i){ + for (let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i) { trickle(l, i, Caml_array.get(a, i)); } - for(let i$1 = l - 1 | 0; i$1 >= 2; --i$1){ + for (let i$1 = l - 1 | 0; i$1 >= 2; --i$1) { let e = Caml_array.get(a, i$1); Caml_array.set(a, i$1, Caml_array.get(a, 0)); trickleup(bubble(i$1, 0), e); @@ -422,7 +420,7 @@ function stable_sort(cmp, a) { let _i2 = src2ofs; let _s2 = Caml_array.get(src2, src2ofs); let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -451,10 +449,10 @@ function stable_sort(cmp, a) { }; }; let isortto = function (srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { + while (j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { Caml_array.set(dst, j + 1 | 0, Caml_array.get(dst, j)); j = j - 1 | 0; }; diff --git a/lib/js/arrayLabels.js b/lib/js/arrayLabels.js index c486cfe363..cd50a85c00 100644 --- a/lib/js/arrayLabels.js +++ b/lib/js/arrayLabels.js @@ -15,14 +15,14 @@ function init(l, f) { } if (l < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.init" + } + }); } let res = Caml_array.make(l, f(0)); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { res[i] = f(i); } return res; @@ -30,7 +30,7 @@ function init(l, f) { function make_matrix(sx, sy, init) { let res = Caml_array.make(sx, []); - for(let x = 0; x < sx; ++x){ + for (let x = 0; x < sx; ++x) { res[x] = Caml_array.make(sy, init); } return res; @@ -59,11 +59,11 @@ function append(a1, a2) { function sub(a, ofs, len) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.sub" + } + }); } return Caml_array.sub(a, ofs, len); } @@ -71,13 +71,13 @@ function sub(a, ofs, len) { function fill(a, ofs, len, v) { if (ofs < 0 || len < 0 || ofs > (a.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.fill" + } + }); } - for(let i = ofs ,i_finish = ofs + len | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + len | 0; i < i_finish; ++i) { a[i] = v; } } @@ -85,17 +85,17 @@ function fill(a, ofs, len, v) { function blit(a1, ofs1, a2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (a1.length - len | 0) || ofs2 < 0 || ofs2 > (a2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.blit" + } + }); } Caml_array.blit(a1, ofs1, a2, ofs2, len); } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -103,13 +103,13 @@ function iter(f, a) { function iter2(f, a, b) { if (a.length !== b.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.iter2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.iter2: arrays must have the same length" + } + }); } - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i], b[i]); } } @@ -120,7 +120,7 @@ function map(f, a) { return []; } let r = Caml_array.make(l, f(a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -131,24 +131,24 @@ function map2(f, a, b) { let lb = b.length; if (la !== lb) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Array.map2: arrays must have the same length" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Array.map2: arrays must have the same length" + } + }); } if (la === 0) { return []; } let r = Caml_array.make(la, f(a[0], b[0])); - for(let i = 1; i < la; ++i){ + for (let i = 1; i < la; ++i) { r[i] = f(a[i], b[i]); } return r; } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -159,7 +159,7 @@ function mapi(f, a) { return []; } let r = Caml_array.make(l, f(0, a[0])); - for(let i = 1; i < l; ++i){ + for (let i = 1; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -168,7 +168,7 @@ function mapi(f, a) { function to_list(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -184,7 +184,7 @@ function to_list(a) { } function list_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -203,7 +203,7 @@ function of_list(param) { let a = Caml_array.make(list_length(0, param), param.hd); let _i = 1; let _param = param.tl; - while(true) { + while (true) { let param$1 = _param; let i = _i; if (!param$1) { @@ -218,7 +218,7 @@ function of_list(param) { function fold_left(f, x, a) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -226,7 +226,7 @@ function fold_left(f, x, a) { function fold_right(f, a, x) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(a[i], r); } return r; @@ -235,7 +235,7 @@ function fold_right(f, a, x) { function exists(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -251,7 +251,7 @@ function exists(p, a) { function for_all(p, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return true; @@ -267,7 +267,7 @@ function for_all(p, a) { function mem(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -283,7 +283,7 @@ function mem(x, a) { function memq(x, a) { let n = a.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === n) { return false; @@ -318,16 +318,16 @@ function sort(cmp, a) { return i31; } throw new Error(Bottom, { - cause: { - RE_EXN_ID: Bottom, - _1: i - } - }); + cause: { + RE_EXN_ID: Bottom, + _1: i + } + }); }; let trickle = function (l, i, e) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); if (cmp(Caml_array.get(a, j), e) <= 0) { @@ -337,53 +337,51 @@ function sort(cmp, a) { _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return Caml_array.set(a, i$2._1, e); } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let bubble = function (l, i) { try { let _i = i; - while(true) { + while (true) { let i$1 = _i; let j = maxson(l, i$1); Caml_array.set(a, i$1, Caml_array.get(a, j)); _i = j; continue; }; - } - catch (raw_i){ + } catch (raw_i) { let i$2 = Caml_js_exceptions.internalToOCamlException(raw_i); if (i$2.RE_EXN_ID === Bottom) { return i$2._1; } throw new Error(i$2.RE_EXN_ID, { - cause: i$2 - }); + cause: i$2 + }); } }; let trickleup = function (_i, e) { - while(true) { + while (true) { let i = _i; let father = (i - 1 | 0) / 3 | 0; if (i === father) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "arrayLabels.res", - 321, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "arrayLabels.res", + 321, + 4 + ] + } + }); } if (cmp(Caml_array.get(a, father), e) >= 0) { return Caml_array.set(a, i, e); @@ -397,10 +395,10 @@ function sort(cmp, a) { }; }; let l = a.length; - for(let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i){ + for (let i = ((l + 1 | 0) / 3 | 0) - 1 | 0; i >= 0; --i) { trickle(l, i, Caml_array.get(a, i)); } - for(let i$1 = l - 1 | 0; i$1 >= 2; --i$1){ + for (let i$1 = l - 1 | 0; i$1 >= 2; --i$1) { let e = Caml_array.get(a, i$1); Caml_array.set(a, i$1, Caml_array.get(a, 0)); trickleup(bubble(i$1, 0), e); @@ -422,7 +420,7 @@ function stable_sort(cmp, a) { let _i2 = src2ofs; let _s2 = Caml_array.get(src2, src2ofs); let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -451,10 +449,10 @@ function stable_sort(cmp, a) { }; }; let isortto = function (srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = Caml_array.get(a, srcofs + i | 0); let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { + while (j >= dstofs && cmp(Caml_array.get(dst, j), e) > 0) { Caml_array.set(dst, j + 1 | 0, Caml_array.get(dst, j)); j = j - 1 | 0; }; diff --git a/lib/js/belt_Array.js b/lib/js/belt_Array.js index 596da5e5c6..d7d823123f 100644 --- a/lib/js/belt_Array.js +++ b/lib/js/belt_Array.js @@ -13,15 +13,15 @@ function get(arr, i) { function getExn(arr, i) { if (!(i >= 0 && i < arr.length)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_Array.res", - 36, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_Array.res", + 36, + 2 + ] + } + }); } return arr[i]; } @@ -38,15 +38,15 @@ function set(arr, i, v) { function setExn(arr, i, v) { if (!(i >= 0 && i < arr.length)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_Array.res", - 49, - 2 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_Array.res", + 49, + 2 + ] + } + }); } arr[i] = v; } @@ -62,7 +62,7 @@ function shuffleInPlace(xs) { let random_int = function (min, max) { return Math.floor(Math.random() * (max - min | 0)) + min | 0; }; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { swapUnsafe(xs, i, random_int(i, len)); } } @@ -76,7 +76,7 @@ function shuffle(xs) { function reverseInPlace(xs) { let len = xs.length; let ofs = 0; - for(let i = 0 ,i_finish = len / 2 | 0; i < i_finish; ++i){ + for (let i = 0, i_finish = len / 2 | 0; i < i_finish; ++i) { swapUnsafe(xs, ofs + i | 0, ((ofs + len | 0) - i | 0) - 1 | 0); } } @@ -84,7 +84,7 @@ function reverseInPlace(xs) { function reverse(xs) { let len = xs.length; let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = xs[(len - 1 | 0) - i | 0]; } return result; @@ -95,7 +95,7 @@ function make(l, f) { return []; } let res = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { res[i] = f; } return res; @@ -106,7 +106,7 @@ function makeByU(l, f) { return []; } let res = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { res[i] = f(i); } return res; @@ -136,7 +136,7 @@ function range(start, finish) { return []; } let arr = new Array(cut + 1 | 0); - for(let i = 0; i <= cut; ++i){ + for (let i = 0; i <= cut; ++i) { arr[i] = start + i | 0; } return arr; @@ -150,7 +150,7 @@ function rangeBy(start, finish, step) { let nb = (cut / step | 0) + 1 | 0; let arr = new Array(nb); let cur = start; - for(let i = 0; i < nb; ++i){ + for (let i = 0; i < nb; ++i) { arr[i] = cur; cur = cur + step | 0; } @@ -162,7 +162,7 @@ function zip(xs, ys) { let leny = ys.length; let len = lenx < leny ? lenx : leny; let s = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s[i] = [ xs[i], ys[i] @@ -176,7 +176,7 @@ function zipByU(xs, ys, f) { let leny = ys.length; let len = lenx < leny ? lenx : leny; let s = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s[i] = f(xs[i], ys[i]); } return s; @@ -192,10 +192,10 @@ function concat(a1, a2) { let l1 = a1.length; let l2 = a2.length; let a1a2 = new Array(l1 + l2 | 0); - for(let i = 0; i < l1; ++i){ + for (let i = 0; i < l1; ++i) { a1a2[i] = a1[i]; } - for(let i$1 = 0; i$1 < l2; ++i$1){ + for (let i$1 = 0; i$1 < l2; ++i$1) { a1a2[l1 + i$1 | 0] = a2[i$1]; } return a1a2; @@ -204,14 +204,14 @@ function concat(a1, a2) { function concatMany(arrs) { let lenArrs = arrs.length; let totalLen = 0; - for(let i = 0; i < lenArrs; ++i){ + for (let i = 0; i < lenArrs; ++i) { totalLen = totalLen + arrs[i].length | 0; } let result = new Array(totalLen); totalLen = 0; - for(let j = 0; j < lenArrs; ++j){ + for (let j = 0; j < lenArrs; ++j) { let cur = arrs[j]; - for(let k = 0 ,k_finish = cur.length; k < k_finish; ++k){ + for (let k = 0, k_finish = cur.length; k < k_finish; ++k) { result[totalLen] = cur[k]; totalLen = totalLen + 1 | 0; } @@ -231,7 +231,7 @@ function slice(a, offset, len) { return []; } let result = new Array(copyLength); - for(let i = 0; i < copyLength; ++i){ + for (let i = 0; i < copyLength; ++i) { result[i] = a[ofs + i | 0]; } return result; @@ -242,7 +242,7 @@ function sliceToEnd(a, offset) { let ofs = offset < 0 ? Caml.int_max(lena + offset | 0, 0) : offset; let len = lena > ofs ? lena - ofs | 0 : 0; let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = a[ofs + i | 0]; } return result; @@ -259,19 +259,19 @@ function fill(a, offset, len, v) { if (fillLength <= 0) { return; } - for(let i = ofs ,i_finish = ofs + fillLength | 0; i < i_finish; ++i){ + for (let i = ofs, i_finish = ofs + fillLength | 0; i < i_finish; ++i) { a[i] = v; } } function blitUnsafe(a1, srcofs1, a2, srcofs2, blitLength) { if (srcofs2 <= srcofs1) { - for(let j = 0; j < blitLength; ++j){ + for (let j = 0; j < blitLength; ++j) { a2[j + srcofs2 | 0] = a1[j + srcofs1 | 0]; } return; } - for(let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + srcofs2 | 0] = a1[j$1 + srcofs1 | 0]; } } @@ -283,18 +283,18 @@ function blit(a1, ofs1, a2, ofs2, len) { let srcofs2 = ofs2 < 0 ? Caml.int_max(lena2 + ofs2 | 0, 0) : ofs2; let blitLength = Caml.int_min(len, Caml.int_min(lena1 - srcofs1 | 0, lena2 - srcofs2 | 0)); if (srcofs2 <= srcofs1) { - for(let j = 0; j < blitLength; ++j){ + for (let j = 0; j < blitLength; ++j) { a2[j + srcofs2 | 0] = a1[j + srcofs1 | 0]; } return; } - for(let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = blitLength - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + srcofs2 | 0] = a1[j$1 + srcofs1 | 0]; } } function forEachU(a, f) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } @@ -308,7 +308,7 @@ function forEach(a, f) { function mapU(a, f) { let l = a.length; let r = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(a[i]); } return r; @@ -334,7 +334,7 @@ function getByU(a, p) { let l = a.length; let i = 0; let r; - while(r === undefined && i < l) { + while (r === undefined && i < l) { let v = a[i]; if (p(v)) { r = Caml_option.some(v); @@ -354,7 +354,7 @@ function getIndexByU(a, p) { let l = a.length; let i = 0; let r; - while(r === undefined && i < l) { + while (r === undefined && i < l) { let v = a[i]; if (p(v)) { r = i; @@ -374,7 +374,7 @@ function keepU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; if (f(v)) { r[j] = v; @@ -396,7 +396,7 @@ function keepWithIndexU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; if (f(v, i)) { r[j] = v; @@ -418,7 +418,7 @@ function keepMapU(a, f) { let l = a.length; let r = new Array(l); let j = 0; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let v = a[i]; let v$1 = f(v); if (v$1 !== undefined) { @@ -438,7 +438,7 @@ function keepMap(a, f) { } function forEachWithIndexU(a, f) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -452,7 +452,7 @@ function forEachWithIndex(a, f) { function mapWithIndexU(a, f) { let l = a.length; let r = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, a[i]); } return r; @@ -466,7 +466,7 @@ function mapWithIndex(a, f) { function reduceU(a, x, f) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i]); } return r; @@ -480,7 +480,7 @@ function reduce(a, x, f) { function reduceReverseU(a, x, f) { let r = x; - for(let i = a.length - 1 | 0; i >= 0; --i){ + for (let i = a.length - 1 | 0; i >= 0; --i) { r = f(r, a[i]); } return r; @@ -495,7 +495,7 @@ function reduceReverse(a, x, f) { function reduceReverse2U(a, b, x, f) { let r = x; let len = Caml.int_min(a.length, b.length); - for(let i = len - 1 | 0; i >= 0; --i){ + for (let i = len - 1 | 0; i >= 0; --i) { r = f(r, a[i], b[i]); } return r; @@ -509,7 +509,7 @@ function reduceReverse2(a, b, x, f) { function reduceWithIndexU(a, x, f) { let r = x; - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { r = f(r, a[i], i); } return r; @@ -524,7 +524,7 @@ function reduceWithIndex(a, x, f) { function everyU(arr, b) { let len = arr.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len) { return true; @@ -546,7 +546,7 @@ function every(arr, f) { function someU(arr, b) { let len = arr.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len) { return false; @@ -566,7 +566,7 @@ function some(arr, f) { } function everyAux2(arr1, arr2, _i, b, len) { - while(true) { + while (true) { let i = _i; if (i === len) { return true; @@ -592,7 +592,7 @@ function every2(a, b, p) { function some2U(a, b, p) { let _i = 0; let len = Caml.int_min(a.length, b.length); - while(true) { + while (true) { let i = _i; if (i === len) { return false; @@ -636,7 +636,7 @@ function cmpU(a, b, p) { return -1; } else { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === lena) { return 0; @@ -663,7 +663,7 @@ function partitionU(a, f) { let j = 0; let a1 = new Array(l); let a2 = new Array(l); - for(let ii = 0; ii < l; ++ii){ + for (let ii = 0; ii < l; ++ii) { let v = a[ii]; if (f(v)) { a1[i] = v; @@ -691,7 +691,7 @@ function unzip(a) { let l = a.length; let a1 = new Array(l); let a2 = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let match = a[i]; a1[i] = match[0]; a2[i] = match[1]; @@ -710,7 +710,7 @@ function joinWithU(a, sep, toString) { let lastIndex = l - 1 | 0; let _i = 0; let _res = ""; - while(true) { + while (true) { let res = _res; let i = _i; if (i === lastIndex) { @@ -730,7 +730,7 @@ function joinWith(a, sep, toString) { function initU(n, f) { let v = new Array(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { v[i] = f(i); } return v; diff --git a/lib/js/belt_HashMap.js b/lib/js/belt_HashMap.js index ba9697458a..0707a8dbeb 100644 --- a/lib/js/belt_HashMap.js +++ b/lib/js/belt_HashMap.js @@ -9,7 +9,7 @@ function size(h) { } function copyBucketReHash(hash, h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -28,7 +28,7 @@ function copyBucketReHash(hash, h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(eq, key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { cell.value = info; @@ -76,10 +76,10 @@ function set0(h, key, value, eq, hash) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(hash, h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -110,7 +110,7 @@ function remove(h, key) { } else { let _prec = bucket; let _bucket = bucket.next; - while(true) { + while (true) { let bucket$1 = _bucket; let prec = _prec; if (bucket$1 === undefined) { @@ -153,7 +153,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -176,7 +176,7 @@ function has(h, key) { if (bucket !== undefined) { let _cell = bucket; let eq = h.eq; - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return true; @@ -202,7 +202,7 @@ function fromArray(arr, id) { let eq = id.eq; let len = arr.length; let v = Belt_internalBucketsType.make(hash, eq, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set0(v, match[0], match[1], eq, hash); } @@ -213,7 +213,7 @@ function mergeMany(h, arr) { let hash = h.hash; let eq = h.eq; let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set0(h, match[0], match[1], eq, hash); } diff --git a/lib/js/belt_HashMapInt.js b/lib/js/belt_HashMapInt.js index 7c91e287d5..fbb185be93 100644 --- a/lib/js/belt_HashMapInt.js +++ b/lib/js/belt_HashMapInt.js @@ -6,7 +6,7 @@ let Belt_internalBuckets = require("./belt_internalBuckets.js"); let Belt_internalBucketsType = require("./belt_internalBucketsType.js"); function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -25,7 +25,7 @@ function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { cell.value = info; @@ -73,10 +73,10 @@ function set(h, key, value) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -100,7 +100,7 @@ function remove(h, key) { } else { let _prec = bucket; let _buckets = bucket.next; - while(true) { + while (true) { let buckets = _buckets; let prec = _prec; if (buckets === undefined) { @@ -144,7 +144,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -166,7 +166,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -194,7 +194,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(v, match[0], match[1]); } @@ -203,7 +203,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(h, match[0], match[1]); } diff --git a/lib/js/belt_HashMapString.js b/lib/js/belt_HashMapString.js index 258b989a29..56b2025d71 100644 --- a/lib/js/belt_HashMapString.js +++ b/lib/js/belt_HashMapString.js @@ -6,7 +6,7 @@ let Belt_internalBuckets = require("./belt_internalBuckets.js"); let Belt_internalBucketsType = require("./belt_internalBucketsType.js"); function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -25,7 +25,7 @@ function copyBucketReHash(h_buckets, ndata_tail, _old_bucket) { } function replaceInBucket(key, info, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { cell.value = info; @@ -73,10 +73,10 @@ function set(h, key, value) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucketReHash(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -100,7 +100,7 @@ function remove(h, key) { } else { let _prec = bucket; let _buckets = bucket.next; - while(true) { + while (true) { let buckets = _buckets; let prec = _prec; if (buckets === undefined) { @@ -144,7 +144,7 @@ function get(h, key) { return Caml_option.some(cell3.value); } else { let _buckets = cell3.next; - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -166,7 +166,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -194,7 +194,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(v, match[0], match[1]); } @@ -203,7 +203,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; set(h, match[0], match[1]); } diff --git a/lib/js/belt_HashSet.js b/lib/js/belt_HashSet.js index eba89cbe96..8378f577f6 100644 --- a/lib/js/belt_HashSet.js +++ b/lib/js/belt_HashSet.js @@ -4,7 +4,7 @@ let Belt_internalSetBuckets = require("./belt_internalSetBuckets.js"); let Belt_internalBucketsType = require("./belt_internalBucketsType.js"); function copyBucket(hash, h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell, eq) { - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return; @@ -103,10 +103,10 @@ function add0(h, key, hash, eq) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(hash, h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -129,7 +129,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (eq(cell.key, key)) { return true; @@ -159,7 +159,7 @@ function fromArray(arr, id) { let hash = id.hash; let len = arr.length; let v = Belt_internalBucketsType.make(hash, eq, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add0(v, arr[i], hash, eq); } return v; @@ -169,7 +169,7 @@ function mergeMany(h, arr) { let eq = h.eq; let hash = h.hash; let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add0(h, arr[i], hash, eq); } } diff --git a/lib/js/belt_HashSetInt.js b/lib/js/belt_HashSetInt.js index 1a38985e11..5889ff81ec 100644 --- a/lib/js/belt_HashSetInt.js +++ b/lib/js/belt_HashSetInt.js @@ -5,7 +5,7 @@ let Belt_internalSetBuckets = require("./belt_internalSetBuckets.js"); let Belt_internalBucketsType = require("./belt_internalBucketsType.js"); function copyBucket(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return; @@ -103,10 +103,10 @@ function add(h, key) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -124,7 +124,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -152,7 +152,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(v, arr[i]); } return v; @@ -160,7 +160,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(h, arr[i]); } } diff --git a/lib/js/belt_HashSetString.js b/lib/js/belt_HashSetString.js index f8106cc738..a90cceef71 100644 --- a/lib/js/belt_HashSetString.js +++ b/lib/js/belt_HashSetString.js @@ -5,7 +5,7 @@ let Belt_internalSetBuckets = require("./belt_internalSetBuckets.js"); let Belt_internalBucketsType = require("./belt_internalBucketsType.js"); function copyBucket(h_buckets, ndata_tail, _old_bucket) { - while(true) { + while (true) { let old_bucket = _old_bucket; if (old_bucket === undefined) { return; @@ -38,7 +38,7 @@ function remove(h, key) { } else if (next_cell !== undefined) { let _prec = l; let _cell = next_cell; - while(true) { + while (true) { let cell = _cell; let prec = _prec; let cell_next = cell.next; @@ -60,7 +60,7 @@ function remove(h, key) { } function addBucket(h, key, _cell) { - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return; @@ -103,10 +103,10 @@ function add(h, key) { let h_buckets$1 = new Array(nsize); let ndata_tail = new Array(nsize); h.buckets = h_buckets$1; - for(let i$1 = 0; i$1 < osize; ++i$1){ + for (let i$1 = 0; i$1 < osize; ++i$1) { copyBucket(h_buckets$1, ndata_tail, odata[i$1]); } - for(let i$2 = 0; i$2 < nsize; ++i$2){ + for (let i$2 = 0; i$2 < nsize; ++i$2) { let tail = ndata_tail[i$2]; if (tail !== undefined) { tail.next = undefined; @@ -124,7 +124,7 @@ function has(h, key) { let bucket = h_buckets[nid]; if (bucket !== undefined) { let _cell = bucket; - while(true) { + while (true) { let cell = _cell; if (cell.key === key) { return true; @@ -152,7 +152,7 @@ function size(h) { function fromArray(arr) { let len = arr.length; let v = Belt_internalBucketsType.make(undefined, undefined, len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(v, arr[i]); } return v; @@ -160,7 +160,7 @@ function fromArray(arr) { function mergeMany(h, arr) { let len = arr.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { add(h, arr[i]); } } diff --git a/lib/js/belt_List.js b/lib/js/belt_List.js index 069df3dc72..4c4b08fba9 100644 --- a/lib/js/belt_List.js +++ b/lib/js/belt_List.js @@ -16,10 +16,10 @@ function headExn(x) { return x.hd; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function tail(x) { @@ -34,10 +34,10 @@ function tailExn(x) { return x.tl; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function add(xs, x) { @@ -53,7 +53,7 @@ function get(x, n) { } else { let _x = x; let _n = n; - while(true) { + while (true) { let n$1 = _n; let x$1 = _x; if (!x$1) { @@ -72,14 +72,14 @@ function get(x, n) { function getExn(x, n) { if (n < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let _x = x; let _n = n; - while(true) { + while (true) { let n$1 = _n; let x$1 = _x; if (x$1) { @@ -91,15 +91,15 @@ function getExn(x, n) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function partitionAux(p, _cell, _precX, _precY) { - while(true) { + while (true) { let precY = _precY; let precX = _precX; let cell = _cell; @@ -126,7 +126,7 @@ function partitionAux(p, _cell, _precX, _precY) { } function splitAux(_cell, _precX, _precY) { - while(true) { + while (true) { let precY = _precY; let precX = _precX; let cell = _cell; @@ -152,7 +152,7 @@ function splitAux(_cell, _precX, _precY) { } function copyAuxCont(_cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -170,7 +170,7 @@ function copyAuxCont(_cellX, _prec) { } function copyAuxWitFilter(f, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -194,7 +194,7 @@ function copyAuxWitFilter(f, _cellX, _prec) { } function copyAuxWithFilterIndex(f, _cellX, _prec, _i) { - while(true) { + while (true) { let i = _i; let prec = _prec; let cellX = _cellX; @@ -221,7 +221,7 @@ function copyAuxWithFilterIndex(f, _cellX, _prec, _i) { } function copyAuxWitFilterMap(f, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -245,7 +245,7 @@ function copyAuxWitFilterMap(f, _cellX, _prec) { } function removeAssocAuxWithMap(_cellX, x, _prec, f) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -269,7 +269,7 @@ function removeAssocAuxWithMap(_cellX, x, _prec, f) { } function setAssocAuxWithMap(_cellX, x, k, _prec, eq) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -299,7 +299,7 @@ function setAssocAuxWithMap(_cellX, x, k, _prec, eq) { } function copyAuxWithMap(_cellX, _prec, f) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; if (!cellX) { @@ -317,7 +317,7 @@ function copyAuxWithMap(_cellX, _prec, f) { } function zipAux(_cellX, _cellY, _prec) { - while(true) { + while (true) { let prec = _prec; let cellY = _cellY; let cellX = _cellX; @@ -343,7 +343,7 @@ function zipAux(_cellX, _cellY, _prec) { } function copyAuxWithMap2(f, _cellX, _cellY, _prec) { - while(true) { + while (true) { let prec = _prec; let cellY = _cellY; let cellX = _cellX; @@ -366,7 +366,7 @@ function copyAuxWithMap2(f, _cellX, _cellY, _prec) { } function copyAuxWithMapI(f, _i, _cellX, _prec) { - while(true) { + while (true) { let prec = _prec; let cellX = _cellX; let i = _i; @@ -386,7 +386,7 @@ function copyAuxWithMapI(f, _i, _cellX, _prec) { } function takeAux(_n, _cell, _prec) { - while(true) { + while (true) { let prec = _prec; let cell = _cell; let n = _n; @@ -409,7 +409,7 @@ function takeAux(_n, _cell, _prec) { } function splitAtAux(_n, _cell, _prec) { - while(true) { + while (true) { let prec = _prec; let cell = _cell; let n = _n; @@ -458,7 +458,7 @@ function drop(lst, n) { } else { let _l = lst; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l = _l; if (n$1 === 0) { @@ -580,7 +580,7 @@ function makeByU(n, f) { }; let cur = headX; let i = 1; - while(i < n) { + while (i < n) { let v = { hd: f(i), tl: /* [] */0 @@ -608,7 +608,7 @@ function make(n, v) { }; let cur = headX; let i = 1; - while(i < n) { + while (i < n) { let v$1 = { hd: v, tl: /* [] */0 @@ -623,7 +623,7 @@ function make(n, v) { function length(xs) { let _x = xs; let _acc = 0; - while(true) { + while (true) { let acc = _acc; let x = _x; if (!x) { @@ -636,7 +636,7 @@ function length(xs) { } function fillAux(arr, _i, _x) { - while(true) { + while (true) { let x = _x; let i = _i; if (!x) { @@ -652,7 +652,7 @@ function fillAux(arr, _i, _x) { function fromArray(a) { let _i = a.length - 1 | 0; let _res = /* [] */0; - while(true) { + while (true) { let res = _res; let i = _i; if (i < 0) { @@ -681,7 +681,7 @@ function shuffle(xs) { } function reverseConcat(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -701,7 +701,7 @@ function reverse(l) { } function flattenAux(_prec, _xs) { - while(true) { + while (true) { let xs = _xs; let prec = _prec; if (xs) { @@ -715,7 +715,7 @@ function flattenAux(_prec, _xs) { } function flatten(_xs) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; @@ -744,7 +744,7 @@ function concatMany(xs) { } let len$1 = xs.length; let v = xs[len$1 - 1 | 0]; - for(let i = len$1 - 2 | 0; i >= 0; --i){ + for (let i = len$1 - 2 | 0; i >= 0; --i) { v = concat(xs[i], v); } return v; @@ -753,7 +753,7 @@ function concatMany(xs) { function mapReverseU(l, f) { let _accu = /* [] */0; let _xs = l; - while(true) { + while (true) { let xs = _xs; let accu = _accu; if (!xs) { @@ -775,7 +775,7 @@ function mapReverse(l, f) { } function forEachU(_xs, f) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -795,7 +795,7 @@ function forEach(xs, f) { function forEachWithIndexU(l, f) { let _xs = l; let _i = 0; - while(true) { + while (true) { let i = _i; let xs = _xs; if (!xs) { @@ -815,7 +815,7 @@ function forEachWithIndex(l, f) { } function reduceU(_l, _accu, f) { - while(true) { + while (true) { let accu = _accu; let l = _l; if (!l) { @@ -860,7 +860,7 @@ function reduceWithIndexU(l, acc, f) { let _l = l; let _acc = acc; let _i = 0; - while(true) { + while (true) { let i = _i; let acc$1 = _acc; let l$1 = _l; @@ -884,7 +884,7 @@ function mapReverse2U(l1, l2, f) { let _l1 = l1; let _l2 = l2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1$1 = _l1; @@ -911,7 +911,7 @@ function mapReverse2(l1, l2, f) { } function forEach2U(_l1, _l2, f) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -934,7 +934,7 @@ function forEach2(l1, l2, f) { } function reduce2U(_l1, _l2, _accu, f) { - while(true) { + while (true) { let accu = _accu; let l2 = _l2; let l1 = _l1; @@ -981,7 +981,7 @@ function reduceReverse2(l1, l2, acc, f) { } function everyU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return true; @@ -1001,7 +1001,7 @@ function every(xs, p) { } function someU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1021,7 +1021,7 @@ function some(xs, p) { } function every2U(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1046,7 +1046,7 @@ function every2(l1, l2, p) { } function cmpByLength(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1066,7 +1066,7 @@ function cmpByLength(_l1, _l2) { } function cmpU(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1096,7 +1096,7 @@ function cmp(l1, l2, f) { } function eqU(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1125,7 +1125,7 @@ function eq(l1, l2, f) { } function some2U(_l1, _l2, p) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1150,7 +1150,7 @@ function some2(l1, l2, p) { } function hasU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1170,7 +1170,7 @@ function has(xs, x, eq) { } function getAssocU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -1191,7 +1191,7 @@ function getAssoc(xs, x, eq) { } function hasAssocU(_xs, x, eq) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return false; @@ -1295,7 +1295,7 @@ function sort(xs, cmp) { } function getByU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return; @@ -1316,7 +1316,7 @@ function getBy(xs, p) { } function keepU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; @@ -1345,7 +1345,7 @@ function keep(xs, p) { function keepWithIndexU(xs, p) { let _xs = xs; let _i = 0; - while(true) { + while (true) { let i = _i; let xs$1 = _xs; if (!xs$1) { @@ -1374,7 +1374,7 @@ function keepWithIndex(xs, p) { } function keepMapU(_xs, p) { - while(true) { + while (true) { let xs = _xs; if (!xs) { return /* [] */0; diff --git a/lib/js/belt_MapDict.js b/lib/js/belt_MapDict.js index f906153838..a1d89be3d7 100644 --- a/lib/js/belt_MapDict.js +++ b/lib/js/belt_MapDict.js @@ -133,7 +133,7 @@ function remove(n, x, cmp) { function mergeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1], cmp); } @@ -255,7 +255,7 @@ function removeMany(t, keys, cmp) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { diff --git a/lib/js/belt_MapInt.js b/lib/js/belt_MapInt.js index 9143413026..ceec88c59a 100644 --- a/lib/js/belt_MapInt.js +++ b/lib/js/belt_MapInt.js @@ -127,7 +127,7 @@ function removeMany(t, keys) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { @@ -149,7 +149,7 @@ function removeMany(t, keys) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1]); } diff --git a/lib/js/belt_MapString.js b/lib/js/belt_MapString.js index d5f2530092..27f8b4715f 100644 --- a/lib/js/belt_MapString.js +++ b/lib/js/belt_MapString.js @@ -127,7 +127,7 @@ function removeMany(t, keys) { if (t !== undefined) { let _t = t; let _i = 0; - while(true) { + while (true) { let i = _i; let t$1 = _t; if (i >= len) { @@ -149,7 +149,7 @@ function removeMany(t, keys) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = arr[i]; v = set(v, match[0], match[1]); } diff --git a/lib/js/belt_MutableMap.js b/lib/js/belt_MutableMap.js index 9da165b978..bca2a858d7 100644 --- a/lib/js/belt_MutableMap.js +++ b/lib/js/belt_MutableMap.js @@ -54,7 +54,7 @@ function remove(d, k) { } function removeArrayMutateAux(_t, xs, _i, len, cmp) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -339,7 +339,7 @@ function set(m, e, v) { function mergeManyAux(t, xs, cmp) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { let match = xs[i]; v = Belt_internalAVLtree.updateMutate(v, match[0], match[1], cmp); } diff --git a/lib/js/belt_MutableMapInt.js b/lib/js/belt_MutableMapInt.js index fed12a58e2..16c3b6e468 100644 --- a/lib/js/belt_MutableMapInt.js +++ b/lib/js/belt_MutableMapInt.js @@ -257,7 +257,7 @@ function update(t, x, f) { } function removeArrayMutateAux(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { diff --git a/lib/js/belt_MutableMapString.js b/lib/js/belt_MutableMapString.js index 50346ce2ce..2dc101173e 100644 --- a/lib/js/belt_MutableMapString.js +++ b/lib/js/belt_MutableMapString.js @@ -257,7 +257,7 @@ function update(t, x, f) { } function removeArrayMutateAux(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { diff --git a/lib/js/belt_MutableQueue.js b/lib/js/belt_MutableQueue.js index 6f4af135ad..8cde57fad0 100644 --- a/lib/js/belt_MutableQueue.js +++ b/lib/js/belt_MutableQueue.js @@ -55,10 +55,10 @@ function peekExn(q) { return v.content; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function pop(q) { @@ -91,10 +91,10 @@ function popExn(q) { } } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function popUndefined(q) { @@ -121,7 +121,7 @@ function copy(q) { }; let _prev; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (cell !== undefined) { @@ -152,7 +152,7 @@ function mapU(q, f) { }; let _prev; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (cell !== undefined) { @@ -191,7 +191,7 @@ function size(q) { function forEachU(q, f) { let _cell = q.first; - while(true) { + while (true) { let cell = _cell; if (cell === undefined) { return; @@ -211,7 +211,7 @@ function forEach(q, f) { function reduceU(q, accu, f) { let _accu = accu; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let accu$1 = _accu; if (cell === undefined) { @@ -249,7 +249,7 @@ function transfer(q1, q2) { } function fillAux(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; if (cell === undefined) { @@ -274,7 +274,7 @@ function fromArray(arr) { first: undefined, last: undefined }; - for(let i = 0 ,i_finish = arr.length; i < i_finish; ++i){ + for (let i = 0, i_finish = arr.length; i < i_finish; ++i) { add(q, arr[i]); } return q; diff --git a/lib/js/belt_MutableSet.js b/lib/js/belt_MutableSet.js index bc44cafdd5..51527d9924 100644 --- a/lib/js/belt_MutableSet.js +++ b/lib/js/belt_MutableSet.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len, cmp) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -174,7 +174,7 @@ function add(m, e) { function addArrayMutate(t, xs, cmp) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalAVLset.addMutate(cmp, v, xs[i]); } return v; diff --git a/lib/js/belt_MutableSetInt.js b/lib/js/belt_MutableSetInt.js index 830f3b4e26..3384bc69c6 100644 --- a/lib/js/belt_MutableSetInt.js +++ b/lib/js/belt_MutableSetInt.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -172,7 +172,7 @@ function add(d, k) { function addArrayMutate(t, xs) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalSetInt.addMutate(v, xs[i]); } return v; diff --git a/lib/js/belt_MutableSetString.js b/lib/js/belt_MutableSetString.js index f7a1bbd568..1ff837464f 100644 --- a/lib/js/belt_MutableSetString.js +++ b/lib/js/belt_MutableSetString.js @@ -52,7 +52,7 @@ function remove(d, v) { } function removeMany0(_t, xs, _i, len) { - while(true) { + while (true) { let i = _i; let t = _t; if (i >= len) { @@ -172,7 +172,7 @@ function add(d, k) { function addArrayMutate(t, xs) { let v = t; - for(let i = 0 ,i_finish = xs.length; i < i_finish; ++i){ + for (let i = 0, i_finish = xs.length; i < i_finish; ++i) { v = Belt_internalSetString.addMutate(v, xs[i]); } return v; diff --git a/lib/js/belt_MutableStack.js b/lib/js/belt_MutableStack.js index aa95d97032..cfc6971efc 100644 --- a/lib/js/belt_MutableStack.js +++ b/lib/js/belt_MutableStack.js @@ -68,7 +68,7 @@ function size(s) { if (x !== undefined) { let _x = x; let _acc = 0; - while(true) { + while (true) { let acc = _acc; let x$1 = _x; let x$2 = x$1.tail; @@ -86,7 +86,7 @@ function size(s) { function forEachU(s, f) { let _s = s.root; - while(true) { + while (true) { let s$1 = _s; if (s$1 === undefined) { return; @@ -104,7 +104,7 @@ function forEach(s, f) { } function dynamicPopIterU(s, f) { - while(true) { + while (true) { let match = s.root; if (match === undefined) { return; diff --git a/lib/js/belt_Option.js b/lib/js/belt_Option.js index 699dfdbf58..151ee79694 100644 --- a/lib/js/belt_Option.js +++ b/lib/js/belt_Option.js @@ -33,10 +33,10 @@ function getExn(x) { return Caml_option.valFromOption(x); } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function mapWithDefaultU(opt, $$default, f) { diff --git a/lib/js/belt_Range.js b/lib/js/belt_Range.js index f5b60d1289..f169171631 100644 --- a/lib/js/belt_Range.js +++ b/lib/js/belt_Range.js @@ -2,7 +2,7 @@ function forEachU(s, f, action) { - for(let i = s; i <= f; ++i){ + for (let i = s; i <= f; ++i) { action(i); } } @@ -14,7 +14,7 @@ function forEach(s, f, action) { } function everyU(_s, f, p) { - while(true) { + while (true) { let s = _s; if (s > f) { return true; @@ -36,7 +36,7 @@ function every(s, f, p) { function everyByU(s, f, step, p) { if (step > 0) { let _s = s; - while(true) { + while (true) { let s$1 = _s; if (s$1 > f) { return true; @@ -59,7 +59,7 @@ function everyBy(s, f, step, p) { } function someU(_s, f, p) { - while(true) { + while (true) { let s = _s; if (s > f) { return false; @@ -81,7 +81,7 @@ function some(s, f, p) { function someByU(s, f, step, p) { if (step > 0) { let _s = s; - while(true) { + while (true) { let s$1 = _s; if (s$1 > f) { return false; diff --git a/lib/js/belt_Result.js b/lib/js/belt_Result.js index 24ac6ac449..782d71ec5f 100644 --- a/lib/js/belt_Result.js +++ b/lib/js/belt_Result.js @@ -6,10 +6,10 @@ function getExn(x) { return x._0; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } function mapWithDefaultU(opt, $$default, f) { diff --git a/lib/js/belt_SetDict.js b/lib/js/belt_SetDict.js index f9fcded08d..9ab610ff85 100644 --- a/lib/js/belt_SetDict.js +++ b/lib/js/belt_SetDict.js @@ -69,7 +69,7 @@ function remove(t, x, cmp) { function mergeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key, cmp); } @@ -79,7 +79,7 @@ function mergeMany(h, arr, cmp) { function removeMany(h, arr, cmp) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key, cmp); } diff --git a/lib/js/belt_SetInt.js b/lib/js/belt_SetInt.js index 6c2b170b10..5dd914037d 100644 --- a/lib/js/belt_SetInt.js +++ b/lib/js/belt_SetInt.js @@ -32,7 +32,7 @@ function add(t, x) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key); } @@ -78,7 +78,7 @@ function remove(t, x) { function removeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key); } diff --git a/lib/js/belt_SetString.js b/lib/js/belt_SetString.js index 3c62a4ea0b..e2ad075d50 100644 --- a/lib/js/belt_SetString.js +++ b/lib/js/belt_SetString.js @@ -32,7 +32,7 @@ function add(t, x) { function mergeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = add(v, key); } @@ -78,7 +78,7 @@ function remove(t, x) { function removeMany(h, arr) { let len = arr.length; let v = h; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let key = arr[i]; v = remove(v, key); } diff --git a/lib/js/belt_SortArray.js b/lib/js/belt_SortArray.js index 2ae3650d58..e331099e77 100644 --- a/lib/js/belt_SortArray.js +++ b/lib/js/belt_SortArray.js @@ -3,7 +3,7 @@ let Belt_Array = require("./belt_Array.js"); function sortedLengthAuxMore(xs, _prec, _acc, len, lt) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLengthU(xs, lt) { if (lt(x0, x1)) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -63,7 +63,7 @@ function isSortedU(a, cmp) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -91,7 +91,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -128,7 +128,7 @@ function unionU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -197,7 +197,7 @@ function intersectU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -252,7 +252,7 @@ function diffU(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -306,10 +306,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs, cmp) { } function insertionSort(src, srcofs, dst, dstofs, len, cmp) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && cmp(dst[j], e) > 0) { + while (j >= dstofs && cmp(dst[j], e) > 0) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -376,7 +376,7 @@ function binarySearchByU(sorted, key, cmp) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/js/belt_SortArrayInt.js b/lib/js/belt_SortArrayInt.js index 00a3c25a8e..32605fb67f 100644 --- a/lib/js/belt_SortArrayInt.js +++ b/lib/js/belt_SortArrayInt.js @@ -3,7 +3,7 @@ let Belt_Array = require("./belt_Array.js"); function sortedLengthAuxMore(xs, _prec, _acc, len) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLength(xs) { if (x0 < x1) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -57,7 +57,7 @@ function isSorted(a) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -79,7 +79,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -116,7 +116,7 @@ function union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -178,7 +178,7 @@ function intersect(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -226,7 +226,7 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -273,10 +273,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { } function insertionSort(src, srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && dst[j] > e) { + while (j >= dstofs && dst[j] > e) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -329,7 +329,7 @@ function binarySearch(sorted, key) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/js/belt_SortArrayString.js b/lib/js/belt_SortArrayString.js index 00a3c25a8e..32605fb67f 100644 --- a/lib/js/belt_SortArrayString.js +++ b/lib/js/belt_SortArrayString.js @@ -3,7 +3,7 @@ let Belt_Array = require("./belt_Array.js"); function sortedLengthAuxMore(xs, _prec, _acc, len) { - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -29,7 +29,7 @@ function strictlySortedLength(xs) { if (x0 < x1) { let _prec = x1; let _acc = 2; - while(true) { + while (true) { let acc = _acc; let prec = _prec; if (acc >= len) { @@ -57,7 +57,7 @@ function isSorted(a) { } else { let _i = 0; let last_bound = len - 1 | 0; - while(true) { + while (true) { let i = _i; if (i === last_bound) { return true; @@ -79,7 +79,7 @@ function merge(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -116,7 +116,7 @@ function union(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -178,7 +178,7 @@ function intersect(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -226,7 +226,7 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { let _i2 = src2ofs; let _s2 = src2[src2ofs]; let _d = dstofs; - while(true) { + while (true) { let d = _d; let s2 = _s2; let i2 = _i2; @@ -273,10 +273,10 @@ function diff(src, src1ofs, src1len, src2, src2ofs, src2len, dst, dstofs) { } function insertionSort(src, srcofs, dst, dstofs, len) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let e = src[srcofs + i | 0]; let j = (dstofs + i | 0) - 1 | 0; - while(j >= dstofs && dst[j] > e) { + while (j >= dstofs && dst[j] > e) { dst[j + 1 | 0] = dst[j]; j = j - 1 | 0; }; @@ -329,7 +329,7 @@ function binarySearch(sorted, key) { } else { let _lo = 0; let _hi = len - 1 | 0; - while(true) { + while (true) { let hi$1 = _hi; let lo$1 = _lo; let mid = (lo$1 + hi$1 | 0) / 2 | 0; diff --git a/lib/js/belt_internalAVLset.js b/lib/js/belt_internalAVLset.js index aa3c4de016..a533c380ee 100644 --- a/lib/js/belt_internalAVLset.js +++ b/lib/js/belt_internalAVLset.js @@ -82,7 +82,7 @@ function bal(l, v, r) { } function min0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -108,7 +108,7 @@ function minUndefined(n) { } function max0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -148,7 +148,7 @@ function isEmpty(n) { } function stackAllLeft(_v, _s) { - while(true) { + while (true) { let s = _s; let v = _v; if (v === undefined) { @@ -164,7 +164,7 @@ function stackAllLeft(_v, _s) { } function forEachU(_n, f) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -183,7 +183,7 @@ function forEach(n, f) { } function reduceU(_s, _accu, f) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (s === undefined) { @@ -202,7 +202,7 @@ function reduce(s, accu, f) { } function everyU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return true; @@ -225,7 +225,7 @@ function every(n, p) { } function someU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -346,7 +346,7 @@ function size(n) { } function toListAux(_n, _accu) { - while(true) { + while (true) { let accu = _accu; let n = _n; if (n === undefined) { @@ -366,7 +366,7 @@ function toList(s) { } function checkInvariantInternal(_v) { - while(true) { + while (true) { let v = _v; if (v === undefined) { return; @@ -380,15 +380,15 @@ function checkInvariantInternal(_v) { ) | 0; if (!(diff <= 2 && diff >= -2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_internalAVLset.res", - 319, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_internalAVLset.res", + 319, + 4 + ] + } + }); } checkInvariantInternal(l); _v = r; @@ -397,7 +397,7 @@ function checkInvariantInternal(_v) { } function fillArray(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.v; @@ -416,7 +416,7 @@ function fillArray(_n, _i, arr) { } function fillArrayWithPartition(_n, cursor, arr, p) { - while(true) { + while (true) { let n = _n; let v = n.v; let l = n.l; @@ -442,7 +442,7 @@ function fillArrayWithPartition(_n, cursor, arr, p) { } function fillArrayWithFilter(_n, _i, arr, p) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.v; @@ -472,28 +472,28 @@ function toArray(n) { function fromSortedArrayRevAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - return singleton(arr[off]); + return singleton(arr[off]); case 2 : - let x0 = arr[off]; - let x1 = arr[off - 1 | 0]; - return { - v: x1, - h: 2, - l: singleton(x0), - r: undefined - }; + let x0 = arr[off]; + let x1 = arr[off - 1 | 0]; + return { + v: x1, + h: 2, + l: singleton(x0), + r: undefined + }; case 3 : - let x0$1 = arr[off]; - let x1$1 = arr[off - 1 | 0]; - let x2 = arr[off - 2 | 0]; - return { - v: x1$1, - h: 2, - l: singleton(x0$1), - r: singleton(x2) - }; + let x0$1 = arr[off]; + let x1$1 = arr[off - 1 | 0]; + let x2 = arr[off - 2 | 0]; + return { + v: x1$1, + h: 2, + l: singleton(x0$1), + r: singleton(x2) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayRevAux(arr, off, nl); @@ -506,28 +506,28 @@ function fromSortedArrayRevAux(arr, off, len) { function fromSortedArrayAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - return singleton(arr[off]); + return singleton(arr[off]); case 2 : - let x0 = arr[off]; - let x1 = arr[off + 1 | 0]; - return { - v: x1, - h: 2, - l: singleton(x0), - r: undefined - }; + let x0 = arr[off]; + let x1 = arr[off + 1 | 0]; + return { + v: x1, + h: 2, + l: singleton(x0), + r: undefined + }; case 3 : - let x0$1 = arr[off]; - let x1$1 = arr[off + 1 | 0]; - let x2 = arr[off + 2 | 0]; - return { - v: x1$1, - h: 2, - l: singleton(x0$1), - r: singleton(x2) - }; + let x0$1 = arr[off]; + let x1$1 = arr[off + 1 | 0]; + let x2 = arr[off + 2 | 0]; + return { + v: x1$1, + h: 2, + l: singleton(x0$1), + r: singleton(x2) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayAux(arr, off, nl); @@ -613,7 +613,7 @@ function partitionCopy(n, p) { } function has(_t, x, cmp) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -634,7 +634,7 @@ function cmp(s1, s2, cmp$1) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -665,7 +665,7 @@ function eq(s1, s2, c) { } function subset(_s1, _s2, cmp) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -705,7 +705,7 @@ function subset(_s1, _s2, cmp) { } function get(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -721,7 +721,7 @@ function get(_n, x, cmp) { } function getUndefined(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -737,7 +737,7 @@ function getUndefined(_n, x, cmp) { } function getExn(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -749,10 +749,10 @@ function getExn(_n, x, cmp) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -885,7 +885,7 @@ function fromArray(xs, cmp) { next = -next | 0; result = fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(cmp, result, xs[i]); } return result; diff --git a/lib/js/belt_internalAVLtree.js b/lib/js/belt_internalAVLtree.js index 70f0d5cc11..4cab81d9b4 100644 --- a/lib/js/belt_internalAVLtree.js +++ b/lib/js/belt_internalAVLtree.js @@ -104,7 +104,7 @@ function bal(l, x, d, r) { } function minKey0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -130,7 +130,7 @@ function minKeyUndefined(n) { } function maxKey0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -156,7 +156,7 @@ function maxKeyUndefined(n) { } function minKV0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.l; if (n$1 === undefined) { @@ -185,7 +185,7 @@ function minUndefined(n) { } function maxKV0Aux(_n) { - while(true) { + while (true) { let n = _n; let n$1 = n.r; if (n$1 === undefined) { @@ -229,7 +229,7 @@ function isEmpty(x) { } function stackAllLeft(_v, _s) { - while(true) { + while (true) { let s = _s; let v = _v; if (v === undefined) { @@ -275,7 +275,7 @@ function findFirstBy(n, p) { } function forEachU(_n, f) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -339,7 +339,7 @@ function mapWithKey(n, f) { } function reduceU(_m, _accu, f) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (m === undefined) { @@ -362,7 +362,7 @@ function reduce(m, accu, f) { } function everyU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return true; @@ -385,7 +385,7 @@ function every(n, p) { } function someU(_n, p) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -570,7 +570,7 @@ function size(n) { } function toListAux(_n, _accu) { - while(true) { + while (true) { let accu = _accu; let n = _n; if (n === undefined) { @@ -597,7 +597,7 @@ function toList(s) { } function checkInvariantInternal(_v) { - while(true) { + while (true) { let v = _v; if (v === undefined) { return; @@ -607,15 +607,15 @@ function checkInvariantInternal(_v) { let diff = treeHeight(l) - treeHeight(r) | 0; if (!(diff <= 2 && diff >= -2)) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "belt_internalAVLtree.res", - 457, - 4 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "belt_internalAVLtree.res", + 457, + 4 + ] + } + }); } checkInvariantInternal(l); _v = r; @@ -624,7 +624,7 @@ function checkInvariantInternal(_v) { } function fillArrayKey(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let v = n.k; @@ -643,7 +643,7 @@ function fillArrayKey(_n, _i, arr) { } function fillArrayValue(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let l = n.l; @@ -661,7 +661,7 @@ function fillArrayValue(_n, _i, arr) { } function fillArray(_n, _i, arr) { - while(true) { + while (true) { let i = _i; let n = _n; let l = n.l; @@ -715,36 +715,36 @@ function valuesToArray(n) { function fromSortedArrayRevAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - let match = arr[off]; - return singleton(match[0], match[1]); + let match = arr[off]; + return singleton(match[0], match[1]); case 2 : - let match_0 = arr[off]; - let match_1 = arr[off - 1 | 0]; - let match$1 = match_1; - let match$2 = match_0; - return { - k: match$1[0], - v: match$1[1], - h: 2, - l: singleton(match$2[0], match$2[1]), - r: undefined - }; + let match_0 = arr[off]; + let match_1 = arr[off - 1 | 0]; + let match$1 = match_1; + let match$2 = match_0; + return { + k: match$1[0], + v: match$1[1], + h: 2, + l: singleton(match$2[0], match$2[1]), + r: undefined + }; case 3 : - let match_0$1 = arr[off]; - let match_1$1 = arr[off - 1 | 0]; - let match_2 = arr[off - 2 | 0]; - let match$3 = match_2; - let match$4 = match_1$1; - let match$5 = match_0$1; - return { - k: match$4[0], - v: match$4[1], - h: 2, - l: singleton(match$5[0], match$5[1]), - r: singleton(match$3[0], match$3[1]) - }; + let match_0$1 = arr[off]; + let match_1$1 = arr[off - 1 | 0]; + let match_2 = arr[off - 2 | 0]; + let match$3 = match_2; + let match$4 = match_1$1; + let match$5 = match_0$1; + return { + k: match$4[0], + v: match$4[1], + h: 2, + l: singleton(match$5[0], match$5[1]), + r: singleton(match$3[0], match$3[1]) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayRevAux(arr, off, nl); @@ -757,36 +757,36 @@ function fromSortedArrayRevAux(arr, off, len) { function fromSortedArrayAux(arr, off, len) { switch (len) { case 0 : - return; + return; case 1 : - let match = arr[off]; - return singleton(match[0], match[1]); + let match = arr[off]; + return singleton(match[0], match[1]); case 2 : - let match_0 = arr[off]; - let match_1 = arr[off + 1 | 0]; - let match$1 = match_1; - let match$2 = match_0; - return { - k: match$1[0], - v: match$1[1], - h: 2, - l: singleton(match$2[0], match$2[1]), - r: undefined - }; + let match_0 = arr[off]; + let match_1 = arr[off + 1 | 0]; + let match$1 = match_1; + let match$2 = match_0; + return { + k: match$1[0], + v: match$1[1], + h: 2, + l: singleton(match$2[0], match$2[1]), + r: undefined + }; case 3 : - let match_0$1 = arr[off]; - let match_1$1 = arr[off + 1 | 0]; - let match_2 = arr[off + 2 | 0]; - let match$3 = match_2; - let match$4 = match_1$1; - let match$5 = match_0$1; - return { - k: match$4[0], - v: match$4[1], - h: 2, - l: singleton(match$5[0], match$5[1]), - r: singleton(match$3[0], match$3[1]) - }; + let match_0$1 = arr[off]; + let match_1$1 = arr[off + 1 | 0]; + let match_2 = arr[off + 2 | 0]; + let match$3 = match_2; + let match$4 = match_1$1; + let match$5 = match_0$1; + return { + k: match$4[0], + v: match$4[1], + h: 2, + l: singleton(match$5[0], match$5[1]), + r: singleton(match$3[0], match$3[1]) + }; default: let nl = len / 2 | 0; let left = fromSortedArrayAux(arr, off, nl); @@ -806,7 +806,7 @@ function cmpU(s1, s2, kcmp, vcmp) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -848,7 +848,7 @@ function eqU(s1, s2, kcmp, veq) { if (len1 === len2) { let _e1 = stackAllLeft(s1, /* [] */0); let _e2 = stackAllLeft(s2, /* [] */0); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -878,7 +878,7 @@ function eq(s1, s2, kcmp, veq) { } function get(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -894,7 +894,7 @@ function get(_n, x, cmp) { } function getUndefined(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -910,7 +910,7 @@ function getUndefined(_n, x, cmp) { } function getExn(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -922,15 +922,15 @@ function getExn(_n, x, cmp) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -946,7 +946,7 @@ function getWithDefault(_n, x, def, cmp) { } function has(_n, x, cmp) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -1083,7 +1083,7 @@ function fromArray(xs, cmp) { next = -next | 0; result = fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = updateMutate(result, match[0], match[1], cmp); } diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index bde6492a04..d852fabb9b 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -4,7 +4,7 @@ let Belt_Array = require("./belt_Array.js"); let Caml_option = require("./caml_option.js"); function copyAuxCont(_c, _prec) { - while(true) { + while (true) { let prec = _prec; let c = _c; if (c === undefined) { @@ -38,7 +38,7 @@ function copyBucket(c) { function copyBuckets(buckets) { let len = buckets.length; let newBuckets = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { newBuckets[i] = copyBucket(buckets[i]); } return newBuckets; @@ -54,7 +54,7 @@ function copy(x) { } function bucketLength(_accu, _buckets) { - while(true) { + while (true) { let buckets = _buckets; let accu = _accu; if (buckets === undefined) { @@ -67,7 +67,7 @@ function bucketLength(_accu, _buckets) { } function do_bucket_iter(f, _buckets) { - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -80,7 +80,7 @@ function do_bucket_iter(f, _buckets) { function forEachU(h, f) { let d = h.buckets; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { do_bucket_iter(f, d[i]); } } @@ -92,7 +92,7 @@ function forEach(h, f) { } function do_bucket_fold(f, _b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (b === undefined) { @@ -107,7 +107,7 @@ function do_bucket_fold(f, _b, _accu) { function reduceU(h, init, f) { let d = h.buckets; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = do_bucket_fold(f, d[i], accu); } return accu; @@ -152,7 +152,7 @@ function logStats(h) { } function filterMapInplaceBucket(f, h, i, _prec, _cell) { - while(true) { + while (true) { let cell = _cell; let prec = _prec; let n = cell.next; @@ -188,7 +188,7 @@ function filterMapInplaceBucket(f, h, i, _prec, _cell) { function keepMapInPlaceU(h, f) { let h_buckets = h.buckets; - for(let i = 0 ,i_finish = h_buckets.length; i < i_finish; ++i){ + for (let i = 0, i_finish = h_buckets.length; i < i_finish; ++i) { let v = h_buckets[i]; if (v !== undefined) { filterMapInplaceBucket(f, h, i, undefined, v); @@ -204,7 +204,7 @@ function keepMapInPlace(h, f) { } function fillArray(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = [ @@ -222,7 +222,7 @@ function fillArray(_i, arr, _cell) { } function fillArrayMap(_i, arr, _cell, f) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = f(cell); @@ -240,7 +240,7 @@ function linear(h, f) { let d = h.buckets; let current = 0; let arr = new Array(h.size); - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { let cell = d[i]; if (cell !== undefined) { current = fillArrayMap(current, arr, cell, f); diff --git a/lib/js/belt_internalBucketsType.js b/lib/js/belt_internalBucketsType.js index 2a47c3ac5e..afd6d07891 100644 --- a/lib/js/belt_internalBucketsType.js +++ b/lib/js/belt_internalBucketsType.js @@ -2,7 +2,7 @@ function power_2_above(_x, n) { - while(true) { + while (true) { let x = _x; if (x >= n) { return x; @@ -29,7 +29,7 @@ function clear(h) { h.size = 0; let h_buckets = h.buckets; let len = h_buckets.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { h_buckets[i] = undefined; } } diff --git a/lib/js/belt_internalMapInt.js b/lib/js/belt_internalMapInt.js index 4130367f1b..bf9ea59213 100644 --- a/lib/js/belt_internalMapInt.js +++ b/lib/js/belt_internalMapInt.js @@ -22,7 +22,7 @@ function add(t, x, data) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -37,7 +37,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -52,7 +52,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -63,15 +63,15 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -86,7 +86,7 @@ function getWithDefault(_n, x, def) { } function has(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -215,7 +215,7 @@ function merge(s1, s2, f) { } function compareAux(_e1, _e2, vcmp) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -259,7 +259,7 @@ function cmp(s1, s2, f) { } function eqAux(_e1, _e2, eq) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -331,7 +331,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLtree.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = addMutate(result, match[0], match[1]); } diff --git a/lib/js/belt_internalMapString.js b/lib/js/belt_internalMapString.js index 0397f66799..b0cd11be69 100644 --- a/lib/js/belt_internalMapString.js +++ b/lib/js/belt_internalMapString.js @@ -22,7 +22,7 @@ function add(t, x, data) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -37,7 +37,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -52,7 +52,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.k; @@ -63,15 +63,15 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function getWithDefault(_n, x, def) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return def; @@ -86,7 +86,7 @@ function getWithDefault(_n, x, def) { } function has(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return false; @@ -215,7 +215,7 @@ function merge(s1, s2, f) { } function compareAux(_e1, _e2, vcmp) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -259,7 +259,7 @@ function cmp(s1, s2, f) { } function eqAux(_e1, _e2, eq) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -331,7 +331,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLtree.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { let match = xs[i]; result = addMutate(result, match[0], match[1]); } diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index 95789558f2..ca1846abb0 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -3,7 +3,7 @@ let Belt_Array = require("./belt_Array.js"); function copyAuxCont(_c, _prec) { - while(true) { + while (true) { let prec = _prec; let c = _c; if (c === undefined) { @@ -35,7 +35,7 @@ function copyBucket(c) { function copyBuckets(buckets) { let len = buckets.length; let newBuckets = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { newBuckets[i] = copyBucket(buckets[i]); } return newBuckets; @@ -51,7 +51,7 @@ function copy(x) { } function bucketLength(_accu, _buckets) { - while(true) { + while (true) { let buckets = _buckets; let accu = _accu; if (buckets === undefined) { @@ -64,7 +64,7 @@ function bucketLength(_accu, _buckets) { } function doBucketIter(f, _buckets) { - while(true) { + while (true) { let buckets = _buckets; if (buckets === undefined) { return; @@ -77,7 +77,7 @@ function doBucketIter(f, _buckets) { function forEachU(h, f) { let d = h.buckets; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { doBucketIter(f, d[i]); } } @@ -89,7 +89,7 @@ function forEach(h, f) { } function fillArray(_i, arr, _cell) { - while(true) { + while (true) { let cell = _cell; let i = _i; arr[i] = cell.key; @@ -107,7 +107,7 @@ function toArray(h) { let d = h.buckets; let current = 0; let arr = new Array(h.size); - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { let cell = d[i]; if (cell !== undefined) { current = fillArray(current, arr, cell); @@ -118,7 +118,7 @@ function toArray(h) { } function doBucketFold(f, _b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (b === undefined) { @@ -133,7 +133,7 @@ function doBucketFold(f, _b, _accu) { function reduceU(h, init, f) { let d = h.buckets; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = doBucketFold(f, d[i], accu); } return accu; diff --git a/lib/js/belt_internalSetInt.js b/lib/js/belt_internalSetInt.js index d69005a2ac..d319345d87 100644 --- a/lib/js/belt_internalSetInt.js +++ b/lib/js/belt_internalSetInt.js @@ -4,7 +4,7 @@ let Belt_SortArrayInt = require("./belt_SortArrayInt.js"); let Belt_internalAVLset = require("./belt_internalAVLset.js"); function has(_t, x) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -19,7 +19,7 @@ function has(_t, x) { } function compareAux(_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -62,7 +62,7 @@ function eq(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -101,7 +101,7 @@ function subset(_s1, _s2) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -116,7 +116,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -131,7 +131,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -142,10 +142,10 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -180,7 +180,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLset.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(result, xs[i]); } return result; diff --git a/lib/js/belt_internalSetString.js b/lib/js/belt_internalSetString.js index f2736e5427..de811887c7 100644 --- a/lib/js/belt_internalSetString.js +++ b/lib/js/belt_internalSetString.js @@ -4,7 +4,7 @@ let Belt_internalAVLset = require("./belt_internalAVLset.js"); let Belt_SortArrayString = require("./belt_SortArrayString.js"); function has(_t, x) { - while(true) { + while (true) { let t = _t; if (t === undefined) { return false; @@ -19,7 +19,7 @@ function has(_t, x) { } function compareAux(_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (!e1) { @@ -62,7 +62,7 @@ function eq(s1, s2) { } function subset(_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (s1 === undefined) { @@ -101,7 +101,7 @@ function subset(_s1, _s2) { } function get(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -116,7 +116,7 @@ function get(_n, x) { } function getUndefined(_n, x) { - while(true) { + while (true) { let n = _n; if (n === undefined) { return; @@ -131,7 +131,7 @@ function getUndefined(_n, x) { } function getExn(_n, x) { - while(true) { + while (true) { let n = _n; if (n !== undefined) { let v = n.v; @@ -142,10 +142,10 @@ function getExn(_n, x) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } @@ -180,7 +180,7 @@ function fromArray(xs) { next = -next | 0; result = Belt_internalAVLset.fromSortedArrayRevAux(xs, next - 1 | 0, next); } - for(let i = next; i < len; ++i){ + for (let i = next; i < len; ++i) { result = addMutate(result, xs[i]); } return result; diff --git a/lib/js/buffer.js b/lib/js/buffer.js index 1841872741..c59f4ffe76 100644 --- a/lib/js/buffer.js +++ b/lib/js/buffer.js @@ -27,11 +27,11 @@ function to_bytes(b) { function sub(b, ofs, len) { if (ofs < 0 || len < 0 || ofs > (b.position - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.sub" + } + }); } return Bytes.sub_string(b.buffer, ofs, len); } @@ -39,11 +39,11 @@ function sub(b, ofs, len) { function blit(src, srcoff, dst, dstoff, len) { if (len < 0 || srcoff < 0 || srcoff > (src.position - len | 0) || dstoff < 0 || dstoff > (dst.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.blit" + } + }); } Bytes.blit(src.buffer, srcoff, dst, dstoff, len); } @@ -51,11 +51,11 @@ function blit(src, srcoff, dst, dstoff, len) { function nth(b, ofs) { if (ofs < 0 || ofs >= b.position) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.nth" + } + }); } return b.buffer[ofs]; } @@ -77,7 +77,7 @@ function reset(b) { function resize(b, more) { let len = b.length; let new_len = len; - while((b.position + more | 0) > new_len) { + while ((b.position + more | 0) > new_len) { new_len = (new_len << 1); }; let new_buffer = Caml_bytes.create(new_len); @@ -99,15 +99,15 @@ function add_utf_8_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 98, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 98, + 18 + ] + } + }); } if (u$1 <= 127) { return add_char(b, u$1); @@ -146,30 +146,30 @@ function add_utf_8_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 127, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 127, + 9 + ] + } + }); } function add_utf_16be_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 132, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 132, + 18 + ] + } + }); } if (u$1 <= 65535) { let pos = b.position; @@ -197,30 +197,30 @@ function add_utf_16be_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 154, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 154, + 9 + ] + } + }); } function add_utf_16le_uchar(b, u) { let u$1 = u; if (u$1 < 0) { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 159, - 18 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 159, + 18 + ] + } + }); } if (u$1 <= 65535) { let pos = b.position; @@ -248,25 +248,25 @@ function add_utf_16le_uchar(b, u) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 181, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 181, + 9 + ] + } + }); } function add_substring(b, s, offset, len) { if (offset < 0 || len < 0 || offset > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.add_substring/add_subbytes" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.add_substring/add_subbytes" + } + }); } let new_position = b.position + len | 0; if (new_position > b.length) { @@ -306,30 +306,30 @@ function closing(param) { return /* '}' */125; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "buffer.res", - 216, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "buffer.res", + 216, + 9 + ] + } + }); } function advance_to_closing(opening, closing, k, s, start) { let _k = k; let _i = start; let lim = s.length; - while(true) { + while (true) { let i = _i; let k$1 = _k; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (Caml_string.get(s, i) === opening) { _i = i + 1 | 0; @@ -352,7 +352,7 @@ function advance_to_closing(opening, closing, k, s, start) { function advance_to_non_alpha(s, start) { let _i = start; let lim = s.length; - while(true) { + while (true) { let i = _i; if (i >= lim) { return lim; @@ -384,10 +384,10 @@ function advance_to_non_alpha(s, start) { function find_ident(s, start, lim) { if (start >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Caml_string.get(s, start); if (c !== 40 && c !== 123) { @@ -409,7 +409,7 @@ function add_substitute(b, f, s) { let lim = s.length; let _previous = /* ' ' */32; let _i = 0; - while(true) { + while (true) { let i = _i; let previous = _previous; if (i >= lim) { @@ -456,11 +456,11 @@ function add_substitute(b, f, s) { function truncate(b, len) { if (len < 0 || len > b.position) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Buffer.truncate" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Buffer.truncate" + } + }); } b.position = len; } diff --git a/lib/js/bytes.js b/lib/js/bytes.js index e1a49076b5..b404268df9 100644 --- a/lib/js/bytes.js +++ b/lib/js/bytes.js @@ -9,7 +9,7 @@ function unsafe_fill(s, i, l, c) { if (l <= 0) { return; } - for(let k = i ,k_finish = l + i | 0; k < k_finish; ++k){ + for (let k = i, k_finish = l + i | 0; k < k_finish; ++k) { s[k] = c; } } @@ -23,7 +23,7 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a = (s1.length - i2 | 0) - 1 | 0; let range_b = len - 1 | 0; let range = range_a > range_b ? range_b : range_a; - for(let j = range; j >= 0; --j){ + for (let j = range; j >= 0; --j) { s1[i2 + j | 0] = s1[i1 + j | 0]; } return; @@ -34,22 +34,22 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a$1 = (s1.length - i1 | 0) - 1 | 0; let range_b$1 = len - 1 | 0; let range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(let k = 0; k <= range$1; ++k){ + for (let k = 0; k <= range$1; ++k) { s1[i2 + k | 0] = s1[i1 + k | 0]; } return; } let off1 = s1.length - i1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[i2 + i | 0] = s1[i1 + i | 0]; } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[i2 + i$2 | 0] = /* '\000' */0; } } @@ -62,7 +62,7 @@ function make(n, c) { function init(n, f) { let s = Caml_bytes.create(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { s[i] = f(i); } return s; @@ -86,10 +86,10 @@ function to_string(a) { return String.fromCharCode.apply(null, a); } let offset = 0; - while(s_len > 0) { + while (s_len > 0) { let next = s_len < 1024 ? s_len : 1024; let tmp_bytes = new Array(next); - for(let k = 0; k < next; ++k){ + for (let k = 0; k < next; ++k) { tmp_bytes[k] = a[k + offset | 0]; } s = s + String.fromCharCode.apply(null, tmp_bytes); @@ -102,7 +102,7 @@ function to_string(a) { function of_string(s) { let len = s.length; let res = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { res[i] = s.codePointAt(i); } return res; @@ -111,11 +111,11 @@ function of_string(s) { function sub(s, ofs, len) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.sub / Bytes.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.sub / Bytes.sub" + } + }); } let r = Caml_bytes.create(len); unsafe_blit(s, ofs, r, 0, len); @@ -139,22 +139,22 @@ function $plus$plus(a, b) { return c; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } if (match$1) { return c; } if (match$2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } return c; } @@ -181,11 +181,11 @@ function extend(s, left, right) { function fill(s, ofs, len, c) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.fill / Bytes.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.fill / Bytes.fill" + } + }); } unsafe_fill(s, ofs, len, c); } @@ -193,11 +193,11 @@ function fill(s, ofs, len, c) { function blit(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.blit" + } + }); } unsafe_blit(s1, ofs1, s2, ofs2, len); } @@ -205,38 +205,38 @@ function blit(s1, ofs1, s2, ofs2, len) { function blit_string(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.blit / Bytes.blit_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.blit / Bytes.blit_string" + } + }); } if (len <= 0) { return; } let off1 = s1.length - ofs1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[ofs2 + i | 0] = s1.codePointAt(ofs1 + i | 0); } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[ofs2 + i$1 | 0] = s1.codePointAt(ofs1 + i$1 | 0); } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[ofs2 + i$2 | 0] = /* '\000' */0; } } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -246,15 +246,15 @@ function ensure_ge(x, y) { return x; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.concat" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.concat" + } + }); } function sum_lengths(_acc, seplen, _param) { - while(true) { + while (true) { let param = _param; let acc = _acc; if (!param) { @@ -279,7 +279,7 @@ function concat(sep, param) { let dst = Caml_bytes.create(sum_lengths(0, seplen, param)); let _pos = 0; let _param = param; - while(true) { + while (true) { let param$1 = _param; let pos = _pos; if (!param$1) { @@ -319,11 +319,11 @@ function is_space(param) { function trim(s) { let len = s.length; let i = 0; - while(i < len && is_space(s[i])) { + while (i < len && is_space(s[i])) { i = i + 1 | 0; }; let j = len - 1 | 0; - while(j >= i && is_space(s[j])) { + while (j >= i && is_space(s[j])) { j = j - 1 | 0; }; if (j >= i) { @@ -335,7 +335,7 @@ function trim(s) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -358,7 +358,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -382,20 +382,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -406,32 +406,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } @@ -444,7 +442,7 @@ function map(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(s[i]); } return r; @@ -456,7 +454,7 @@ function mapi(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, s[i]); } return r; @@ -488,14 +486,14 @@ function uncapitalize_ascii(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -510,7 +508,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -531,11 +529,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -544,24 +542,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -578,17 +576,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -608,11 +606,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -621,24 +619,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -649,24 +646,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/js/bytesLabels.js b/lib/js/bytesLabels.js index e1a49076b5..b404268df9 100644 --- a/lib/js/bytesLabels.js +++ b/lib/js/bytesLabels.js @@ -9,7 +9,7 @@ function unsafe_fill(s, i, l, c) { if (l <= 0) { return; } - for(let k = i ,k_finish = l + i | 0; k < k_finish; ++k){ + for (let k = i, k_finish = l + i | 0; k < k_finish; ++k) { s[k] = c; } } @@ -23,7 +23,7 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a = (s1.length - i2 | 0) - 1 | 0; let range_b = len - 1 | 0; let range = range_a > range_b ? range_b : range_a; - for(let j = range; j >= 0; --j){ + for (let j = range; j >= 0; --j) { s1[i2 + j | 0] = s1[i1 + j | 0]; } return; @@ -34,22 +34,22 @@ function unsafe_blit(s1, i1, s2, i2, len) { let range_a$1 = (s1.length - i1 | 0) - 1 | 0; let range_b$1 = len - 1 | 0; let range$1 = range_a$1 > range_b$1 ? range_b$1 : range_a$1; - for(let k = 0; k <= range$1; ++k){ + for (let k = 0; k <= range$1; ++k) { s1[i2 + k | 0] = s1[i1 + k | 0]; } return; } let off1 = s1.length - i1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[i2 + i | 0] = s1[i1 + i | 0]; } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[i2 + i$1 | 0] = s1[i1 + i$1 | 0]; } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[i2 + i$2 | 0] = /* '\000' */0; } } @@ -62,7 +62,7 @@ function make(n, c) { function init(n, f) { let s = Caml_bytes.create(n); - for(let i = 0; i < n; ++i){ + for (let i = 0; i < n; ++i) { s[i] = f(i); } return s; @@ -86,10 +86,10 @@ function to_string(a) { return String.fromCharCode.apply(null, a); } let offset = 0; - while(s_len > 0) { + while (s_len > 0) { let next = s_len < 1024 ? s_len : 1024; let tmp_bytes = new Array(next); - for(let k = 0; k < next; ++k){ + for (let k = 0; k < next; ++k) { tmp_bytes[k] = a[k + offset | 0]; } s = s + String.fromCharCode.apply(null, tmp_bytes); @@ -102,7 +102,7 @@ function to_string(a) { function of_string(s) { let len = s.length; let res = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { res[i] = s.codePointAt(i); } return res; @@ -111,11 +111,11 @@ function of_string(s) { function sub(s, ofs, len) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.sub / Bytes.sub" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.sub / Bytes.sub" + } + }); } let r = Caml_bytes.create(len); unsafe_blit(s, ofs, r, 0, len); @@ -139,22 +139,22 @@ function $plus$plus(a, b) { return c; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } if (match$1) { return c; } if (match$2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.extend" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.extend" + } + }); } return c; } @@ -181,11 +181,11 @@ function extend(s, left, right) { function fill(s, ofs, len, c) { if (ofs < 0 || len < 0 || ofs > (s.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.fill / Bytes.fill" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.fill / Bytes.fill" + } + }); } unsafe_fill(s, ofs, len, c); } @@ -193,11 +193,11 @@ function fill(s, ofs, len, c) { function blit(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.blit" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.blit" + } + }); } unsafe_blit(s1, ofs1, s2, ofs2, len); } @@ -205,38 +205,38 @@ function blit(s1, ofs1, s2, ofs2, len) { function blit_string(s1, ofs1, s2, ofs2, len) { if (len < 0 || ofs1 < 0 || ofs1 > (s1.length - len | 0) || ofs2 < 0 || ofs2 > (s2.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.blit / Bytes.blit_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.blit / Bytes.blit_string" + } + }); } if (len <= 0) { return; } let off1 = s1.length - ofs1 | 0; if (len <= off1) { - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { s2[ofs2 + i | 0] = s1.codePointAt(ofs1 + i | 0); } return; } - for(let i$1 = 0; i$1 < off1; ++i$1){ + for (let i$1 = 0; i$1 < off1; ++i$1) { s2[ofs2 + i$1 | 0] = s1.codePointAt(ofs1 + i$1 | 0); } - for(let i$2 = off1; i$2 < len; ++i$2){ + for (let i$2 = off1; i$2 < len; ++i$2) { s2[ofs2 + i$2 | 0] = /* '\000' */0; } } function iter(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(a[i]); } } function iteri(f, a) { - for(let i = 0 ,i_finish = a.length; i < i_finish; ++i){ + for (let i = 0, i_finish = a.length; i < i_finish; ++i) { f(i, a[i]); } } @@ -246,15 +246,15 @@ function ensure_ge(x, y) { return x; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Bytes.concat" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Bytes.concat" + } + }); } function sum_lengths(_acc, seplen, _param) { - while(true) { + while (true) { let param = _param; let acc = _acc; if (!param) { @@ -279,7 +279,7 @@ function concat(sep, param) { let dst = Caml_bytes.create(sum_lengths(0, seplen, param)); let _pos = 0; let _param = param; - while(true) { + while (true) { let param$1 = _param; let pos = _pos; if (!param$1) { @@ -319,11 +319,11 @@ function is_space(param) { function trim(s) { let len = s.length; let i = 0; - while(i < len && is_space(s[i])) { + while (i < len && is_space(s[i])) { i = i + 1 | 0; }; let j = len - 1 | 0; - while(j >= i && is_space(s[j])) { + while (j >= i && is_space(s[j])) { j = j - 1 | 0; }; if (j >= i) { @@ -335,7 +335,7 @@ function trim(s) { function escaped(s) { let n = 0; - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { let match = s[i]; n = n + ( match >= 32 ? ( @@ -358,7 +358,7 @@ function escaped(s) { } let s$p = Caml_bytes.create(n); n = 0; - for(let i$1 = 0 ,i_finish$1 = s.length; i$1 < i_finish$1; ++i$1){ + for (let i$1 = 0, i_finish$1 = s.length; i$1 < i_finish$1; ++i$1) { let c = s[i$1]; let exit = 0; if (c >= 35) { @@ -382,20 +382,20 @@ function escaped(s) { } else { switch (c) { case 8 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'b' */98; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'b' */98; + break; case 9 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 't' */116; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 't' */116; + break; case 10 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'n' */110; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'n' */110; + break; case 0 : case 1 : case 2 : @@ -406,32 +406,30 @@ function escaped(s) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = /* 'r' */114; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = /* 'r' */114; + break; } } switch (exit) { case 1 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = 48 + (c / 100 | 0) | 0; - n = n + 1 | 0; - s$p[n] = 48 + (c / 10 | 0) % 10 | 0; - n = n + 1 | 0; - s$p[n] = 48 + c % 10 | 0; - break; + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = 48 + (c / 100 | 0) | 0; + n = n + 1 | 0; + s$p[n] = 48 + (c / 10 | 0) % 10 | 0; + n = n + 1 | 0; + s$p[n] = 48 + c % 10 | 0; + break; case 2 : - s$p[n] = /* '\\' */92; - n = n + 1 | 0; - s$p[n] = c; - break; - + s$p[n] = /* '\\' */92; + n = n + 1 | 0; + s$p[n] = c; + break; } n = n + 1 | 0; } @@ -444,7 +442,7 @@ function map(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(s[i]); } return r; @@ -456,7 +454,7 @@ function mapi(f, s) { return s; } let r = Caml_bytes.create(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { r[i] = f(i, s[i]); } return r; @@ -488,14 +486,14 @@ function uncapitalize_ascii(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -510,7 +508,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -531,11 +529,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -544,24 +542,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s[i] === c) { return i; @@ -578,17 +576,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -608,11 +606,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -621,24 +619,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -649,24 +646,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/js/caml_array.js b/lib/js/caml_array.js index b883e460b7..64193ae514 100644 --- a/lib/js/caml_array.js +++ b/lib/js/caml_array.js @@ -5,7 +5,7 @@ function sub(x, offset, len) { let result = new Array(len); let j = 0; let i = offset; - while(j < len) { + while (j < len) { result[j] = x[i]; j = j + 1 | 0; i = i + 1 | 0; @@ -14,7 +14,7 @@ function sub(x, offset, len) { } function len(_acc, _l) { - while(true) { + while (true) { let l = _l; let acc = _acc; if (!l) { @@ -27,7 +27,7 @@ function len(_acc, _l) { } function fill(arr, _i, _l) { - while(true) { + while (true) { let l = _l; let i = _i; if (!l) { @@ -37,7 +37,7 @@ function fill(arr, _i, _l) { let l$1 = x.length; let k = i; let j = 0; - while(j < l$1) { + while (j < l$1) { arr[k] = x[j]; k = k + 1 | 0; j = j + 1 | 0; @@ -58,11 +58,11 @@ function concat(l) { function set(xs, index, newval) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } xs[index] = newval; } @@ -70,18 +70,18 @@ function set(xs, index, newval) { function get(xs, index) { if (index < 0 || index >= xs.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return xs[index]; } function make(len, init) { let b = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { b[i] = init; } return b; @@ -89,7 +89,7 @@ function make(len, init) { function make_float(len) { let b = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { b[i] = 0; } return b; @@ -97,12 +97,12 @@ function make_float(len) { function blit(a1, i1, a2, i2, len) { if (i2 <= i1) { - for(let j = 0; j < len; ++j){ + for (let j = 0; j < len; ++j) { a2[j + i2 | 0] = a1[j + i1 | 0]; } return; } - for(let j$1 = len - 1 | 0; j$1 >= 0; --j$1){ + for (let j$1 = len - 1 | 0; j$1 >= 0; --j$1) { a2[j$1 + i2 | 0] = a1[j$1 + i1 | 0]; } } diff --git a/lib/js/caml_bigint.js b/lib/js/caml_bigint.js index 9e185af4b8..30cda2d9ce 100644 --- a/lib/js/caml_bigint.js +++ b/lib/js/caml_bigint.js @@ -4,10 +4,10 @@ function div(x, y) { if (y === 0n) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x / y; } @@ -15,10 +15,10 @@ function div(x, y) { function mod_(x, y) { if (y === 0n) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x % y; } diff --git a/lib/js/caml_bytes.js b/lib/js/caml_bytes.js index 2cf9ece0c7..b7909d1b9d 100644 --- a/lib/js/caml_bytes.js +++ b/lib/js/caml_bytes.js @@ -4,11 +4,11 @@ function set(s, i, ch) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } s[i] = ch; } @@ -16,11 +16,11 @@ function set(s, i, ch) { function get(s, i) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return s[i]; } @@ -28,21 +28,21 @@ function get(s, i) { function create(len) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.create" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.create" + } + }); } let result = new Array(len); - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { result[i] = /* '\000' */0; } return result; } function bytes_compare_aux(s1, s2, _off, len, def) { - while(true) { + while (true) { let off = _off; if (off >= len) { return def; @@ -77,7 +77,7 @@ function bytes_equal(s1, s2) { let len2 = s2.length; if (len1 === len2) { let _off = 0; - while(true) { + while (true) { let off = _off; if (off === len1) { return true; diff --git a/lib/js/caml_format.js b/lib/js/caml_format.js index b34ad42999..c272d1b695 100644 --- a/lib/js/caml_format.js +++ b/lib/js/caml_format.js @@ -26,14 +26,13 @@ function parse_digit(c) { function int_of_string_base(x) { switch (x) { case "Oct" : - return 8; + return 8; case "Hex" : - return 16; + return 16; case "Dec" : - return 10; + return 10; case "Bin" : - return 2; - + return 2; } } @@ -44,14 +43,12 @@ function parse_sign_and_base(s) { let match = s.codePointAt(i); switch (match) { case 43 : - i = i + 1 | 0; - break; + i = i + 1 | 0; + break; case 45 : - sign = -1; - i = i + 1 | 0; - break; - default: - + sign = -1; + i = i + 1 | 0; + break; } if (s.codePointAt(i) === /* '0' */48) { let match$1 = s.codePointAt(i + 1 | 0); @@ -60,12 +57,12 @@ function parse_sign_and_base(s) { if (match$1 < 121) { switch (match$1) { case 111 : - base = "Oct"; - i = i + 2 | 0; - break; + base = "Oct"; + i = i + 2 | 0; + break; case 117 : - i = i + 2 | 0; - break; + i = i + 2 | 0; + break; case 112 : case 113 : case 114 : @@ -73,12 +70,11 @@ function parse_sign_and_base(s) { case 116 : case 118 : case 119 : - break; + break; case 120 : - base = "Hex"; - i = i + 2 | 0; - break; - + base = "Hex"; + i = i + 2 | 0; + break; } } @@ -91,12 +87,12 @@ function parse_sign_and_base(s) { if (match$1 >= 79) { switch (match$1) { case 79 : - base = "Oct"; - i = i + 2 | 0; - break; + base = "Oct"; + i = i + 2 | 0; + break; case 85 : - i = i + 2 | 0; - break; + i = i + 2 | 0; + break; case 80 : case 81 : case 82 : @@ -104,12 +100,11 @@ function parse_sign_and_base(s) { case 84 : case 86 : case 87 : - break; + break; case 88 : - base = "Hex"; - i = i + 2 | 0; - break; - + base = "Hex"; + i = i + 2 | 0; + break; } } @@ -135,14 +130,14 @@ function int_of_string(s) { let d = parse_digit(c); if (d < 0 || d >= base) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } let aux = function (_acc, _k) { - while(true) { + while (true) { let k = _k; let acc = _acc; if (k === len) { @@ -156,20 +151,20 @@ function int_of_string(s) { let v = parse_digit(a); if (v < 0 || v >= base) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } let acc$1 = base * acc + v; if (acc$1 > threshold) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } _k = k + 1 | 0; _acc = acc$1; @@ -180,11 +175,11 @@ function int_of_string(s) { let or_res = res | 0; if (base === 10 && res !== or_res) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int_of_string" + } + }); } return or_res; } @@ -198,41 +193,40 @@ function int64_of_string(s) { let threshold; switch (hbase) { case "Oct" : - threshold = [ - 536870911, - 4294967295 - ]; - break; + threshold = [ + 536870911, + 4294967295 + ]; + break; case "Hex" : - threshold = [ - 268435455, - 4294967295 - ]; - break; + threshold = [ + 268435455, + 4294967295 + ]; + break; case "Dec" : - threshold = [ - 429496729, - 2576980377 - ]; - break; + threshold = [ + 429496729, + 2576980377 + ]; + break; case "Bin" : - threshold = Caml_int64.max_int; - break; - + threshold = Caml_int64.max_int; + break; } let len = s.length; let c = i < len ? s.codePointAt(i) : /* '\000' */0; let d = Caml_int64.of_int32(parse_digit(c)); if (Caml.i64_lt(d, Caml_int64.zero) || Caml.i64_ge(d, base)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } let aux = function (_acc, _k) { - while(true) { + while (true) { let k = _k; let acc = _acc; if (k === len) { @@ -246,11 +240,11 @@ function int64_of_string(s) { let v = Caml_int64.of_int32(parse_digit(a)); if (Caml.i64_lt(v, Caml_int64.zero) || Caml.i64_ge(v, base) || Caml.i64_gt(acc, threshold)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } let acc$1 = Caml_int64.add(Caml_int64.mul(base, acc), v); _k = k + 1 | 0; @@ -265,11 +259,11 @@ function int64_of_string(s) { 10 ]) && Caml.i64_neq(res, or_res)) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "int64_of_string" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "int64_of_string" + } + }); } return or_res; } @@ -277,12 +271,11 @@ function int64_of_string(s) { function int_of_base(x) { switch (x) { case "Oct" : - return 8; + return 8; case "Hex" : - return 16; + return 16; case "Dec" : - return 10; - + return 10; } } @@ -298,11 +291,11 @@ function parse_format(fmt) { let len = fmt.length; if (len > 31) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "format_int: format too long" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "format_int: format too long" + } + }); } let f = { justify: "+", @@ -318,7 +311,7 @@ function parse_format(fmt) { conv: "f" }; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= len) { return f; @@ -332,27 +325,27 @@ function parse_format(fmt) { } else { switch (c) { case 88 : - f.base = "Hex"; - f.uppercase = true; - _i = i + 1 | 0; - continue; + f.base = "Hex"; + f.uppercase = true; + _i = i + 1 | 0; + continue; case 101 : case 102 : case 103 : - exit = 5; - break; + exit = 5; + break; case 100 : case 105 : - exit = 4; - break; + exit = 4; + break; case 111 : - f.base = "Oct"; - _i = i + 1 | 0; - continue; + f.base = "Oct"; + _i = i + 1 | 0; + continue; case 117 : - f.base = "Dec"; - _i = i + 1 | 0; - continue; + f.base = "Dec"; + _i = i + 1 | 0; + continue; case 89 : case 90 : case 91 : @@ -377,13 +370,12 @@ function parse_format(fmt) { case 116 : case 118 : case 119 : - exit = 1; - break; + exit = 1; + break; case 120 : - f.base = "Hex"; - _i = i + 1 | 0; - continue; - + f.base = "Hex"; + _i = i + 1 | 0; + continue; } } } else if (c >= 72) { @@ -398,33 +390,33 @@ function parse_format(fmt) { } else { switch (c) { case 35 : - f.alternate = true; - _i = i + 1 | 0; - continue; + f.alternate = true; + _i = i + 1 | 0; + continue; case 32 : case 43 : - exit = 2; - break; + exit = 2; + break; case 45 : - f.justify = "-"; - _i = i + 1 | 0; - continue; + f.justify = "-"; + _i = i + 1 | 0; + continue; case 46 : - f.prec = 0; - let j = i + 1 | 0; - while((function () { - let w = fmt.codePointAt(j) - 48 | 0; - return w >= 0 && w <= 9; - })()) { - f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; - j = j + 1 | 0; - }; - _i = j; - continue; + f.prec = 0; + let j = i + 1 | 0; + while ((function () { + let w = fmt.codePointAt(j) - 48 | 0; + return w >= 0 && w <= 9; + })()) { + f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - 48 | 0; + j = j + 1 | 0; + }; + _i = j; + continue; case 48 : - f.filter = "0"; - _i = i + 1 | 0; - continue; + f.filter = "0"; + _i = i + 1 | 0; + continue; case 49 : case 50 : case 51 : @@ -434,43 +426,42 @@ function parse_format(fmt) { case 55 : case 56 : case 57 : - exit = 3; - break; + exit = 3; + break; default: exit = 1; } } switch (exit) { case 1 : - _i = i + 1 | 0; - continue; + _i = i + 1 | 0; + continue; case 2 : - f.signstyle = String.fromCharCode(c); - _i = i + 1 | 0; - continue; + f.signstyle = String.fromCharCode(c); + _i = i + 1 | 0; + continue; case 3 : - f.width = 0; - let j$1 = i; - while((function () { - let w = fmt.codePointAt(j$1) - 48 | 0; - return w >= 0 && w <= 9; - })()) { - f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; - j$1 = j$1 + 1 | 0; - }; - _i = j$1; - continue; + f.width = 0; + let j$1 = i; + while ((function () { + let w = fmt.codePointAt(j$1) - 48 | 0; + return w >= 0 && w <= 9; + })()) { + f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - 48 | 0; + j$1 = j$1 + 1 | 0; + }; + _i = j$1; + continue; case 4 : - f.signedconv = true; - f.base = "Dec"; - _i = i + 1 | 0; - continue; + f.signedconv = true; + f.base = "Dec"; + _i = i + 1 | 0; + continue; case 5 : - f.signedconv = true; - f.conv = String.fromCharCode(c); - _i = i + 1 | 0; - continue; - + f.signedconv = true; + f.conv = String.fromCharCode(c); + _i = i + 1 | 0; + continue; } }; } @@ -499,7 +490,7 @@ function finish_formatting(config, rawbuffer) { } let buffer = ""; if (justify === "+" && filter === " ") { - for(let _for = len; _for < width; ++_for){ + for (let _for = len; _for < width; ++_for) { buffer = buffer + filter; } } @@ -518,13 +509,13 @@ function finish_formatting(config, rawbuffer) { buffer = buffer + "0x"; } if (justify === "+" && filter === "0") { - for(let _for$1 = len; _for$1 < width; ++_for$1){ + for (let _for$1 = len; _for$1 < width; ++_for$1) { buffer = buffer + filter; } } buffer = uppercase ? buffer + rawbuffer.toUpperCase() : buffer + rawbuffer; if (justify === "-") { - for(let _for$2 = len; _for$2 < width; ++_for$2){ + for (let _for$2 = len; _for$2 < width; ++_for$2) { buffer = buffer + " "; } } @@ -588,7 +579,7 @@ function oct_of_int64(x) { ], match[0]); let modulus = match[1]; s = cvtbl[Caml_int64.to_int32(modulus)] + s; - while(Caml.i64_neq(quotient, Caml_int64.zero)) { + while (Caml.i64_neq(quotient, Caml_int64.zero)) { let match$1 = Caml_int64.div_mod(quotient, wbase); quotient = match$1[0]; modulus = match$1[1]; @@ -599,7 +590,7 @@ function oct_of_int64(x) { let quotient$1 = match$2[0]; let modulus$1 = match$2[1]; s = cvtbl[Caml_int64.to_int32(modulus$1)] + s; - while(Caml.i64_neq(quotient$1, Caml_int64.zero)) { + while (Caml.i64_neq(quotient$1, Caml_int64.zero)) { let match$3 = Caml_int64.div_mod(quotient$1, wbase); quotient$1 = match$3[0]; modulus$1 = match$3[1]; @@ -619,15 +610,14 @@ function int64_format(fmt, x) { let s; switch (match) { case "Oct" : - s = oct_of_int64(x$1); - break; + s = oct_of_int64(x$1); + break; case "Hex" : - s = Caml_int64.to_hex(x$1); - break; + s = Caml_int64.to_hex(x$1); + break; case "Dec" : - s = dec_of_pos_int64(x$1); - break; - + s = dec_of_pos_int64(x$1); + break; } let fill_s; if (f.prec >= 0) { @@ -652,62 +642,60 @@ function format_float(fmt, x) { let match = f.conv; switch (match) { case "e" : - s = x$1.toExponential(prec); - let i = s.length; - if (s.codePointAt(i - 3 | 0) === /* 'e' */101) { - s = s.slice(0, i - 1 | 0) + ("0" + s.slice(i - 1 | 0)); - } - break; + s = x$1.toExponential(prec); + let i = s.length; + if (s.codePointAt(i - 3 | 0) === /* 'e' */101) { + s = s.slice(0, i - 1 | 0) + ("0" + s.slice(i - 1 | 0)); + } + break; case "f" : - s = x$1.toFixed(prec); - break; + s = x$1.toFixed(prec); + break; case "g" : - let prec$1 = prec !== 0 ? prec : 1; - s = x$1.toExponential(prec$1 - 1 | 0); - let j = s.indexOf("e"); - let exp = Number(s.slice(j + 1 | 0)) | 0; - if (exp < -4 || x$1 >= 1e21 || x$1.toFixed().length > prec$1) { - let i$1 = j - 1 | 0; - while(s.codePointAt(i$1) === /* '0' */48) { - i$1 = i$1 - 1 | 0; - }; - if (s.codePointAt(i$1) === /* '.' */46) { - i$1 = i$1 - 1 | 0; - } - s = s.slice(0, i$1 + 1 | 0) + s.slice(j); - let i$2 = s.length; - if (s.codePointAt(i$2 - 3 | 0) === /* 'e' */101) { - s = s.slice(0, i$2 - 1 | 0) + ("0" + s.slice(i$2 - 1 | 0)); - } - + let prec$1 = prec !== 0 ? prec : 1; + s = x$1.toExponential(prec$1 - 1 | 0); + let j = s.indexOf("e"); + let exp = Number(s.slice(j + 1 | 0)) | 0; + if (exp < -4 || x$1 >= 1e21 || x$1.toFixed().length > prec$1) { + let i$1 = j - 1 | 0; + while (s.codePointAt(i$1) === /* '0' */48) { + i$1 = i$1 - 1 | 0; + }; + if (s.codePointAt(i$1) === /* '.' */46) { + i$1 = i$1 - 1 | 0; + } + s = s.slice(0, i$1 + 1 | 0) + s.slice(j); + let i$2 = s.length; + if (s.codePointAt(i$2 - 3 | 0) === /* 'e' */101) { + s = s.slice(0, i$2 - 1 | 0) + ("0" + s.slice(i$2 - 1 | 0)); + } + + } else { + let p = prec$1; + if (exp < 0) { + p = p - (exp + 1 | 0) | 0; + s = x$1.toFixed(p); } else { - let p = prec$1; - if (exp < 0) { - p = p - (exp + 1 | 0) | 0; - s = x$1.toFixed(p); - } else { - while((function () { - s = x$1.toFixed(p); - return s.length > (prec$1 + 1 | 0); - })()) { - p = p - 1 | 0; - }; - } - if (p !== 0) { - let k = s.length - 1 | 0; - while(s.codePointAt(k) === /* '0' */48) { - k = k - 1 | 0; - }; - if (s.codePointAt(k) === /* '.' */46) { - k = k - 1 | 0; - } - s = s.slice(0, k + 1 | 0); + while ((function () { + s = x$1.toFixed(p); + return s.length > (prec$1 + 1 | 0); + })()) { + p = p - 1 | 0; + }; + } + if (p !== 0) { + let k = s.length - 1 | 0; + while (s.codePointAt(k) === /* '0' */48) { + k = k - 1 | 0; + }; + if (s.codePointAt(k) === /* '.' */46) { + k = k - 1 | 0; } - + s = s.slice(0, k + 1 | 0); } - break; - default: - + + } + break; } } else { s = "inf"; diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index 62db1bea24..0fbd07cb73 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -52,7 +52,7 @@ function hash(count, _limit, seed, obj) { let num = count; push_back(queue, obj); num = num - 1 | 0; - while(queue.length !== 0 && num > 0) { + while (queue.length !== 0 && num > 0) { let obj$1 = unsafe_pop(queue); if (typeof obj$1 === "number") { let u$1 = obj$1 | 0; @@ -72,7 +72,7 @@ function hash(count, _limit, seed, obj) { s = Caml_hash_primitive.hash_mix_int(s, tag); let v = size - 1 | 0; let block = v < num ? v : num; - for(let i = 0; i <= block; ++i){ + for (let i = 0; i <= block; ++i) { push_back(queue, obj$1[i]); } } diff --git a/lib/js/caml_hash_primitive.js b/lib/js/caml_hash_primitive.js index a691cc43d3..48c71a6725 100644 --- a/lib/js/caml_hash_primitive.js +++ b/lib/js/caml_hash_primitive.js @@ -27,7 +27,7 @@ function hash_mix_string(h, s) { let len = s.length; let block = (len / 4 | 0) - 1 | 0; let hash = h; - for(let i = 0; i <= block; ++i){ + for (let i = 0; i <= block; ++i) { let j = (i << 2); let w = s.charCodeAt(j) | (s.charCodeAt(j + 1 | 0) << 8) | (s.charCodeAt(j + 2 | 0) << 16) | (s.charCodeAt(j + 3 | 0) << 24); hash = hash_mix_int(hash, w); diff --git a/lib/js/caml_int32.js b/lib/js/caml_int32.js index 4c5418e3e9..8bb64e9cba 100644 --- a/lib/js/caml_int32.js +++ b/lib/js/caml_int32.js @@ -4,10 +4,10 @@ function div(x, y) { if (y === 0) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x / y | 0; } @@ -15,10 +15,10 @@ function div(x, y) { function mod_(x, y) { if (y === 0) { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } return x % y; } diff --git a/lib/js/caml_int64.js b/lib/js/caml_int64.js index cd9c2c79b5..10e77156ba 100644 --- a/lib/js/caml_int64.js +++ b/lib/js/caml_int64.js @@ -191,7 +191,7 @@ function is_zero(x) { } function mul(_this, _other) { - while(true) { + while (true) { let other = _other; let $$this = _this; let lo; @@ -374,7 +374,7 @@ function to_string(self) { } function div(_self, _other) { - while(true) { + while (true) { let other = _other; let self = _self; let self_hi = self[0]; @@ -384,10 +384,10 @@ function div(_self, _other) { exit$1 = 2; } else { throw new Error("Division_by_zero", { - cause: { - RE_EXN_ID: "Division_by_zero" - } - }); + cause: { + RE_EXN_ID: "Division_by_zero" + } + }); } if (exit$1 === 2) { if (self_hi !== -2147483648) { @@ -455,14 +455,14 @@ function div(_self, _other) { } let res = zero; let rem$1 = self; - while(Caml.i64_ge(rem$1, other)) { + while (Caml.i64_ge(rem$1, other)) { let b = Math.floor(to_float(rem$1) / to_float(other)); let approx$1 = 1 > b ? 1 : b; let log2 = Math.ceil(Math.log(approx$1) / Math.LN2); let delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); let approxRes = of_float(approx$1); let approxRem = mul(approxRes, other); - while(approxRem[0] < 0 || Caml.i64_gt(approxRem, rem$1)) { + while (approxRem[0] < 0 || Caml.i64_gt(approxRem, rem$1)) { approx$1 = approx$1 - delta; approxRes = of_float(approx$1); approxRem = mul(approxRes, other); diff --git a/lib/js/caml_md5.js b/lib/js/caml_md5.js index 5fb6b27d56..686a1ec3b6 100644 --- a/lib/js/caml_md5.js +++ b/lib/js/caml_md5.js @@ -130,30 +130,30 @@ function md5_string(s, start, len) { state[1] = -271733879; state[2] = -1732584194; state[3] = 271733878; - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { md5blk[i] = 0; } let i_end = n / 64 | 0; - for(let i$1 = 1; i$1 <= i_end; ++i$1){ - for(let j = 0; j <= 15; ++j){ + for (let i$1 = 1; i$1 <= i_end; ++i$1) { + for (let j = 0; j <= 15; ++j) { let k = ((i$1 << 6) - 64 | 0) + (j << 2) | 0; md5blk[j] = ((s$1.charCodeAt(k) + (s$1.charCodeAt(k + 1 | 0) << 8) | 0) + (s$1.charCodeAt(k + 2 | 0) << 16) | 0) + (s$1.charCodeAt(k + 3 | 0) << 24) | 0; } cycle(state, md5blk); } let s_tail = s$1.slice((i_end << 6)); - for(let kk = 0; kk <= 15; ++kk){ + for (let kk = 0; kk <= 15; ++kk) { md5blk[kk] = 0; } let i_end$1 = s_tail.length - 1 | 0; - for(let i$2 = 0; i$2 <= i_end$1; ++i$2){ + for (let i$2 = 0; i$2 <= i_end$1; ++i$2) { md5blk[i$2 / 4 | 0] = md5blk[i$2 / 4 | 0] | (s_tail.charCodeAt(i$2) << (i$2 % 4 << 3)); } let i$3 = i_end$1 + 1 | 0; md5blk[i$3 / 4 | 0] = md5blk[i$3 / 4 | 0] | (128 << (i$3 % 4 << 3)); if (i$3 > 55) { cycle(state, md5blk); - for(let i$4 = 0; i$4 <= 15; ++i$4){ + for (let i$4 = 0; i$4 <= 15; ++i$4) { md5blk[i$4] = 0; } } diff --git a/lib/js/caml_module.js b/lib/js/caml_module.js index cb34132725..32846e33c2 100644 --- a/lib/js/caml_module.js +++ b/lib/js/caml_module.js @@ -5,28 +5,27 @@ let Caml_obj = require("./caml_obj.js"); function init_mod(loc, shape) { let undef_module = function (param) { throw new Error("Undefined_recursive_module", { - cause: { - RE_EXN_ID: "Undefined_recursive_module", - _1: loc - } - }); + cause: { + RE_EXN_ID: "Undefined_recursive_module", + _1: loc + } + }); }; let loop = function (shape, struct_, idx) { if (typeof shape !== "object") { switch (shape) { case "Function" : case "Lazy" : - struct_[idx] = undef_module; - return; + struct_[idx] = undef_module; + return; case "Class" : - struct_[idx] = [ - undef_module, - undef_module, - undef_module, - 0 - ]; - return; - + struct_[idx] = [ + undef_module, + undef_module, + undef_module, + 0 + ]; + return; } } else { if (shape.TAG === "Module") { @@ -34,7 +33,7 @@ function init_mod(loc, shape) { let v = {}; struct_[idx] = v; let len = comps.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { let match = comps[i]; loop(match[0], v, match[1]); } @@ -55,19 +54,18 @@ function update_mod(shape, o, n) { if (typeof shape !== "object") { switch (shape) { case "Function" : - parent[i] = n; - return; + parent[i] = n; + return; case "Lazy" : case "Class" : - return Caml_obj.update_dummy(o, n); - + return Caml_obj.update_dummy(o, n); } } else { if (shape.TAG !== "Module") { return; } let comps = shape._0; - for(let i$1 = 0 ,i_finish = comps.length; i$1 < i_finish; ++i$1){ + for (let i$1 = 0, i_finish = comps.length; i$1 < i_finish; ++i$1) { let match = comps[i$1]; let name = match[1]; aux(match[0], o[name], n[name], o, name); @@ -77,19 +75,19 @@ function update_mod(shape, o, n) { }; if (typeof shape !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "caml_module.res", - 109, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "caml_module.res", + 109, + 9 + ] + } + }); } if (shape.TAG === "Module") { let comps = shape._0; - for(let i = 0 ,i_finish = comps.length; i < i_finish; ++i){ + for (let i = 0, i_finish = comps.length; i < i_finish; ++i) { let match = comps[i]; let name = match[1]; aux(match[0], o[name], n[name], o, name); @@ -97,15 +95,15 @@ function update_mod(shape, o, n) { return; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "caml_module.res", - 109, - 9 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "caml_module.res", + 109, + 9 + ] + } + }); } exports.init_mod = init_mod; diff --git a/lib/js/caml_obj.js b/lib/js/caml_obj.js index 7b027da14f..65e0d78ebc 100644 --- a/lib/js/caml_obj.js +++ b/lib/js/caml_obj.js @@ -44,46 +44,44 @@ function compare(a, b) { let b_type = typeof b; switch (a_type) { case "bigint" : - if (b_type === "bigint") { - return Caml.float_compare(a, b); - } - break; + if (b_type === "bigint") { + return Caml.float_compare(a, b); + } + break; case "boolean" : - if (b_type === "boolean") { - return Caml.bool_compare(a, b); - } - break; + if (b_type === "boolean") { + return Caml.bool_compare(a, b); + } + break; case "function" : - if (b_type === "function") { - throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "compare: functional value" - } - }); - } - break; + if (b_type === "function") { + throw new Error("Invalid_argument", { + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "compare: functional value" + } + }); + } + break; case "number" : - if (b_type === "number") { - return Caml.float_compare(a, b); - } - break; + if (b_type === "number") { + return Caml.float_compare(a, b); + } + break; case "string" : - if (b_type === "string") { - return Caml.string_compare(a, b); - } else { - return 1; - } + if (b_type === "string") { + return Caml.string_compare(a, b); + } else { + return 1; + } case "undefined" : - return -1; - default: - + return -1; } switch (b_type) { case "string" : - return -1; + return -1; case "undefined" : - return 1; + return 1; default: if (a_type === "boolean") { return 1; @@ -139,11 +137,11 @@ function compare(a, b) { } if (tag_a === 251) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: abstract value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: abstract value" + } + }); } if (tag_a !== tag_b) { if (tag_a < tag_b) { @@ -157,7 +155,7 @@ function compare(a, b) { if (len_a === len_b) { if (Array.isArray(a)) { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len_a) { return 0; @@ -176,7 +174,7 @@ function compare(a, b) { } } else if (len_a < len_b) { let _i$1 = 0; - while(true) { + while (true) { let i$1 = _i$1; if (i$1 === len_a) { return -1; @@ -190,7 +188,7 @@ function compare(a, b) { }; } else { let _i$2 = 0; - while(true) { + while (true) { let i$2 = _i$2; if (i$2 === len_b) { return 1; @@ -269,11 +267,11 @@ function equal(a, b) { let b_type = typeof b; if (a_type === "function" || b_type === "function") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: functional value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: functional value" + } + }); } if (b_type === "number" || b_type === "bigint" || b_type === "undefined" || b === null) { return false; @@ -285,11 +283,11 @@ function equal(a, b) { } if (tag_a === 251) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "equal: abstract value" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "equal: abstract value" + } + }); } if (tag_a !== tag_b) { return false; @@ -299,7 +297,7 @@ function equal(a, b) { if (len_a === len_b) { if (Array.isArray(a)) { let _i = 0; - while(true) { + while (true) { let i = _i; if (i === len_a) { return true; diff --git a/lib/js/caml_string.js b/lib/js/caml_string.js index 13f3625959..252ba1b3fd 100644 --- a/lib/js/caml_string.js +++ b/lib/js/caml_string.js @@ -4,11 +4,11 @@ function get(s, i) { if (i >= s.length || i < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" + } + }); } return s.codePointAt(i); } diff --git a/lib/js/caml_sys.js b/lib/js/caml_sys.js index 621591c386..dae731f2ab 100644 --- a/lib/js/caml_sys.js +++ b/lib/js/caml_sys.js @@ -4,20 +4,20 @@ function sys_getenv(s) { if (typeof process === "undefined" || process.env === undefined) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let x = process.env[s]; if (x !== undefined) { return x; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let os_type = (function(_){ @@ -74,20 +74,20 @@ function sys_exit(exit_code) { function sys_is_directory(_s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "sys_is_directory not implemented" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "sys_is_directory not implemented" + } + }); } function sys_file_exists(_s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "sys_file_exists not implemented" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "sys_file_exists not implemented" + } + }); } exports.sys_getenv = sys_getenv; diff --git a/lib/js/camlinternalLazy.js b/lib/js/camlinternalLazy.js index 4125262ab5..a1f4efec8a 100644 --- a/lib/js/camlinternalLazy.js +++ b/lib/js/camlinternalLazy.js @@ -17,10 +17,10 @@ function forward_with_closure(blk, closure) { function raise_undefined() { throw new Error(Undefined, { - cause: { - RE_EXN_ID: Undefined - } - }); + cause: { + RE_EXN_ID: Undefined + } + }); } function force(lzv) { @@ -31,16 +31,15 @@ function force(lzv) { lzv.VAL = raise_undefined; try { return forward_with_closure(lzv, closure); - } - catch (e){ + } catch (e) { lzv.VAL = (function () { throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); }); throw new Error(e.RE_EXN_ID, { - cause: e - }); + cause: e + }); } } } diff --git a/lib/js/char.js b/lib/js/char.js index 2ae5bbaca9..319b877a5b 100644 --- a/lib/js/char.js +++ b/lib/js/char.js @@ -5,11 +5,11 @@ let Bytes = require("./bytes.js"); function chr(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Char.chr" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Char.chr" + } + }); } return n; } @@ -31,11 +31,11 @@ function escaped(param) { } else { switch (param) { case 8 : - return "\\b"; + return "\\b"; case 9 : - return "\\t"; + return "\\t"; case 10 : - return "\\n"; + return "\\n"; case 0 : case 1 : case 2 : @@ -46,31 +46,29 @@ function escaped(param) { case 7 : case 11 : case 12 : - exit = 1; - break; + exit = 1; + break; case 13 : - return "\\r"; - + return "\\r"; } } switch (exit) { case 1 : - let s = [ - 0, - 0, - 0, - 0 - ]; - s[0] = /* '\\' */92; - s[1] = 48 + (param / 100 | 0) | 0; - s[2] = 48 + (param / 10 | 0) % 10 | 0; - s[3] = 48 + param % 10 | 0; - return Bytes.to_string(s); + let s = [ + 0, + 0, + 0, + 0 + ]; + s[0] = /* '\\' */92; + s[1] = 48 + (param / 100 | 0) | 0; + s[2] = 48 + (param / 10 | 0) % 10 | 0; + s[3] = 48 + param % 10 | 0; + return Bytes.to_string(s); case 2 : - let s$1 = [0]; - s$1[0] = param; - return Bytes.to_string(s$1); - + let s$1 = [0]; + s$1[0] = param; + return Bytes.to_string(s$1); } } diff --git a/lib/js/curry.js b/lib/js/curry.js index df8a8980c4..54c46389bf 100644 --- a/lib/js/curry.js +++ b/lib/js/curry.js @@ -3,7 +3,7 @@ let Caml_array = require("./caml_array.js"); function app(_f, _args) { - while(true) { + while (true) { let args = _args; let f = _f; let init_arity = f.length; @@ -31,31 +31,31 @@ function _1(o, a0) { } else { switch (arity) { case 1 : - return o(a0); + return o(a0); case 2 : - return function (param) { - return o(a0, param); - }; + return function (param) { + return o(a0, param); + }; case 3 : - return function (param, param$1) { - return o(a0, param, param$1); - }; + return function (param, param$1) { + return o(a0, param, param$1); + }; case 4 : - return function (param, param$1, param$2) { - return o(a0, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, param, param$1, param$2); + }; case 5 : - return function (param, param$1, param$2, param$3) { - return o(a0, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, param, param$1, param$2, param$3); + }; case 6 : - return function (param, param$1, param$2, param$3, param$4) { - return o(a0, param, param$1, param$2, param$3, param$4); - }; + return function (param, param$1, param$2, param$3, param$4) { + return o(a0, param, param$1, param$2, param$3, param$4); + }; case 7 : - return function (param, param$1, param$2, param$3, param$4, param$5) { - return o(a0, param, param$1, param$2, param$3, param$4, param$5); - }; + return function (param, param$1, param$2, param$3, param$4, param$5) { + return o(a0, param, param$1, param$2, param$3, param$4, param$5); + }; default: return app(o, [a0]); } @@ -80,29 +80,29 @@ function _2(o, a0, a1) { } else { switch (arity) { case 1 : - return app(o(a0), [a1]); + return app(o(a0), [a1]); case 2 : - return o(a0, a1); + return o(a0, a1); case 3 : - return function (param) { - return o(a0, a1, param); - }; + return function (param) { + return o(a0, a1, param); + }; case 4 : - return function (param, param$1) { - return o(a0, a1, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, param, param$1); + }; case 5 : - return function (param, param$1, param$2) { - return o(a0, a1, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, param, param$1, param$2); + }; case 6 : - return function (param, param$1, param$2, param$3) { - return o(a0, a1, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, a1, param, param$1, param$2, param$3); + }; case 7 : - return function (param, param$1, param$2, param$3, param$4) { - return o(a0, a1, param, param$1, param$2, param$3, param$4); - }; + return function (param, param$1, param$2, param$3, param$4) { + return o(a0, a1, param, param$1, param$2, param$3, param$4); + }; default: return app(o, [ a0, @@ -130,30 +130,30 @@ function _3(o, a0, a1, a2) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2 - ]); + return app(o(a0), [ + a1, + a2 + ]); case 2 : - return app(o(a0, a1), [a2]); + return app(o(a0, a1), [a2]); case 3 : - return o(a0, a1, a2); + return o(a0, a1, a2); case 4 : - return function (param) { - return o(a0, a1, a2, param); - }; + return function (param) { + return o(a0, a1, a2, param); + }; case 5 : - return function (param, param$1) { - return o(a0, a1, a2, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, param, param$1); + }; case 6 : - return function (param, param$1, param$2) { - return o(a0, a1, a2, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, a2, param, param$1, param$2); + }; case 7 : - return function (param, param$1, param$2, param$3) { - return o(a0, a1, a2, param, param$1, param$2, param$3); - }; + return function (param, param$1, param$2, param$3) { + return o(a0, a1, a2, param, param$1, param$2, param$3); + }; default: return app(o, [ a0, @@ -182,32 +182,32 @@ function _4(o, a0, a1, a2, a3) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3 - ]); + return app(o(a0), [ + a1, + a2, + a3 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3 - ]); + return app(o(a0, a1), [ + a2, + a3 + ]); case 3 : - return app(o(a0, a1, a2), [a3]); + return app(o(a0, a1, a2), [a3]); case 4 : - return o(a0, a1, a2, a3); + return o(a0, a1, a2, a3); case 5 : - return function (param) { - return o(a0, a1, a2, a3, param); - }; + return function (param) { + return o(a0, a1, a2, a3, param); + }; case 6 : - return function (param, param$1) { - return o(a0, a1, a2, a3, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, a3, param, param$1); + }; case 7 : - return function (param, param$1, param$2) { - return o(a0, a1, a2, a3, param, param$1, param$2); - }; + return function (param, param$1, param$2) { + return o(a0, a1, a2, a3, param, param$1, param$2); + }; default: return app(o, [ a0, @@ -237,35 +237,35 @@ function _5(o, a0, a1, a2, a3, a4) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4 - ]); + return app(o(a0, a1, a2), [ + a3, + a4 + ]); case 4 : - return app(o(a0, a1, a2, a3), [a4]); + return app(o(a0, a1, a2, a3), [a4]); case 5 : - return o(a0, a1, a2, a3, a4); + return o(a0, a1, a2, a3, a4); case 6 : - return function (param) { - return o(a0, a1, a2, a3, a4, param); - }; + return function (param) { + return o(a0, a1, a2, a3, a4, param); + }; case 7 : - return function (param, param$1) { - return o(a0, a1, a2, a3, a4, param, param$1); - }; + return function (param, param$1) { + return o(a0, a1, a2, a3, a4, param, param$1); + }; default: return app(o, [ a0, @@ -296,39 +296,39 @@ function _6(o, a0, a1, a2, a3, a4, a5) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [a5]); + return app(o(a0, a1, a2, a3, a4), [a5]); case 6 : - return o(a0, a1, a2, a3, a4, a5); + return o(a0, a1, a2, a3, a4, a5); case 7 : - return function (param) { - return o(a0, a1, a2, a3, a4, a5, param); - }; + return function (param) { + return o(a0, a1, a2, a3, a4, a5, param); + }; default: return app(o, [ a0, @@ -360,44 +360,44 @@ function _7(o, a0, a1, a2, a3, a4, a5, a6) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5, + a6 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5, + a6 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5, + a6 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5, + a6 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6 - ]); + return app(o(a0, a1, a2, a3, a4), [ + a5, + a6 + ]); case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [a6]); + return app(o(a0, a1, a2, a3, a4, a5), [a6]); case 7 : - return o(a0, a1, a2, a3, a4, a5, a6); + return o(a0, a1, a2, a3, a4, a5, a6); default: return app(o, [ a0, @@ -430,52 +430,52 @@ function _8(o, a0, a1, a2, a3, a4, a5, a6, a7) { } else { switch (arity) { case 1 : - return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0), [ + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 2 : - return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1), [ + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 3 : - return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2), [ + a3, + a4, + a5, + a6, + a7 + ]); case 4 : - return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2, a3), [ + a4, + a5, + a6, + a7 + ]); case 5 : - return app(o(a0, a1, a2, a3, a4), [ - a5, - a6, - a7 - ]); + return app(o(a0, a1, a2, a3, a4), [ + a5, + a6, + a7 + ]); case 6 : - return app(o(a0, a1, a2, a3, a4, a5), [ - a6, - a7 - ]); + return app(o(a0, a1, a2, a3, a4, a5), [ + a6, + a7 + ]); case 7 : - return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); + return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); default: return app(o, [ a0, diff --git a/lib/js/digest.js b/lib/js/digest.js index 51307ddf23..103d5c8fa9 100644 --- a/lib/js/digest.js +++ b/lib/js/digest.js @@ -18,11 +18,11 @@ function bytes(b) { function substring(str, ofs, len) { if (ofs < 0 || len < 0 || ofs > (str.length - len | 0)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.substring" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.substring" + } + }); } return Caml_md5.md5_string(str, ofs, len); } @@ -40,14 +40,14 @@ function char_hex(n) { function to_hex(d) { if (d.length !== 16) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.to_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.to_hex" + } + }); } let result = Caml_bytes.create(32); - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { let x = Caml_string.get(d, i); result[(i << 1)] = char_hex((x >>> 4)); result[(i << 1) + 1 | 0] = char_hex(x & 15); @@ -58,42 +58,42 @@ function to_hex(d) { function from_hex(s) { if (s.length !== 32) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } let digit = function (c) { if (c >= 65) { if (c >= 97) { if (c >= 103) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return (c - /* 'a' */97 | 0) + 10 | 0; } if (c >= 71) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return (c - /* 'A' */65 | 0) + 10 | 0; } if (c > 57 || c < 48) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Digest.from_hex" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Digest.from_hex" + } + }); } return c - /* '0' */48 | 0; }; @@ -101,7 +101,7 @@ function from_hex(s) { return (digit(Caml_string.get(s, i)) << 4) + digit(Caml_string.get(s, i + 1 | 0)) | 0; }; let result = Caml_bytes.create(16); - for(let i = 0; i <= 15; ++i){ + for (let i = 0; i <= 15; ++i) { Caml_bytes.set(result, i, Char.chr(byte((i << 1)))); } return Bytes.unsafe_to_string(result); diff --git a/lib/js/filename.js b/lib/js/filename.js index 530e6fe8cf..4cbda61834 100644 --- a/lib/js/filename.js +++ b/lib/js/filename.js @@ -13,7 +13,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { return current_dir_name; } else { let _n = name.length - 1 | 0; - while(true) { + while (true) { let n = _n; if (n < 0) { return $$String.sub(name, 0, 1); @@ -21,7 +21,7 @@ function generic_basename(is_dir_sep, current_dir_name, name) { if (!is_dir_sep(name, n)) { let _n$1 = n; let p = n + 1 | 0; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 < 0) { return $$String.sub(name, 0, p); @@ -44,21 +44,21 @@ function generic_dirname(is_dir_sep, current_dir_name, name) { return current_dir_name; } else { let _n = name.length - 1 | 0; - while(true) { + while (true) { let n = _n; if (n < 0) { return $$String.sub(name, 0, 1); } if (!is_dir_sep(name, n)) { let _n$1 = n; - while(true) { + while (true) { let n$1 = _n$1; if (n$1 < 0) { return current_dir_name; } if (is_dir_sep(name, n$1)) { let _n$2 = n$1; - while(true) { + while (true) { let n$2 = _n$2; if (n$2 < 0) { return $$String.sub(name, 0, 1); @@ -118,15 +118,14 @@ let temp_dir_name; try { temp_dir_name = Caml_sys.sys_getenv("TMPDIR"); -} -catch (raw_exn){ +} catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { temp_dir_name = "/tmp"; } else { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -135,7 +134,7 @@ function quote(x) { let l = x.length; let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '\'' */39); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { if (Caml_string.get(x, i) === /* '\'' */39) { Buffer.add_string(b, quotequote); } else { @@ -201,15 +200,14 @@ let temp_dir_name$1; try { temp_dir_name$1 = Caml_sys.sys_getenv("TEMP"); -} -catch (raw_exn$1){ +} catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); if (exn$1.RE_EXN_ID === "Not_found") { temp_dir_name$1 = "."; } else { throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } @@ -218,7 +216,7 @@ function quote$1(s) { let b = Buffer.create(l + 20 | 0); Buffer.add_char(b, /* '"' */34); let loop = function (_i) { - while(true) { + while (true) { let i = _i; if (i === l) { return Buffer.add_char(b, /* '"' */34); @@ -236,7 +234,7 @@ function quote$1(s) { }; }; let loop_bs = function (_n, _i) { - while(true) { + while (true) { let i = _i; let n = _n; if (i === l) { @@ -259,7 +257,7 @@ function quote$1(s) { }; }; let add_bs = function (n) { - for(let _j = 1; _j <= n; ++_j){ + for (let _j = 1; _j <= n; ++_j) { Buffer.add_char(b, /* '\\' */92); } }; @@ -321,35 +319,35 @@ let match; switch (Sys.os_type) { case "Cygwin" : - match = [ - current_dir_name$2, - "..", - "/", - is_dir_sep$1, - is_relative$1, - is_implicit$1, - check_suffix$1, - temp_dir_name, - quote, - basename$2, - dirname$2 - ]; - break; + match = [ + current_dir_name$2, + "..", + "/", + is_dir_sep$1, + is_relative$1, + is_implicit$1, + check_suffix$1, + temp_dir_name, + quote, + basename$2, + dirname$2 + ]; + break; case "Win32" : - match = [ - current_dir_name$1, - "..", - "\\", - is_dir_sep$1, - is_relative$1, - is_implicit$1, - check_suffix$1, - temp_dir_name$1, - quote$1, - basename$1, - dirname$1 - ]; - break; + match = [ + current_dir_name$1, + "..", + "\\", + is_dir_sep$1, + is_relative$1, + is_implicit$1, + check_suffix$1, + temp_dir_name$1, + quote$1, + basename$1, + dirname$1 + ]; + break; default: match = [ current_dir_name, @@ -385,25 +383,25 @@ function chop_suffix(name, suff) { let n = name.length - suff.length | 0; if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Filename.chop_suffix" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Filename.chop_suffix" + } + }); } return $$String.sub(name, 0, n); } function extension_len(name) { let _i = name.length - 1 | 0; - while(true) { + while (true) { let i = _i; if (i < 0 || is_dir_sep$2(name, i)) { return 0; } if (Caml_string.get(name, i) === /* '.' */46) { let _i$1 = i - 1 | 0; - while(true) { + while (true) { let i$1 = _i$1; if (i$1 < 0 || is_dir_sep$2(name, i$1)) { return 0; @@ -433,11 +431,11 @@ function chop_extension(name) { let l = extension_len(name); if (l === 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Filename.chop_extension" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Filename.chop_extension" + } + }); } return $$String.sub(name, 0, name.length - l | 0); } diff --git a/lib/js/genlex.js b/lib/js/genlex.js index 55f524893e..e708d6239b 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -52,8 +52,7 @@ function make_lexer(keywords) { let ident_or_keyword = function (id) { try { return Hashtbl.find(kwd_table, id); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return { @@ -62,32 +61,31 @@ function make_lexer(keywords) { }; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; let keyword_or_error = function (c) { let s = Caml_string.make(1, c); try { return Hashtbl.find(kwd_table, s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "Illegal character " + s - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "Illegal character " + s + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } }; let next_token = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return; @@ -105,81 +103,80 @@ function make_lexer(keywords) { case 13 : case 26 : case 32 : - Stream.junk(strm__); - continue; + Stream.junk(strm__); + continue; case 34 : - Stream.junk(strm__); - reset_buffer(); - return { - TAG: "String", - _0: string(strm__) - }; + Stream.junk(strm__); + reset_buffer(); + return { + TAG: "String", + _0: string(strm__) + }; case 39 : - Stream.junk(strm__); - let c$1; - try { - c$1 = char(strm__); + Stream.junk(strm__); + let c$1; + try { + c$1 = char(strm__); + } catch (raw_exn) { + let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.RE_EXN_ID === Stream.Failure) { + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } - catch (raw_exn){ - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === Stream.Failure) { - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + throw new Error(exn.RE_EXN_ID, { + cause: exn + }); + } + let match = Stream.peek(strm__); + if (match !== undefined) { + if (match !== 39) { + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } - let match = Stream.peek(strm__); - if (match !== undefined) { - if (match !== 39) { - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - Stream.junk(strm__); - return { - TAG: "Char", - _0: c$1 - }; + Stream.junk(strm__); + return { + TAG: "Char", + _0: c$1 + }; + } + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" } - throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + }); case 40 : + Stream.junk(strm__); + let match$1 = Stream.peek(strm__); + if (match$1 === 42) { Stream.junk(strm__); - let match$1 = Stream.peek(strm__); - if (match$1 === 42) { - Stream.junk(strm__); - comment(strm__); - return next_token(strm__); - } else { - return keyword_or_error(/* '(' */40); - } + comment(strm__); + return next_token(strm__); + } else { + return keyword_or_error(/* '(' */40); + } case 45 : + Stream.junk(strm__); + let c$2 = Stream.peek(strm__); + if (c$2 !== undefined && !(c$2 > 57 || c$2 < 48)) { Stream.junk(strm__); - let c$2 = Stream.peek(strm__); - if (c$2 !== undefined && !(c$2 > 57 || c$2 < 48)) { - Stream.junk(strm__); - reset_buffer(); - store(/* '-' */45); - store(c$2); - return number(strm__); - } else { - reset_buffer(); - store(/* '-' */45); - return ident2(strm__); - } + reset_buffer(); + store(/* '-' */45); + store(c$2); + return number(strm__); + } else { + reset_buffer(); + store(/* '-' */45); + return ident2(strm__); + } case 48 : case 49 : case 50 : @@ -190,8 +187,8 @@ function make_lexer(keywords) { case 55 : case 56 : case 57 : - exit = 4; - break; + exit = 4; + break; case 0 : case 1 : case 2 : @@ -223,8 +220,8 @@ function make_lexer(keywords) { case 44 : case 46 : case 59 : - exit = 1; - break; + exit = 1; + break; case 33 : case 35 : case 36 : @@ -239,22 +236,21 @@ function make_lexer(keywords) { case 62 : case 63 : case 64 : - exit = 3; - break; - + exit = 3; + break; } } } else { switch (c) { case 92 : case 94 : - exit = 3; - break; + exit = 3; + break; case 91 : case 93 : case 96 : - exit = 1; - break; + exit = 1; + break; default: exit = 2; } @@ -268,55 +264,54 @@ function make_lexer(keywords) { } switch (exit) { case 1 : - Stream.junk(strm__); - return keyword_or_error(c); + Stream.junk(strm__); + return keyword_or_error(c); case 2 : - Stream.junk(strm__); - reset_buffer(); - store(c); - while(true) { - let c$3 = Stream.peek(strm__); - if (c$3 === undefined) { - return ident_or_keyword(get_string()); - } - if (c$3 >= 91) { - if (c$3 > 122 || c$3 < 95) { - if (c$3 > 255 || c$3 < 192) { - return ident_or_keyword(get_string()); - } - - } else if (c$3 === 96) { - return ident_or_keyword(get_string()); - } - - } else if (c$3 >= 48) { - if (!(c$3 > 64 || c$3 < 58)) { + Stream.junk(strm__); + reset_buffer(); + store(c); + while (true) { + let c$3 = Stream.peek(strm__); + if (c$3 === undefined) { + return ident_or_keyword(get_string()); + } + if (c$3 >= 91) { + if (c$3 > 122 || c$3 < 95) { + if (c$3 > 255 || c$3 < 192) { return ident_or_keyword(get_string()); } - } else if (c$3 !== 39) { + } else if (c$3 === 96) { return ident_or_keyword(get_string()); } - Stream.junk(strm__); - store(c$3); - continue; - }; - case 3 : + + } else if (c$3 >= 48) { + if (!(c$3 > 64 || c$3 < 58)) { + return ident_or_keyword(get_string()); + } + + } else if (c$3 !== 39) { + return ident_or_keyword(get_string()); + } Stream.junk(strm__); - reset_buffer(); - store(c); - return ident2(strm__); + store(c$3); + continue; + }; + case 3 : + Stream.junk(strm__); + reset_buffer(); + store(c); + return ident2(strm__); case 4 : - Stream.junk(strm__); - reset_buffer(); - store(c); - return number(strm__); - + Stream.junk(strm__); + reset_buffer(); + store(c); + return number(strm__); } }; }; let ident2 = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return ident_or_keyword(get_string()); @@ -358,7 +353,7 @@ function make_lexer(keywords) { case 56 : case 57 : case 59 : - return ident_or_keyword(get_string()); + return ident_or_keyword(get_string()); case 33 : case 35 : case 36 : @@ -374,8 +369,7 @@ function make_lexer(keywords) { case 62 : case 63 : case 64 : - break; - + break; } } Stream.junk(strm__); @@ -384,7 +378,7 @@ function make_lexer(keywords) { }; }; let number = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c !== undefined) { if (c >= 58) { @@ -404,7 +398,7 @@ function make_lexer(keywords) { } else { Stream.junk(strm__); store(/* '.' */46); - while(true) { + while (true) { let c$1 = Stream.peek(strm__); if (c$1 !== undefined) { if (c$1 > 101 || c$1 < 69) { @@ -445,7 +439,7 @@ function make_lexer(keywords) { } }; let end_exponent_part = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c === undefined) { return { @@ -465,7 +459,7 @@ function make_lexer(keywords) { }; }; let string = function (strm__) { - while(true) { + while (true) { let c = Stream.peek(strm__); if (c !== undefined) { if (c !== 34) { @@ -478,20 +472,19 @@ function make_lexer(keywords) { let c$1; try { c$1 = escape(strm__); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stream.Failure) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } store(c$1); continue; @@ -500,10 +493,10 @@ function make_lexer(keywords) { return get_string(); } throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); }; }; let char = function (strm__) { @@ -516,27 +509,26 @@ function make_lexer(keywords) { Stream.junk(strm__); try { return escape(strm__); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === Stream.Failure) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; let escape = function (strm__) { @@ -545,14 +537,14 @@ function make_lexer(keywords) { if (c1 >= 58) { switch (c1) { case 110 : - Stream.junk(strm__); - return /* '\n' */10; + Stream.junk(strm__); + return /* '\n' */10; case 114 : - Stream.junk(strm__); - return /* '\r' */13; + Stream.junk(strm__); + return /* '\r' */13; case 116 : - Stream.junk(strm__); - return /* '\t' */9; + Stream.junk(strm__); + return /* '\t' */9; default: Stream.junk(strm__); return c1; @@ -564,106 +556,106 @@ function make_lexer(keywords) { if (c2 !== undefined) { if (c2 > 57 || c2 < 48) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } Stream.junk(strm__); let c3 = Stream.peek(strm__); if (c3 !== undefined) { if (c3 > 57 || c3 < 48) { throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); - } - Stream.junk(strm__); - return Char.chr((Math.imul(c1 - 48 | 0, 100) + Math.imul(c2 - 48 | 0, 10) | 0) + (c3 - 48 | 0) | 0); - } - throw new Error(Stream.$$Error, { cause: { RE_EXN_ID: Stream.$$Error, _1: "" } }); + } + Stream.junk(strm__); + return Char.chr((Math.imul(c1 - 48 | 0, 100) + Math.imul(c2 - 48 | 0, 10) | 0) + (c3 - 48 | 0) | 0); + } + throw new Error(Stream.$$Error, { + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } throw new Error(Stream.$$Error, { - cause: { - RE_EXN_ID: Stream.$$Error, - _1: "" - } - }); + cause: { + RE_EXN_ID: Stream.$$Error, + _1: "" + } + }); } Stream.junk(strm__); return c1; } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; let comment = function (strm__) { - while(true) { + while (true) { let match = Stream.peek(strm__); if (match !== undefined) { switch (match) { case 40 : - Stream.junk(strm__); - let match$1 = Stream.peek(strm__); - if (match$1 !== undefined) { - if (match$1 !== 42) { - Stream.junk(strm__); - return comment(strm__); - } else { - Stream.junk(strm__); - comment(strm__); - return comment(strm__); - } + Stream.junk(strm__); + let match$1 = Stream.peek(strm__); + if (match$1 !== undefined) { + if (match$1 !== 42) { + Stream.junk(strm__); + return comment(strm__); + } else { + Stream.junk(strm__); + comment(strm__); + return comment(strm__); } - throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + } + throw new Error(Stream.Failure, { + cause: { + RE_EXN_ID: Stream.Failure + } + }); case 42 : - Stream.junk(strm__); - while(true) { - let match$2 = Stream.peek(strm__); - if (match$2 !== undefined) { - if (match$2 !== 41) { - if (match$2 !== 42) { - Stream.junk(strm__); - return comment(strm__); - } + Stream.junk(strm__); + while (true) { + let match$2 = Stream.peek(strm__); + if (match$2 !== undefined) { + if (match$2 !== 41) { + if (match$2 !== 42) { Stream.junk(strm__); - continue; + return comment(strm__); } Stream.junk(strm__); - return; + continue; } - throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); - }; + Stream.junk(strm__); + return; + } + throw new Error(Stream.Failure, { + cause: { + RE_EXN_ID: Stream.Failure + } + }); + }; default: Stream.junk(strm__); continue; } } else { throw new Error(Stream.Failure, { - cause: { - RE_EXN_ID: Stream.Failure - } - }); + cause: { + RE_EXN_ID: Stream.Failure + } + }); } }; }; diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index e882bc97c2..112833ee17 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -43,7 +43,7 @@ let prng = CamlinternalLazy.from_fun(function () { }); function power_2_above(_x, n) { - while(true) { + while (true) { let x = _x; if (x >= n) { return x; @@ -71,7 +71,7 @@ function create(randomOpt, initial_size) { function clear(h) { h.size = 0; let len = h.data.length; - for(let i = 0; i < len; ++i){ + for (let i = 0; i < len; ++i) { Caml_array.set(h.data, i, "Empty"); } } @@ -95,7 +95,7 @@ function copy_bucketlist(param) { let data = param.data; let next = param.next; let loop = function (_prec, _param) { - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -112,15 +112,15 @@ function copy_bucketlist(param) { }; if (typeof prec !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "hashtbl.res", - 110, - 19 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "hashtbl.res", + 110, + 19 + ] + } + }); } prec.next = r; _param = next; @@ -163,7 +163,7 @@ function resize(indexfun, h) { let inplace = h.initial_size >= 0; h.data = ndata; let insert_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -189,13 +189,13 @@ function resize(indexfun, h) { continue; }; }; - for(let i = 0; i < osize; ++i){ + for (let i = 0; i < osize; ++i) { insert_bucket(Caml_array.get(odata, i)); } if (!inplace) { return; } - for(let i$1 = 0; i$1 < nsize; ++i$1){ + for (let i$1 = 0; i$1 < nsize; ++i$1) { let tail = Caml_array.get(ndata_tail, i$1); if (typeof tail === "object") { tail.next = "Empty"; @@ -228,7 +228,7 @@ function remove(h, key) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -255,10 +255,10 @@ function find(h, key) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -268,10 +268,10 @@ function find(h, key) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -281,10 +281,10 @@ function find(h, key) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -293,14 +293,14 @@ function find(h, key) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -344,7 +344,7 @@ function find_opt(h, key) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -363,7 +363,7 @@ function find_opt(h, key) { function find_all(h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -385,7 +385,7 @@ function find_all(h, key) { } function replace_bucket(key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -424,7 +424,7 @@ function replace(h, key, data) { function mem(h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -441,7 +441,7 @@ function mem(h, key) { function iter(f, h) { let do_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -460,7 +460,7 @@ function iter(f, h) { } try { let d = h.data; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { do_bucket(Caml_array.get(d, i)); } if (!old_trav) { @@ -468,22 +468,21 @@ function iter(f, h) { } else { return; } - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function filter_map_inplace_bucket(f, h, i, _prec, _param) { - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -522,27 +521,26 @@ function filter_map_inplace(f, h) { flip_ongoing_traversal(h); } try { - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { filter_map_inplace_bucket(f, h, i, "Empty", Caml_array.get(h.data, i)); } return; - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function fold(f, h, init) { let do_bucket = function (_b, _accu) { - while(true) { + while (true) { let accu = _accu; let b = _b; if (typeof b !== "object") { @@ -563,29 +561,28 @@ function fold(f, h, init) { try { let d = h.data; let accu = init; - for(let i = 0 ,i_finish = d.length; i < i_finish; ++i){ + for (let i = 0, i_finish = d.length; i < i_finish; ++i) { accu = do_bucket(Caml_array.get(d, i), accu); } if (!old_trav) { flip_ongoing_traversal(h); } return accu; - } - catch (exn){ + } catch (exn) { if (old_trav) { throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } flip_ongoing_traversal(h); throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function bucket_length(_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -638,7 +635,7 @@ function MakeSeeded(H) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -664,10 +661,10 @@ function MakeSeeded(H) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -677,10 +674,10 @@ function MakeSeeded(H) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -690,10 +687,10 @@ function MakeSeeded(H) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -702,14 +699,14 @@ function MakeSeeded(H) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -752,7 +749,7 @@ function MakeSeeded(H) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -770,7 +767,7 @@ function MakeSeeded(H) { }; let find_all = function (h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -791,7 +788,7 @@ function MakeSeeded(H) { return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; let replace_bucket = function (key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -828,7 +825,7 @@ function MakeSeeded(H) { }; let mem = function (h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -886,7 +883,7 @@ function Make(H) { let i = key_index(h, key); let _prec = "Empty"; let _param = Caml_array.get(h.data, i); - while(true) { + while (true) { let param = _param; let prec = _prec; if (typeof param !== "object") { @@ -912,10 +909,10 @@ function Make(H) { let match = Caml_array.get(h.data, key_index(h, key)); if (typeof match !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k1 = match.key; let d1 = match.data; @@ -925,10 +922,10 @@ function Make(H) { } if (typeof next1 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k2 = next1.key; let d2 = next1.data; @@ -938,10 +935,10 @@ function Make(H) { } if (typeof next2 !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k3 = next2.key; let d3 = next2.data; @@ -950,14 +947,14 @@ function Make(H) { return d3; } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let k = param.key; let data = param.data; @@ -1000,7 +997,7 @@ function Make(H) { return Caml_option.some(d3); } else { let _param = next3; - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1018,7 +1015,7 @@ function Make(H) { }; let find_all = function (h, key) { let find_in_bucket = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return /* [] */0; @@ -1039,7 +1036,7 @@ function Make(H) { return find_in_bucket(Caml_array.get(h.data, key_index(h, key))); }; let replace_bucket = function (key, data, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1076,7 +1073,7 @@ function Make(H) { }; let mem = function (h, key) { let _param = Caml_array.get(h.data, key_index(h, key)); - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; diff --git a/lib/js/int32.js b/lib/js/int32.js index ac4211520b..00883d1909 100644 --- a/lib/js/int32.js +++ b/lib/js/int32.js @@ -31,15 +31,14 @@ function to_string(n) { function of_string_opt(s) { try { return Caml_format.int_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/js/int64.js b/lib/js/int64.js index 58018e5256..b46cab5118 100644 --- a/lib/js/int64.js +++ b/lib/js/int64.js @@ -24,15 +24,14 @@ function lognot(n) { function of_string_opt(s) { try { return Caml_format.int64_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/js/js_dict.js b/lib/js/js_dict.js index 4ee3231c38..00f8ce1321 100644 --- a/lib/js/js_dict.js +++ b/lib/js/js_dict.js @@ -17,7 +17,7 @@ function entries(dict) { let keys = Object.keys(dict); let l = keys.length; let values = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let key = keys[i]; values[i] = [ key, @@ -31,7 +31,7 @@ function values(dict) { let keys = Object.keys(dict); let l = keys.length; let values$1 = new Array(l); - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { values$1[i] = dict[keys[i]]; } return values$1; @@ -40,7 +40,7 @@ function values(dict) { function fromList(entries) { let dict = {}; let _x = entries; - while(true) { + while (true) { let x = _x; if (!x) { return dict; @@ -55,7 +55,7 @@ function fromList(entries) { function fromArray(entries) { let dict = {}; let l = entries.length; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let match = entries[i]; dict[match[0]] = match[1]; } @@ -66,7 +66,7 @@ function map(f, source) { let target = {}; let keys = Object.keys(source); let l = keys.length; - for(let i = 0; i < l; ++i){ + for (let i = 0; i < l; ++i) { let key = keys[i]; target[key] = f(source[key]); } diff --git a/lib/js/js_exn.js b/lib/js/js_exn.js index 5229577c1f..706c4b6181 100644 --- a/lib/js/js_exn.js +++ b/lib/js/js_exn.js @@ -3,44 +3,44 @@ function raiseError(str) { throw new Error(new Error(str).RE_EXN_ID, { - cause: new Error(str) - }); + cause: new Error(str) + }); } function raiseEvalError(str) { throw new Error(new EvalError(str).RE_EXN_ID, { - cause: new EvalError(str) - }); + cause: new EvalError(str) + }); } function raiseRangeError(str) { throw new Error(new RangeError(str).RE_EXN_ID, { - cause: new RangeError(str) - }); + cause: new RangeError(str) + }); } function raiseReferenceError(str) { throw new Error(new ReferenceError(str).RE_EXN_ID, { - cause: new ReferenceError(str) - }); + cause: new ReferenceError(str) + }); } function raiseSyntaxError(str) { throw new Error(new SyntaxError(str).RE_EXN_ID, { - cause: new SyntaxError(str) - }); + cause: new SyntaxError(str) + }); } function raiseTypeError(str) { throw new Error(new TypeError(str).RE_EXN_ID, { - cause: new TypeError(str) - }); + cause: new TypeError(str) + }); } function raiseUriError(str) { throw new Error(new URIError(str).RE_EXN_ID, { - cause: new URIError(str) - }); + cause: new URIError(str) + }); } let $$Error$1 = "JsError"; diff --git a/lib/js/js_json.js b/lib/js/js_json.js index b214ef1e15..3dd01e8000 100644 --- a/lib/js/js_json.js +++ b/lib/js/js_json.js @@ -39,22 +39,21 @@ function classify(x) { function test(x, v) { switch (v) { case "String" : - return typeof x === "string"; + return typeof x === "string"; case "Number" : - return typeof x === "number"; + return typeof x === "number"; case "Object" : - if (x !== null && typeof x === "object") { - return !Array.isArray(x); - } else { - return false; - } + if (x !== null && typeof x === "object") { + return !Array.isArray(x); + } else { + return false; + } case "Array" : - return Array.isArray(x); + return Array.isArray(x); case "Boolean" : - return typeof x === "boolean"; + return typeof x === "boolean"; case "Null" : - return x === null; - + return x === null; } } diff --git a/lib/js/js_null.js b/lib/js/js_null.js index 73f42da3cf..7d8ddcb6e1 100644 --- a/lib/js/js_null.js +++ b/lib/js/js_null.js @@ -11,8 +11,8 @@ function getExn(f) { return f; } throw new Error(new Error("Js.Null.getExn").RE_EXN_ID, { - cause: new Error("Js.Null.getExn") - }); + cause: new Error("Js.Null.getExn") + }); } function bind(x, f) { diff --git a/lib/js/js_option.js b/lib/js/js_option.js index bdd59b6389..0b876c2b9a 100644 --- a/lib/js/js_option.js +++ b/lib/js/js_option.js @@ -27,8 +27,8 @@ function getExn(x) { return Caml_option.valFromOption(x); } throw new Error(new Error("getExn").RE_EXN_ID, { - cause: new Error("getExn") - }); + cause: new Error("getExn") + }); } function equal(eq, a, b) { diff --git a/lib/js/js_types.js b/lib/js/js_types.js index b279239d92..47520c6076 100644 --- a/lib/js/js_types.js +++ b/lib/js/js_types.js @@ -49,24 +49,23 @@ function classify(x) { function test(x, v) { switch (v) { case "Undefined" : - return typeof x === "undefined"; + return typeof x === "undefined"; case "Null" : - return x === null; + return x === null; case "Boolean" : - return typeof x === "boolean"; + return typeof x === "boolean"; case "Number" : - return typeof x === "number"; + return typeof x === "number"; case "String" : - return typeof x === "string"; + return typeof x === "string"; case "Function" : - return typeof x === "function"; + return typeof x === "function"; case "Object" : - return typeof x === "object"; + return typeof x === "object"; case "Symbol" : - return typeof x === "symbol"; + return typeof x === "symbol"; case "BigInt" : - return typeof x === "bigint"; - + return typeof x === "bigint"; } } diff --git a/lib/js/js_undefined.js b/lib/js/js_undefined.js index fcbfb19305..567ce8fec5 100644 --- a/lib/js/js_undefined.js +++ b/lib/js/js_undefined.js @@ -15,8 +15,8 @@ function getExn(f) { return f; } throw new Error(new Error("Js.Undefined.getExn").RE_EXN_ID, { - cause: new Error("Js.Undefined.getExn") - }); + cause: new Error("Js.Undefined.getExn") + }); } function bind(x, f) { diff --git a/lib/js/lexing.js b/lib/js/lexing.js index fc24dc97ac..eb3b49462b 100644 --- a/lib/js/lexing.js +++ b/lib/js/lexing.js @@ -55,11 +55,11 @@ function from_function(f) { let newlen = (x.lex_buffer.length << 1); if (((x.lex_buffer_len - x.lex_start_pos | 0) + n | 0) > newlen) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "Lexing.lex_refill: cannot grow buffer" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "Lexing.lex_refill: cannot grow buffer" + } + }); } let newbuf = Caml_bytes.create(newlen); Bytes.blit(x.lex_buffer, x.lex_start_pos, newbuf, 0, x.lex_buffer_len - x.lex_start_pos | 0); @@ -72,7 +72,7 @@ function from_function(f) { x.lex_last_pos = x.lex_last_pos - s | 0; x.lex_buffer_len = x.lex_buffer_len - s | 0; let t = x.lex_mem; - for(let i = 0 ,i_finish = t.length; i < i_finish; ++i){ + for (let i = 0, i_finish = t.length; i < i_finish; ++i) { let v = Caml_array.get(t, i); if (v >= 0) { Caml_array.set(t, i, v - s | 0); diff --git a/lib/js/list.js b/lib/js/list.js index 033c5376c2..46da49279a 100644 --- a/lib/js/list.js +++ b/lib/js/list.js @@ -7,7 +7,7 @@ let Caml_option = require("./caml_option.js"); function length(l) { let _len = 0; let _param = l; - while(true) { + while (true) { let param = _param; let len = _len; if (!param) { @@ -31,11 +31,11 @@ function hd(param) { return param.hd; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "hd" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "hd" + } + }); } function tl(param) { @@ -43,25 +43,25 @@ function tl(param) { return param.tl; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "tl" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "tl" + } + }); } function nth(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (l$1) { @@ -73,26 +73,26 @@ function nth(l, n) { continue; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "nth" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "nth" + } + }); }; } function nth_opt(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (!l$1) { @@ -108,7 +108,7 @@ function nth_opt(l, n) { } function rev_append(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -128,7 +128,7 @@ function rev(l) { } function init_tailrec_aux(_acc, _i, n, f) { - while(true) { + while (true) { let i = _i; let acc = _acc; if (i >= n) { @@ -157,11 +157,11 @@ function init_aux(i, n, f) { function init(len, f) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.init" + } + }); } if (len > 10000) { return rev_append(init_tailrec_aux(/* [] */0, 0, len, f), /* [] */0); @@ -207,7 +207,7 @@ function mapi$1(f, l) { function rev_map(f, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -223,7 +223,7 @@ function rev_map(f, l) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -237,7 +237,7 @@ function iter(f, _param) { function iteri(f, l) { let _i = 0; let _param = l; - while(true) { + while (true) { let param = _param; let i = _i; if (!param) { @@ -251,7 +251,7 @@ function iteri(f, l) { } function fold_left(f, _accu, _l) { - while(true) { + while (true) { let l = _l; let accu = _accu; if (!l) { @@ -281,28 +281,28 @@ function map2(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } function rev_map2(f, l1, l2) { let _accu = /* [] */0; let _l1 = l1; let _l2 = l2; - while(true) { + while (true) { let l2$1 = _l2; let l1$1 = _l1; let accu = _accu; @@ -317,26 +317,26 @@ function rev_map2(f, l1, l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } if (l2$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } return accu; }; } function iter2(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -347,26 +347,26 @@ function iter2(f, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); } if (!l2) { return; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); }; } function fold_left2(f, _accu, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; let accu = _accu; @@ -378,19 +378,19 @@ function fold_left2(f, _accu, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } return accu; }; @@ -402,25 +402,25 @@ function fold_right2(f, l1, l2, accu) { return f(l1.hd, l2.hd, fold_right2(f, l1.tl, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return true; @@ -434,7 +434,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -448,7 +448,7 @@ function exists(p, _param) { } function for_all2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -461,26 +461,26 @@ function for_all2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); } if (!l2) { return true; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); }; } function exists2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -493,26 +493,26 @@ function exists2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); } if (!l2) { return false; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); }; } function mem(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -526,7 +526,7 @@ function mem(x, _param) { } function memq(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -540,7 +540,7 @@ function memq(x, _param) { } function assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -551,15 +551,15 @@ function assoc(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assoc_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -574,7 +574,7 @@ function assoc_opt(x, _param) { } function assq(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -585,15 +585,15 @@ function assq(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assq_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -608,7 +608,7 @@ function assq_opt(x, _param) { } function mem_assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -622,7 +622,7 @@ function mem_assoc(x, _param) { } function mem_assq(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -668,7 +668,7 @@ function remove_assq(x, param) { } function find(p, _param) { - while(true) { + while (true) { let param = _param; if (param) { let x = param.hd; @@ -679,15 +679,15 @@ function find(p, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function find_opt(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -704,7 +704,7 @@ function find_opt(p, _param) { function find_all(p, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -729,7 +729,7 @@ function partition(p, l) { let _yes = /* [] */0; let _no = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let no = _no; let yes = _yes; @@ -791,21 +791,21 @@ function combine(l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } function merge(cmp, l1, l2) { @@ -831,7 +831,7 @@ function merge(cmp, l1, l2) { } function chop(_k, _l) { - while(true) { + while (true) { let l = _l; let k = _k; if (k === 0) { @@ -843,15 +843,15 @@ function chop(_k, _l) { continue; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "list.res", - 420, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "list.res", + 420, + 11 + ] + } + }); }; } @@ -974,7 +974,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1120,7 +1120,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1348,7 +1348,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1579,7 +1579,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1628,7 +1628,7 @@ function sort_uniq(cmp, l) { } function compare_lengths(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1648,7 +1648,7 @@ function compare_lengths(_l1, _l2) { } function compare_length_with(_l, _n) { - while(true) { + while (true) { let n = _n; let l = _l; if (!l) { diff --git a/lib/js/listLabels.js b/lib/js/listLabels.js index 287a2c0f3a..564e9376f2 100644 --- a/lib/js/listLabels.js +++ b/lib/js/listLabels.js @@ -7,7 +7,7 @@ let Caml_option = require("./caml_option.js"); function length(l) { let _len = 0; let _param = l; - while(true) { + while (true) { let param = _param; let len = _len; if (!param) { @@ -31,11 +31,11 @@ function hd(param) { return param.hd; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "hd" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "hd" + } + }); } function tl(param) { @@ -43,25 +43,25 @@ function tl(param) { return param.tl; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "tl" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "tl" + } + }); } function nth(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (l$1) { @@ -73,26 +73,26 @@ function nth(l, n) { continue; } throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: "nth" - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: "nth" + } + }); }; } function nth_opt(l, n) { if (n < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.nth" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.nth" + } + }); } let _l = l; let _n = n; - while(true) { + while (true) { let n$1 = _n; let l$1 = _l; if (!l$1) { @@ -108,7 +108,7 @@ function nth_opt(l, n) { } function rev_append(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -128,7 +128,7 @@ function rev(l) { } function init_tailrec_aux(_acc, _i, n, f) { - while(true) { + while (true) { let i = _i; let acc = _acc; if (i >= n) { @@ -157,11 +157,11 @@ function init_aux(i, n, f) { function init(len, f) { if (len < 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.init" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.init" + } + }); } if (len > 10000) { return rev_append(init_tailrec_aux(/* [] */0, 0, len, f), /* [] */0); @@ -207,7 +207,7 @@ function mapi$1(f, l) { function rev_map(f, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -223,7 +223,7 @@ function rev_map(f, l) { } function iter(f, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -237,7 +237,7 @@ function iter(f, _param) { function iteri(f, l) { let _i = 0; let _param = l; - while(true) { + while (true) { let param = _param; let i = _i; if (!param) { @@ -251,7 +251,7 @@ function iteri(f, l) { } function fold_left(f, _accu, _l) { - while(true) { + while (true) { let l = _l; let accu = _accu; if (!l) { @@ -281,28 +281,28 @@ function map2(f, l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.map2" + } + }); } function rev_map2(f, l1, l2) { let _accu = /* [] */0; let _l1 = l1; let _l2 = l2; - while(true) { + while (true) { let l2$1 = _l2; let l1$1 = _l1; let accu = _accu; @@ -317,26 +317,26 @@ function rev_map2(f, l1, l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } if (l2$1) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.rev_map2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.rev_map2" + } + }); } return accu; }; } function iter2(f, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -347,26 +347,26 @@ function iter2(f, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); } if (!l2) { return; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.iter2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.iter2" + } + }); }; } function fold_left2(f, _accu, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; let accu = _accu; @@ -378,19 +378,19 @@ function fold_left2(f, _accu, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_left2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_left2" + } + }); } return accu; }; @@ -402,25 +402,25 @@ function fold_right2(f, l1, l2, accu) { return f(l1.hd, l2.hd, fold_right2(f, l1.tl, l2.tl, accu)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } if (l2) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.fold_right2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.fold_right2" + } + }); } return accu; } function for_all(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return true; @@ -434,7 +434,7 @@ function for_all(p, _param) { } function exists(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return false; @@ -448,7 +448,7 @@ function exists(p, _param) { } function for_all2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -461,26 +461,26 @@ function for_all2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); } if (!l2) { return true; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.for_all2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.for_all2" + } + }); }; } function exists2(p, _l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (l1) { @@ -493,26 +493,26 @@ function exists2(p, _l1, _l2) { continue; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); } if (!l2) { return false; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.exists2" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.exists2" + } + }); }; } function mem(x, _set) { - while(true) { + while (true) { let set = _set; if (!set) { return false; @@ -526,7 +526,7 @@ function mem(x, _set) { } function memq(x, _set) { - while(true) { + while (true) { let set = _set; if (!set) { return false; @@ -540,7 +540,7 @@ function memq(x, _set) { } function assoc(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -551,15 +551,15 @@ function assoc(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assoc_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -574,7 +574,7 @@ function assoc_opt(x, _param) { } function assq(x, _param) { - while(true) { + while (true) { let param = _param; if (param) { let match = param.hd; @@ -585,15 +585,15 @@ function assq(x, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function assq_opt(x, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -608,7 +608,7 @@ function assq_opt(x, _param) { } function mem_assoc(x, _map) { - while(true) { + while (true) { let map = _map; if (!map) { return false; @@ -622,7 +622,7 @@ function mem_assoc(x, _map) { } function mem_assq(x, _map) { - while(true) { + while (true) { let map = _map; if (!map) { return false; @@ -668,7 +668,7 @@ function remove_assq(x, param) { } function find(p, _param) { - while(true) { + while (true) { let param = _param; if (param) { let x = param.hd; @@ -679,15 +679,15 @@ function find(p, _param) { continue; } throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); }; } function find_opt(p, _param) { - while(true) { + while (true) { let param = _param; if (!param) { return; @@ -704,7 +704,7 @@ function find_opt(p, _param) { function find_all(p, l) { let _accu = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let accu = _accu; if (!param) { @@ -729,7 +729,7 @@ function partition(p, l) { let _yes = /* [] */0; let _no = /* [] */0; let _param = l; - while(true) { + while (true) { let param = _param; let no = _no; let yes = _yes; @@ -791,21 +791,21 @@ function combine(l1, l2) { }; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } if (!l2) { return /* [] */0; } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "List.combine" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "List.combine" + } + }); } function merge(cmp, l1, l2) { @@ -831,7 +831,7 @@ function merge(cmp, l1, l2) { } function chop(_k, _l) { - while(true) { + while (true) { let l = _l; let k = _k; if (k === 0) { @@ -843,15 +843,15 @@ function chop(_k, _l) { continue; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "listLabels.res", - 420, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "listLabels.res", + 420, + 11 + ] + } + }); }; } @@ -974,7 +974,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1120,7 +1120,7 @@ function stable_sort(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1348,7 +1348,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1579,7 +1579,7 @@ function sort_uniq(cmp, l) { let _l1 = s1; let _l2 = s2; let _accu = /* [] */0; - while(true) { + while (true) { let accu = _accu; let l2$1 = _l2; let l1 = _l1; @@ -1628,7 +1628,7 @@ function sort_uniq(cmp, l) { } function compare_lengths(_l1, _l2) { - while(true) { + while (true) { let l2 = _l2; let l1 = _l1; if (!l1) { @@ -1648,7 +1648,7 @@ function compare_lengths(_l1, _l2) { } function compare_length_with(_l, _n) { - while(true) { + while (true) { let n = _n; let l = _l; if (!l) { diff --git a/lib/js/map.js b/lib/js/map.js index cd35da063b..62e301eb40 100644 --- a/lib/js/map.js +++ b/lib/js/map.js @@ -40,11 +40,11 @@ function Make(funarg) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -57,11 +57,11 @@ function Make(funarg) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -75,11 +75,11 @@ function Make(funarg) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -92,11 +92,11 @@ function Make(funarg) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -151,14 +151,14 @@ function Make(funarg) { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = funarg.compare(x, param.v); if (c === 0) { @@ -169,21 +169,21 @@ function Make(funarg) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -209,7 +209,7 @@ function Make(funarg) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -219,7 +219,7 @@ function Make(funarg) { let _v0 = v; let _d0 = param.d; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -245,21 +245,21 @@ function Make(funarg) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -285,7 +285,7 @@ function Make(funarg) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -295,7 +295,7 @@ function Make(funarg) { let _v0 = v; let _d0 = param.d; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let d0 = _d0; let v0 = _v0; @@ -321,7 +321,7 @@ function Make(funarg) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -335,7 +335,7 @@ function Make(funarg) { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -349,14 +349,14 @@ function Make(funarg) { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -370,7 +370,7 @@ function Make(funarg) { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -387,14 +387,14 @@ function Make(funarg) { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -408,7 +408,7 @@ function Make(funarg) { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -427,11 +427,11 @@ function Make(funarg) { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -533,7 +533,7 @@ function Make(funarg) { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -578,7 +578,7 @@ function Make(funarg) { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -590,7 +590,7 @@ function Make(funarg) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -606,7 +606,7 @@ function Make(funarg) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -720,15 +720,15 @@ function Make(funarg) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "map.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "map.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -816,7 +816,7 @@ function Make(funarg) { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -836,7 +836,7 @@ function Make(funarg) { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -865,7 +865,7 @@ function Make(funarg) { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -897,7 +897,7 @@ function Make(funarg) { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { diff --git a/lib/js/mapLabels.js b/lib/js/mapLabels.js index 466d54c7fa..09ef63e715 100644 --- a/lib/js/mapLabels.js +++ b/lib/js/mapLabels.js @@ -40,11 +40,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -57,11 +57,11 @@ function Make(Ord) { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -75,11 +75,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -92,11 +92,11 @@ function Make(Ord) { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -151,14 +151,14 @@ function Make(Ord) { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = Ord.compare(x, param.v); if (c === 0) { @@ -169,7 +169,7 @@ function Make(Ord) { }; }; let find_first_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -191,14 +191,14 @@ function Make(Ord) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -209,7 +209,7 @@ function Make(Ord) { }; }; let find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -231,7 +231,7 @@ function Make(Ord) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -245,7 +245,7 @@ function Make(Ord) { }; }; let find_last_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -267,14 +267,14 @@ function Make(Ord) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -285,7 +285,7 @@ function Make(Ord) { }; }; let find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -307,7 +307,7 @@ function Make(Ord) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -321,7 +321,7 @@ function Make(Ord) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -335,7 +335,7 @@ function Make(Ord) { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -349,14 +349,14 @@ function Make(Ord) { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -370,7 +370,7 @@ function Make(Ord) { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -387,14 +387,14 @@ function Make(Ord) { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -408,7 +408,7 @@ function Make(Ord) { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -427,11 +427,11 @@ function Make(Ord) { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -533,7 +533,7 @@ function Make(Ord) { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -578,7 +578,7 @@ function Make(Ord) { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -590,7 +590,7 @@ function Make(Ord) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -606,7 +606,7 @@ function Make(Ord) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -720,15 +720,15 @@ function Make(Ord) { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -816,7 +816,7 @@ function Make(Ord) { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -836,7 +836,7 @@ function Make(Ord) { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -865,7 +865,7 @@ function Make(Ord) { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -897,7 +897,7 @@ function Make(Ord) { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index baee384c01..0a88535c30 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -70,11 +70,11 @@ let $$Map = { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let lr = l.r; let ld = l.d; @@ -87,11 +87,11 @@ let $$Map = { return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -105,11 +105,11 @@ let $$Map = { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); } let rr = r.r; let rd = r.d; @@ -122,11 +122,11 @@ let $$Map = { return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal" + } + }); }; let is_empty = function (param) { if (typeof param !== "object") { @@ -181,14 +181,14 @@ let $$Map = { } }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let c = funarg.compare(x, param.v); if (c === 0) { @@ -199,7 +199,7 @@ let $$Map = { }; }; let find_first_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -221,14 +221,14 @@ let $$Map = { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -239,7 +239,7 @@ let $$Map = { }; }; let find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -261,7 +261,7 @@ let $$Map = { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -275,7 +275,7 @@ let $$Map = { }; }; let find_last_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -297,14 +297,14 @@ let $$Map = { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -315,7 +315,7 @@ let $$Map = { }; }; let find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { + while (true) { let param = _param; let d0 = _d0; let v0 = _v0; @@ -337,7 +337,7 @@ let $$Map = { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -351,7 +351,7 @@ let $$Map = { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -365,7 +365,7 @@ let $$Map = { }; }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -379,14 +379,14 @@ let $$Map = { }; }; let min_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -400,7 +400,7 @@ let $$Map = { }; }; let min_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -417,14 +417,14 @@ let $$Map = { }; }; let max_binding = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -438,7 +438,7 @@ let $$Map = { }; }; let max_binding_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -457,11 +457,11 @@ let $$Map = { let remove_min_binding = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -563,7 +563,7 @@ let $$Map = { } }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -608,7 +608,7 @@ let $$Map = { }; }; let fold = function (f, _m, _accu) { - while(true) { + while (true) { let accu = _accu; let m = _m; if (typeof m !== "object") { @@ -620,7 +620,7 @@ let $$Map = { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -636,7 +636,7 @@ let $$Map = { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -750,15 +750,15 @@ let $$Map = { } if (typeof s2 !== "object") { throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ] + } + }); } let v2 = s2.v; let match$1 = split(v2, s1); @@ -846,7 +846,7 @@ let $$Map = { } }; let cons_enum = function (_m, _e) { - while(true) { + while (true) { let e = _e; let m = _m; if (typeof m !== "object") { @@ -866,7 +866,7 @@ let $$Map = { let compare = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -895,7 +895,7 @@ let $$Map = { let equal = function (cmp, m1, m2) { let _e1 = cons_enum(m1, "End"); let _e2 = cons_enum(m2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -927,7 +927,7 @@ let $$Map = { } }; let bindings_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1016,11 +1016,11 @@ let $$Set = { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -1032,11 +1032,11 @@ let $$Set = { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -1049,11 +1049,11 @@ let $$Set = { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -1065,11 +1065,11 @@ let $$Set = { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -1144,14 +1144,14 @@ let $$Set = { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1162,7 +1162,7 @@ let $$Set = { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1176,14 +1176,14 @@ let $$Set = { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -1194,7 +1194,7 @@ let $$Set = { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1210,11 +1210,11 @@ let $$Set = { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -1283,7 +1283,7 @@ let $$Set = { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1383,7 +1383,7 @@ let $$Set = { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -1400,7 +1400,7 @@ let $$Set = { }; }; let compare_aux = function (_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -1429,7 +1429,7 @@ let $$Set = { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -1479,7 +1479,7 @@ let $$Set = { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1491,7 +1491,7 @@ let $$Set = { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -1503,7 +1503,7 @@ let $$Set = { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -1519,7 +1519,7 @@ let $$Set = { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -1589,7 +1589,7 @@ let $$Set = { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -1607,14 +1607,14 @@ let $$Set = { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = funarg.compare(x, v); @@ -1626,7 +1626,7 @@ let $$Set = { }; }; let find_first_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1643,14 +1643,14 @@ let $$Set = { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -1661,7 +1661,7 @@ let $$Set = { }; }; let find_first_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1678,7 +1678,7 @@ let $$Set = { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1692,7 +1692,7 @@ let $$Set = { }; }; let find_last_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1709,14 +1709,14 @@ let $$Set = { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -1727,7 +1727,7 @@ let $$Set = { }; }; let find_last_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -1744,7 +1744,7 @@ let $$Set = { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1758,7 +1758,7 @@ let $$Set = { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -1799,28 +1799,54 @@ let $$Set = { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1831,52 +1857,24 @@ let $$Set = { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -1889,15 +1887,15 @@ let $$Set = { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l), l)[0]; }; diff --git a/lib/js/parsing.js b/lib/js/parsing.js index a5da32f420..72a439cfa8 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -74,68 +74,65 @@ function yyparse(tables, start, lexer, lexbuf) { try { let _cmd = "Start"; let _arg; - while(true) { + while (true) { let arg = _arg; let cmd = _cmd; let match = Caml_parser.parse_engine(tables, env, cmd, arg); switch (match) { case "Read_token" : - let t = lexer(lexbuf); - env.symb_start = lexbuf.lex_start_p; - env.symb_end = lexbuf.lex_curr_p; - _arg = t; - _cmd = "Token_read"; - continue; + let t = lexer(lexbuf); + env.symb_start = lexbuf.lex_start_p; + env.symb_end = lexbuf.lex_curr_p; + _arg = t; + _cmd = "Token_read"; + continue; case "Raise_parse_error" : - throw new Error(Parse_error, { - cause: { - RE_EXN_ID: Parse_error - } - }); + throw new Error(Parse_error, { + cause: { + RE_EXN_ID: Parse_error + } + }); case "Grow_stacks_1" : - grow_stacks(); - _arg = undefined; - _cmd = "Stacks_grown_1"; - continue; + grow_stacks(); + _arg = undefined; + _cmd = "Stacks_grown_1"; + continue; case "Grow_stacks_2" : - grow_stacks(); - _arg = undefined; - _cmd = "Stacks_grown_2"; - continue; + grow_stacks(); + _arg = undefined; + _cmd = "Stacks_grown_2"; + continue; case "Compute_semantic_action" : - let match$1; - try { + let match$1; + try { + match$1 = [ + "Semantic_action_computed", + Caml_array.get(tables.actions, env.rule_number)(env) + ]; + } catch (raw_exn) { + let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); + if (exn.RE_EXN_ID === Parse_error) { match$1 = [ - "Semantic_action_computed", - Caml_array.get(tables.actions, env.rule_number)(env) + "Error_detected", + undefined ]; + } else { + throw new Error(exn.RE_EXN_ID, { + cause: exn + }); } - catch (raw_exn){ - let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); - if (exn.RE_EXN_ID === Parse_error) { - match$1 = [ - "Error_detected", - undefined - ]; - } else { - throw new Error(exn.RE_EXN_ID, { - cause: exn - }); - } - } - _arg = match$1[1]; - _cmd = match$1[0]; - continue; + } + _arg = match$1[1]; + _cmd = match$1[0]; + continue; case "Call_error_function" : - tables.error_function("syntax error"); - _arg = undefined; - _cmd = "Error_detected"; - continue; - + tables.error_function("syntax error"); + _arg = undefined; + _cmd = "Error_detected"; + continue; } }; - } - catch (raw_exn$1){ + } catch (raw_exn$1) { let exn$1 = Caml_js_exceptions.internalToOCamlException(raw_exn$1); let curr_char = env.curr_char; env.asp = init_asp; @@ -156,8 +153,8 @@ function yyparse(tables, start, lexer, lexbuf) { } }); throw new Error(exn$1.RE_EXN_ID, { - cause: exn$1 - }); + cause: exn$1 + }); } } @@ -167,7 +164,7 @@ function peek_val(env, n) { function symbol_start_pos() { let _i = env.rule_len; - while(true) { + while (true) { let i = _i; if (i <= 0) { return Caml_array.get(env.symb_end_stack, env.asp); diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index f849b7806a..adb37289e3 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -8,20 +8,20 @@ let Caml_js_exceptions = require("./caml_js_exceptions.js"); function failwith(s) { throw new Error("Failure", { - cause: { - RE_EXN_ID: "Failure", - _1: s - } - }); + cause: { + RE_EXN_ID: "Failure", + _1: s + } + }); } function invalid_arg(s) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } let Exit = /* @__PURE__ */Caml_exceptions.create("Pervasives.Exit"); @@ -59,11 +59,11 @@ function classify_float(x) { function char_of_int(n) { if (n < 0 || n > 255) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "char_of_int" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "char_of_int" + } + }); } return n; } @@ -79,25 +79,25 @@ function string_of_bool(b) { function bool_of_string(param) { switch (param) { case "false" : - return false; + return false; case "true" : - return true; + return true; default: throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "bool_of_string" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "bool_of_string" + } + }); } } function bool_of_string_opt(param) { switch (param) { case "false" : - return false; + return false; case "true" : - return true; + return true; default: return; } @@ -106,22 +106,21 @@ function bool_of_string_opt(param) { function int_of_string_opt(s) { try { return Caml_format.int_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } function valid_float_lexem(s) { let l = s.length; let _i = 0; - while(true) { + while (true) { let i = _i; if (i >= l) { return s + "."; @@ -149,15 +148,14 @@ function string_of_float(f) { function float_of_string_opt(s) { try { return Caml_format.float_of_string(s); - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Failure") { return; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } diff --git a/lib/js/queue.js b/lib/js/queue.js index ca975f36f1..eaf58a010c 100644 --- a/lib/js/queue.js +++ b/lib/js/queue.js @@ -42,20 +42,20 @@ function peek(q) { return match.content; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function take(q) { let match = q.first; if (typeof match !== "object") { throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } let content = match.content; let next = match.next; @@ -76,7 +76,7 @@ function copy(q) { }; let _prev = "Nil"; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let prev = _prev; if (typeof cell !== "object") { @@ -110,7 +110,7 @@ function length(q) { function iter(f, q) { let _cell = q.first; - while(true) { + while (true) { let cell = _cell; if (typeof cell !== "object") { return; @@ -125,7 +125,7 @@ function iter(f, q) { function fold(f, accu, q) { let _accu = accu; let _cell = q.first; - while(true) { + while (true) { let cell = _cell; let accu$1 = _accu; if (typeof cell !== "object") { diff --git a/lib/js/random.js b/lib/js/random.js index bf7a70c1b7..f10fd3cdde 100644 --- a/lib/js/random.js +++ b/lib/js/random.js @@ -27,13 +27,13 @@ function full_init(s, seed) { }; let seed$1 = seed.length === 0 ? [0] : seed; let l = seed$1.length; - for(let i = 0; i <= 54; ++i){ + for (let i = 0; i <= 54; ++i) { Caml_array.set(s.st, i, i); } let accu = "x"; - for(let i$1 = 0 ,i_finish = 54 + ( + for (let i$1 = 0, i_finish = 54 + ( 55 > l ? 55 : l - ) | 0; i$1 <= i_finish; ++i$1){ + ) | 0; i$1 <= i_finish; ++i$1) { let j = i$1 % 55; let k = i$1 % l; accu = combine(accu, Caml_array.get(seed$1, k)); @@ -76,13 +76,13 @@ function bits(s) { function int(s, bound) { if (bound > 1073741823 || bound <= 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int" + } + }); } - while(true) { + while (true) { let r = bits(s); let v = r % bound; if ((r - v | 0) <= ((1073741823 - bound | 0) + 1 | 0)) { @@ -95,13 +95,13 @@ function int(s, bound) { function int32(s, bound) { if (bound <= 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int32" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int32" + } + }); } - while(true) { + while (true) { let b1 = bits(s); let b2 = ((bits(s) & 1) << 30); let r = b1 | b2; @@ -116,13 +116,13 @@ function int32(s, bound) { function int64(s, bound) { if (Caml.i64_le(bound, Caml_int64.zero)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Random.int64" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Random.int64" + } + }); } - while(true) { + while (true) { let b1 = Caml_int64.of_int32(bits(s)); let b2 = Caml_int64.lsl_(Caml_int64.of_int32(bits(s)), 30); let b3 = Caml_int64.lsl_(Caml_int64.of_int32(bits(s) & 7), 60); diff --git a/lib/js/runtime_deriving.js b/lib/js/runtime_deriving.js index db45cb7a89..5b1bc5652f 100644 --- a/lib/js/runtime_deriving.js +++ b/lib/js/runtime_deriving.js @@ -4,10 +4,10 @@ function raiseWhenNotFound(x) { if (x == null) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } return x; } diff --git a/lib/js/set.js b/lib/js/set.js index de2d6b2629..3c6211b669 100644 --- a/lib/js/set.js +++ b/lib/js/set.js @@ -32,11 +32,11 @@ function Make(funarg) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -48,11 +48,11 @@ function Make(funarg) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -65,11 +65,11 @@ function Make(funarg) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -81,11 +81,11 @@ function Make(funarg) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -160,14 +160,14 @@ function Make(funarg) { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -178,7 +178,7 @@ function Make(funarg) { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -192,14 +192,14 @@ function Make(funarg) { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -210,7 +210,7 @@ function Make(funarg) { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -226,11 +226,11 @@ function Make(funarg) { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -290,7 +290,7 @@ function Make(funarg) { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -396,7 +396,7 @@ function Make(funarg) { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -415,7 +415,7 @@ function Make(funarg) { let compare = function (s1, s2) { let _e1 = cons_enum(s1, "End"); let _e2 = cons_enum(s2, "End"); - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -441,7 +441,7 @@ function Make(funarg) { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -491,7 +491,7 @@ function Make(funarg) { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -503,7 +503,7 @@ function Make(funarg) { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -515,7 +515,7 @@ function Make(funarg) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -531,7 +531,7 @@ function Make(funarg) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -601,7 +601,7 @@ function Make(funarg) { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -619,14 +619,14 @@ function Make(funarg) { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = funarg.compare(x, v); @@ -638,20 +638,20 @@ function Make(funarg) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -672,7 +672,7 @@ function Make(funarg) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -681,7 +681,7 @@ function Make(funarg) { if (f(v)) { let _v0 = v; let _param$1 = param.l; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -702,20 +702,20 @@ function Make(funarg) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -736,7 +736,7 @@ function Make(funarg) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -745,7 +745,7 @@ function Make(funarg) { if (f(v)) { let _v0 = v; let _param$1 = param.r; - while(true) { + while (true) { let param$1 = _param$1; let v0 = _v0; if (typeof param$1 !== "object") { @@ -766,7 +766,7 @@ function Make(funarg) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -825,28 +825,54 @@ function Make(funarg) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -857,52 +883,24 @@ function Make(funarg) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -915,15 +913,15 @@ function Make(funarg) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "set.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "set.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l$1), l$1)[0]; } else { diff --git a/lib/js/setLabels.js b/lib/js/setLabels.js index 9cbf5ee04b..737c8d4c8f 100644 --- a/lib/js/setLabels.js +++ b/lib/js/setLabels.js @@ -32,11 +32,11 @@ function Make(Ord) { if (hl > (hr + 2 | 0)) { if (typeof l !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let lr = l.r; let lv = l.v; @@ -48,11 +48,11 @@ function Make(Ord) { return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } if (hr <= (hl + 2 | 0)) { return { @@ -65,11 +65,11 @@ function Make(Ord) { } if (typeof r !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); } let rr = r.r; let rv = r.v; @@ -81,11 +81,11 @@ function Make(Ord) { return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); } throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal" + } + }); }; let add = function (x, param) { if (typeof param !== "object") { @@ -160,14 +160,14 @@ function Make(Ord) { } }; let min_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -178,7 +178,7 @@ function Make(Ord) { }; }; let min_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -192,14 +192,14 @@ function Make(Ord) { }; }; let max_elt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let r = param.r; if (typeof r !== "object") { @@ -210,7 +210,7 @@ function Make(Ord) { }; }; let max_elt_opt = function (_param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -226,11 +226,11 @@ function Make(Ord) { let remove_min_elt = function (param) { if (typeof param !== "object") { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt" + } + }); } let l = param.l; if (typeof l !== "object") { @@ -299,7 +299,7 @@ function Make(Ord) { } }; let mem = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -399,7 +399,7 @@ function Make(Ord) { } }; let cons_enum = function (_s, _e) { - while(true) { + while (true) { let e = _e; let s = _s; if (typeof s !== "object") { @@ -416,7 +416,7 @@ function Make(Ord) { }; }; let compare_aux = function (_e1, _e2) { - while(true) { + while (true) { let e2 = _e2; let e1 = _e1; if (typeof e1 !== "object") { @@ -445,7 +445,7 @@ function Make(Ord) { return compare(s1, s2) === 0; }; let subset = function (_s1, _s2) { - while(true) { + while (true) { let s2 = _s2; let s1 = _s1; if (typeof s1 !== "object") { @@ -495,7 +495,7 @@ function Make(Ord) { }; }; let iter = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -507,7 +507,7 @@ function Make(Ord) { }; }; let fold = function (f, _s, _accu) { - while(true) { + while (true) { let accu = _accu; let s = _s; if (typeof s !== "object") { @@ -519,7 +519,7 @@ function Make(Ord) { }; }; let for_all = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return true; @@ -535,7 +535,7 @@ function Make(Ord) { }; }; let exists = function (p, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return false; @@ -605,7 +605,7 @@ function Make(Ord) { } }; let elements_aux = function (_accu, _param) { - while(true) { + while (true) { let param = _param; let accu = _accu; if (typeof param !== "object") { @@ -623,14 +623,14 @@ function Make(Ord) { return elements_aux(/* [] */0, s); }; let find = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; let c = Ord.compare(x, v); @@ -642,7 +642,7 @@ function Make(Ord) { }; }; let find_first_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -659,14 +659,14 @@ function Make(Ord) { }; }; let find_first = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -677,7 +677,7 @@ function Make(Ord) { }; }; let find_first_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -694,7 +694,7 @@ function Make(Ord) { }; }; let find_first_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -708,7 +708,7 @@ function Make(Ord) { }; }; let find_last_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -725,14 +725,14 @@ function Make(Ord) { }; }; let find_last = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } let v = param.v; if (f(v)) { @@ -743,7 +743,7 @@ function Make(Ord) { }; }; let find_last_opt_aux = function (_v0, f, _param) { - while(true) { + while (true) { let param = _param; let v0 = _v0; if (typeof param !== "object") { @@ -760,7 +760,7 @@ function Make(Ord) { }; }; let find_last_opt = function (f, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -774,7 +774,7 @@ function Make(Ord) { }; }; let find_opt = function (x, _param) { - while(true) { + while (true) { let param = _param; if (typeof param !== "object") { return; @@ -815,28 +815,54 @@ function Make(Ord) { let sub = function (n, l) { switch (n) { case 0 : + return [ + "Empty", + l + ]; + case 1 : + if (l) { return [ - "Empty", - l + { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + l.tl ]; - case 1 : - if (l) { + } + break; + case 2 : + if (l) { + let match = l.tl; + if (match) { return [ { TAG: "Node", - l: "Empty", - v: l.hd, + l: { + TAG: "Node", + l: "Empty", + v: l.hd, + r: "Empty", + h: 1 + }, + v: match.hd, r: "Empty", - h: 1 + h: 2 }, - l.tl + match.tl ]; } - break; - case 2 : - if (l) { - let match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + let match$1 = l.tl; + if (match$1) { + let match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -847,52 +873,24 @@ function Make(Ord) { r: "Empty", h: 1 }, - v: match.hd, - r: "Empty", + v: match$1.hd, + r: { + TAG: "Node", + l: "Empty", + v: match$2.hd, + r: "Empty", + h: 1 + }, h: 2 }, - match.tl + match$2.tl ]; } } - break; - case 3 : - if (l) { - let match$1 = l.tl; - if (match$1) { - let match$2 = match$1.tl; - if (match$2) { - return [ - { - TAG: "Node", - l: { - TAG: "Node", - l: "Empty", - v: l.hd, - r: "Empty", - h: 1 - }, - v: match$1.hd, - r: { - TAG: "Node", - l: "Empty", - v: match$2.hd, - r: "Empty", - h: 1 - }, - h: 2 - }, - match$2.tl - ]; - } - - } - - } - break; - default: - + + } + break; } let nl = n / 2 | 0; let match$3 = sub(nl, l); @@ -905,15 +903,15 @@ function Make(Ord) { ]; } throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ] - } - }); + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ] + } + }); }; return sub(List.length(l), l)[0]; }; diff --git a/lib/js/sort.js b/lib/js/sort.js index b67fc300e9..c48404ca4e 100644 --- a/lib/js/sort.js +++ b/lib/js/sort.js @@ -72,7 +72,7 @@ function list(order, l) { } }; let _param = initlist(l); - while(true) { + while (true) { let param = _param; if (!param) { return /* [] */0; @@ -93,7 +93,7 @@ function swap(arr, i, j) { function array(cmp, arr) { let qsort = function (_lo, _hi) { - while(true) { + while (true) { let hi = _hi; let lo = _lo; if ((hi - lo | 0) < 6) { @@ -115,17 +115,17 @@ function array(cmp, arr) { let j = hi - 1 | 0; if (!cmp(pivot, arr[hi]) || !cmp(arr[lo], pivot)) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "Sort.array" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "Sort.array" + } + }); } - while(i < j) { - while(!cmp(pivot, arr[i])) { + while (i < j) { + while (!cmp(pivot, arr[i])) { i = i + 1 | 0; }; - while(!cmp(arr[j], pivot)) { + while (!cmp(arr[j], pivot)) { j = j - 1 | 0; }; if (i < j) { @@ -145,12 +145,12 @@ function array(cmp, arr) { }; }; qsort(0, arr.length - 1 | 0); - for(let i = 1 ,i_finish = arr.length; i < i_finish; ++i){ + for (let i = 1, i_finish = arr.length; i < i_finish; ++i) { let val_i = arr[i]; if (!cmp(arr[i - 1 | 0], val_i)) { arr[i] = arr[i - 1 | 0]; let j = i - 1 | 0; - while(j >= 1 && !cmp(arr[j - 1 | 0], val_i)) { + while (j >= 1 && !cmp(arr[j - 1 | 0], val_i)) { arr[j] = arr[j - 1 | 0]; j = j - 1 | 0; }; diff --git a/lib/js/stack.js b/lib/js/stack.js index f46a7c700a..e90720d44c 100644 --- a/lib/js/stack.js +++ b/lib/js/stack.js @@ -40,10 +40,10 @@ function pop(s) { return match.hd; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function top(s) { @@ -52,10 +52,10 @@ function top(s) { return match.hd; } throw new Error(Empty, { - cause: { - RE_EXN_ID: Empty - } - }); + cause: { + RE_EXN_ID: Empty + } + }); } function is_empty(s) { diff --git a/lib/js/stream.js b/lib/js/stream.js index c8db66eb78..e6e3b32d27 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -28,118 +28,116 @@ function data(param) { } function get_data(count, _d) { - while(true) { + while (true) { let d = _d; if (typeof d !== "object") { return d; } switch (d.TAG) { case "Scons" : - return d; + return d; case "Sapp" : - let d2 = d._1; - let match = get_data(count, d._0); - if (typeof match !== "object") { - _d = d2; - continue; - } - if (match.TAG === "Scons") { - return { - TAG: "Scons", - _0: match._0, - _1: { - TAG: "Sapp", - _0: match._1, - _1: d2 - } - }; - } - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stream.res", - 53, - 13 - ] - } - }); - case "Slazy" : - _d = CamlinternalLazy.force(d._0); + let d2 = d._1; + let match = get_data(count, d._0); + if (typeof match !== "object") { + _d = d2; continue; - case "Sgen" : - let g = d._0; - let match$1 = g.curr; - if (match$1 !== undefined) { - let a = Caml_option.valFromOption(match$1); - if (a !== undefined) { - g.curr = undefined; - return { - TAG: "Scons", - _0: Caml_option.valFromOption(a), - _1: d - }; - } else { - return "Sempty"; + } + if (match.TAG === "Scons") { + return { + TAG: "Scons", + _0: match._0, + _1: { + TAG: "Sapp", + _0: match._1, + _1: d2 } + }; + } + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stream.res", + 53, + 13 + ] } - let a$1 = g.func(count); - if (a$1 !== undefined) { + }); + case "Slazy" : + _d = CamlinternalLazy.force(d._0); + continue; + case "Sgen" : + let g = d._0; + let match$1 = g.curr; + if (match$1 !== undefined) { + let a = Caml_option.valFromOption(match$1); + if (a !== undefined) { + g.curr = undefined; return { TAG: "Scons", - _0: Caml_option.valFromOption(a$1), + _0: Caml_option.valFromOption(a), _1: d }; } else { - g.curr = Caml_option.some(undefined); return "Sempty"; } - + } + let a$1 = g.func(count); + if (a$1 !== undefined) { + return { + TAG: "Scons", + _0: Caml_option.valFromOption(a$1), + _1: d + }; + } else { + g.curr = Caml_option.some(undefined); + return "Sempty"; + } } }; } function peek_data(s) { - while(true) { + while (true) { let f = s.data; if (typeof f !== "object") { return; } switch (f.TAG) { case "Scons" : - return Caml_option.some(f._0); + return Caml_option.some(f._0); case "Sapp" : - let d = get_data(s.count, s.data); - if (typeof d !== "object") { - return; - } - if (d.TAG === "Scons") { - s.data = d; - return Caml_option.some(d._0); + let d = get_data(s.count, s.data); + if (typeof d !== "object") { + return; + } + if (d.TAG === "Scons") { + s.data = d; + return Caml_option.some(d._0); + } + throw new Error("Assert_failure", { + cause: { + RE_EXN_ID: "Assert_failure", + _1: [ + "stream.res", + 83, + 13 + ] } - throw new Error("Assert_failure", { - cause: { - RE_EXN_ID: "Assert_failure", - _1: [ - "stream.res", - 83, - 13 - ] - } - }); + }); case "Slazy" : - s.data = CamlinternalLazy.force(f._0); - continue; + s.data = CamlinternalLazy.force(f._0); + continue; case "Sgen" : - let g = f._0; - let a = g.curr; - if (a !== undefined) { - return Caml_option.valFromOption(a); - } - let x = g.func(s.count); - g.curr = Caml_option.some(x); - return x; - + let g = f._0; + let a = g.curr; + if (a !== undefined) { + return Caml_option.valFromOption(a); + } + let x = g.func(s.count); + g.curr = Caml_option.some(x); + return x; } }; } @@ -152,25 +150,23 @@ function peek(param) { } function junk_data(s) { - while(true) { + while (true) { let g = s.data; if (typeof g === "object") { switch (g.TAG) { case "Scons" : + s.count = s.count + 1 | 0; + s.data = g._1; + return; + case "Sgen" : + let g$1 = g._0; + let match = g$1.curr; + if (match !== undefined) { s.count = s.count + 1 | 0; - s.data = g._1; + g$1.curr = undefined; return; - case "Sgen" : - let g$1 = g._0; - let match = g$1.curr; - if (match !== undefined) { - s.count = s.count + 1 | 0; - g$1.curr = undefined; - return; - } - break; - default: - + } + break; } } let match$1 = peek_data(s); @@ -239,10 +235,10 @@ function next(s) { return Caml_option.valFromOption(a); } throw new Error(Failure, { - cause: { - RE_EXN_ID: Failure - } - }); + cause: { + RE_EXN_ID: Failure + } + }); } function empty(s) { @@ -251,15 +247,15 @@ function empty(s) { return; } throw new Error(Failure, { - cause: { - RE_EXN_ID: Failure - } - }); + cause: { + RE_EXN_ID: Failure + } + }); } function iter(f, strm) { let do_rec = function () { - while(true) { + while (true) { let a = peek(strm); if (a === undefined) { return; @@ -432,26 +428,25 @@ function dump_data(f, param) { } switch (param.TAG) { case "Scons" : - console.log("Scons ("); - f(param._0); - console.log(", "); - dump_data(f, param._1); - console.log(")"); - return; + console.log("Scons ("); + f(param._0); + console.log(", "); + dump_data(f, param._1); + console.log(")"); + return; case "Sapp" : - console.log("Sapp ("); - dump_data(f, param._0); - console.log(", "); - dump_data(f, param._1); - console.log(")"); - return; + console.log("Sapp ("); + dump_data(f, param._0); + console.log(", "); + dump_data(f, param._1); + console.log(")"); + return; case "Slazy" : - console.log("Slazy"); - return; + console.log("Slazy"); + return; case "Sgen" : - console.log("Sgen"); - return; - + console.log("Sgen"); + return; } } diff --git a/lib/js/string.js b/lib/js/string.js index e26e35272b..d6be0fd764 100644 --- a/lib/js/string.js +++ b/lib/js/string.js @@ -19,13 +19,13 @@ function concat(sep, xs) { } function iter(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(s.codePointAt(i)); } } function iteri(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(i, s.codePointAt(i)); } } @@ -56,7 +56,7 @@ function trim(s) { function escaped(s) { let needs_escape = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= s.length) { return false; @@ -87,14 +87,14 @@ function escaped(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -109,7 +109,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -130,11 +130,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -143,24 +143,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -177,17 +177,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -207,11 +207,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -220,24 +220,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -248,24 +247,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -294,7 +292,7 @@ function equal(a, b) { function split_on_char(sep, s) { let r = /* [] */0; let j = s.length; - for(let i = s.length - 1 | 0; i >= 0; --i){ + for (let i = s.length - 1 | 0; i >= 0; --i) { if (s.codePointAt(i) === sep) { r = { hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), diff --git a/lib/js/stringLabels.js b/lib/js/stringLabels.js index 66077dc73c..d66bfccf31 100644 --- a/lib/js/stringLabels.js +++ b/lib/js/stringLabels.js @@ -21,13 +21,13 @@ function concat(sep, xs) { } function iter(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(s.codePointAt(i)); } } function iteri(f, s) { - for(let i = 0 ,i_finish = s.length; i < i_finish; ++i){ + for (let i = 0, i_finish = s.length; i < i_finish; ++i) { f(i, s.codePointAt(i)); } } @@ -58,7 +58,7 @@ function trim(s) { function escaped(s) { let needs_escape = function (_i) { - while(true) { + while (true) { let i = _i; if (i >= s.length) { return false; @@ -89,14 +89,14 @@ function escaped(s) { } function index_rec(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -111,7 +111,7 @@ function index(s, c) { } function index_rec_opt(s, lim, _i, c) { - while(true) { + while (true) { let i = _i; if (i >= lim) { return; @@ -132,11 +132,11 @@ function index_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from / Bytes.index_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from / Bytes.index_from" + } + }); } return index_rec(s, l, i, c); } @@ -145,24 +145,24 @@ function index_from_opt(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.index_from_opt / Bytes.index_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.index_from_opt / Bytes.index_from_opt" + } + }); } return index_rec_opt(s, l, i, c); } function rindex_rec(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { throw new Error("Not_found", { - cause: { - RE_EXN_ID: "Not_found" - } - }); + cause: { + RE_EXN_ID: "Not_found" + } + }); } if (s.codePointAt(i) === c) { return i; @@ -179,17 +179,17 @@ function rindex(s, c) { function rindex_from(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from / Bytes.rindex_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from / Bytes.rindex_from" + } + }); } return rindex_rec(s, i, c); } function rindex_rec_opt(s, _i, c) { - while(true) { + while (true) { let i = _i; if (i < 0) { return; @@ -209,11 +209,11 @@ function rindex_opt(s, c) { function rindex_from_opt(s, i, c) { if (i < -1 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rindex_from_opt / Bytes.rindex_from_opt" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rindex_from_opt / Bytes.rindex_from_opt" + } + }); } return rindex_rec_opt(s, i, c); } @@ -222,24 +222,23 @@ function contains_from(s, i, c) { let l = s.length; if (i < 0 || i > l) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.contains_from / Bytes.contains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.contains_from / Bytes.contains_from" + } + }); } try { index_rec(s, l, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -250,24 +249,23 @@ function contains(s, c) { function rcontains_from(s, i, c) { if (i < 0 || i >= s.length) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "String.rcontains_from / Bytes.rcontains_from" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "String.rcontains_from / Bytes.rcontains_from" + } + }); } try { rindex_rec(s, i, c); return true; - } - catch (raw_exn){ + } catch (raw_exn) { let exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return false; } throw new Error(exn.RE_EXN_ID, { - cause: exn - }); + cause: exn + }); } } @@ -296,7 +294,7 @@ function equal(a, b) { function split_on_char(sep, s) { let r = /* [] */0; let j = s.length; - for(let i = s.length - 1 | 0; i >= 0; --i){ + for (let i = s.length - 1 | 0; i >= 0; --i) { if (s.codePointAt(i) === sep) { r = { hd: sub(s, i + 1 | 0, (j - i | 0) - 1 | 0), diff --git a/lib/js/uchar.js b/lib/js/uchar.js index 87523c8fb6..43a6f0349e 100644 --- a/lib/js/uchar.js +++ b/lib/js/uchar.js @@ -17,11 +17,11 @@ function succ(u) { } if (u === 1114111) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "U+10FFFF has no successor" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "U+10FFFF has no successor" + } + }); } return u + 1 | 0; } @@ -32,11 +32,11 @@ function pred(u) { } if (u === 0) { throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: "U+0000 has no predecessor" - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: "U+0000 has no predecessor" + } + }); } return u - 1 | 0; } @@ -57,11 +57,11 @@ function of_int(i) { } let s = err_not_sv(i); throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } function is_char(u) { @@ -78,11 +78,11 @@ function to_char(u) { } let s = err_not_latin1(u); throw new Error("Invalid_argument", { - cause: { - RE_EXN_ID: "Invalid_argument", - _1: s - } - }); + cause: { + RE_EXN_ID: "Invalid_argument", + _1: s + } + }); } function unsafe_to_char(prim) {