diff --git a/CHANGELOG.md b/CHANGELOG.md index cdb80445a6..a1912252a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Remove redundant space for export in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6560 - Remove empty export blocks in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6744 - Fix indent for returned/thrown/wrapped in parentheses objects in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6746 +- Fix indent in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6747 # 11.1.0 diff --git a/jscomp/core/js_dump.ml b/jscomp/core/js_dump.ml index 9925968f62..d443253dfa 100644 --- a/jscomp/core/js_dump.ml +++ b/jscomp/core/js_dump.ml @@ -393,7 +393,7 @@ and pp_function ~return_unit ~async ~is_method cxt (f : P.t) ~fn_state param_body () | No_name { single_arg } -> (* see # 1692, add a paren for annoymous function for safety *) - P.cond_paren_group f (not single_arg) 1 (fun _ -> + P.cond_paren_group f (not single_arg) (fun _ -> P.string f (L.function_async ~async); P.space f; param_body ()) @@ -526,7 +526,7 @@ and expression_desc cxt ~(level : int) f x : cxt = bool f b; cxt | Seq (e1, e2) -> - P.cond_paren_group f (level > 0) 1 (fun () -> + P.cond_paren_group f (level > 0) (fun () -> let cxt = expression ~level:0 cxt f e1 in comma_sp f; expression ~level:0 cxt f e2) @@ -544,12 +544,12 @@ and expression_desc cxt ~(level : int) f x : cxt = ]} *) | Call (e, el, info) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> - P.group f 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> + P.group f 0 (fun _ -> match (info, el) with | { arity = Full }, _ | _, [] -> let cxt = expression ~level:15 cxt f e in - P.paren_group f 1 (fun _ -> + P.paren_group f 0 (fun _ -> match el with | [ { @@ -580,13 +580,13 @@ and expression_desc cxt ~(level : int) f x : cxt = let len = List.length el in if 1 <= len && len <= 8 then ( Curry_gen.pp_app f len; - P.paren_group f 1 (fun _ -> arguments cxt f (e :: el))) + P.paren_group f 0 (fun _ -> arguments cxt f (e :: el))) else ( Curry_gen.pp_app_any f; - P.paren_group f 1 (fun _ -> + P.paren_group f 0 (fun _ -> arguments cxt f [ e; E.array Mutable el ])))) | FlatCall (e, el) -> - P.group f 1 (fun _ -> + P.group f 0 (fun _ -> let cxt = expression ~level:15 cxt f e in P.string f L.dot; P.string f L.apply; @@ -676,7 +676,7 @@ and expression_desc cxt ~(level : int) f x : cxt = if need_paren then P.paren f action else action (); cxt | Is_null_or_undefined e -> - P.cond_paren_group f (level > 0) 1 (fun _ -> + P.cond_paren_group f (level > 0) (fun _ -> let cxt = expression ~level:1 cxt f e in P.space f; P.string f "=="; @@ -684,7 +684,7 @@ and expression_desc cxt ~(level : int) f x : cxt = P.string f L.null; cxt) | Js_not e -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f "!"; expression ~level:13 cxt f e) | Typeof e -> @@ -704,7 +704,7 @@ and expression_desc cxt ~(level : int) f x : cxt = {[ 0.00 - x ]} {[ 0.000 - x ]} *) -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f (match desc with Float _ -> "- " | _ -> "-"); expression ~level:13 cxt f e) | Bin (op, e1, e2) -> @@ -714,7 +714,7 @@ and expression_desc cxt ~(level : int) f x : cxt = in (* We are more conservative here, to make the generated code more readable to the user *) - P.cond_paren_group f need_paren 1 (fun _ -> + P.cond_paren_group f need_paren (fun _ -> let cxt = expression ~level:lft cxt f e1 in P.space f; P.string f (Js_op_util.op_str op); @@ -726,7 +726,7 @@ and expression_desc cxt ~(level : int) f x : cxt = let need_paren = level > out || match op with Lsl | Lsr | Asr -> true | _ -> false in - P.cond_paren_group f need_paren 1 (fun _ -> + P.cond_paren_group f need_paren (fun _ -> let cxt = expression ~level:lft cxt f e1 in P.space f; P.string f "+"; @@ -862,12 +862,12 @@ and expression_desc cxt ~(level : int) f x : cxt = P.string f tag; cxt) | Array_index (e, p) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> P.group f 1 (fun _ -> let cxt = expression ~level:15 cxt f e in P.bracket_group f 1 (fun _ -> expression ~level:0 cxt f p))) | Static_index (e, s, _) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> let cxt = expression ~level:15 cxt f e in Js_dump_property.property_access f s; (* See [ .obj_of_exports] @@ -877,13 +877,13 @@ and expression_desc cxt ~(level : int) f x : cxt = cxt) | Length (e, _) -> (*Todo: check parens *) - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> let cxt = expression ~level:15 cxt f e in P.string f L.dot; P.string f L.length; cxt) | New (e, el) -> - P.cond_paren_group f (level > 15) 1 (fun _ -> + P.cond_paren_group f (level > 15) (fun _ -> P.group f 1 (fun _ -> P.string f L.new_; P.space f; @@ -916,14 +916,14 @@ and expression_desc cxt ~(level : int) f x : cxt = var f = { x : 2 , y : 2} ]} *) - P.cond_paren_group f (level > 1) 0 (fun _ -> + P.cond_paren_group f (level > 1) (fun _ -> if lst = [] then ( P.string f "{}"; cxt) else P.brace_vgroup f 1 (fun _ -> property_name_and_value_list cxt f lst)) | Await e -> - P.cond_paren_group f (level > 13) 1 (fun _ -> + P.cond_paren_group f (level > 13) (fun _ -> P.string f "await "; expression ~level:13 cxt f e) diff --git a/jscomp/ext/ext_pp.ml b/jscomp/ext/ext_pp.ml index 7ac0502682..5b1e4a8b02 100644 --- a/jscomp/ext/ext_pp.ml +++ b/jscomp/ext/ext_pp.ml @@ -160,8 +160,8 @@ let paren_vgroup st n action = let paren_group st n action = group st n (fun _ -> paren st action) -let cond_paren_group st b n action = - if b then paren_group st n action else action () +let cond_paren_group st b action = + if b then paren_group st 0 action else action () let brace_group st n action = group st n (fun _ -> brace st action) diff --git a/jscomp/ext/ext_pp.mli b/jscomp/ext/ext_pp.mli index 6db5327aa5..aaf2176214 100644 --- a/jscomp/ext/ext_pp.mli +++ b/jscomp/ext/ext_pp.mli @@ -56,7 +56,7 @@ val brace : t -> (unit -> 'a) -> 'a val paren_group : t -> int -> (unit -> 'a) -> 'a -val cond_paren_group : t -> bool -> int -> (unit -> 'a) -> 'a +val cond_paren_group : t -> bool -> (unit -> 'a) -> 'a val paren_vgroup : t -> int -> (unit -> 'a) -> 'a diff --git a/jscomp/test/406_primitive_test.js b/jscomp/test/406_primitive_test.js index 16bc48c89f..0174788769 100644 --- a/jscomp/test/406_primitive_test.js +++ b/jscomp/test/406_primitive_test.js @@ -25,9 +25,9 @@ var backend_type = { }; eq("File \"406_primitive_test.res\", line 23, characters 3-10", backend_type, { - TAG: "Other", - _0: "BS" - }); + TAG: "Other", + _0: "BS" +}); function f(param) { var A = /* @__PURE__ */Caml_exceptions.create("A"); diff --git a/jscomp/test/Import.js b/jscomp/test/Import.js index 756f4e22ac..f7fc79a43b 100644 --- a/jscomp/test/Import.js +++ b/jscomp/test/Import.js @@ -5,14 +5,14 @@ var Curry = require("../../lib/js/curry.js"); async function eachIntAsync(list, f) { return Curry._2(await import("../../lib/js/belt_List.js").then(function (m) { - return m.forEach; - }), list, f); + return m.forEach; + }), list, f); } function eachIntLazy(list, f) { var obj = import("../../lib/js/belt_List.js").then(function (m) { - return m.forEach; - }); + return m.forEach; + }); var arg1 = function (each) { return Promise.resolve(Curry._2(each, list, f)); }; @@ -20,30 +20,30 @@ function eachIntLazy(list, f) { } eachIntLazy({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (n) { - console.log("lazy", n); - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (n) { + console.log("lazy", n); +})); eachIntAsync({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (n) { - console.log("async", n); - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (n) { + console.log("async", n); +})); var beltAsModule = await import("../../lib/js/belt_List.js"); diff --git a/jscomp/test/SafePromises.js b/jscomp/test/SafePromises.js index 8e6e7fa6fe..8853a997cb 100644 --- a/jscomp/test/SafePromises.js +++ b/jscomp/test/SafePromises.js @@ -6,12 +6,12 @@ var Js_promise2 = require("../../lib/js/js_promise2.js"); async function nestedPromise(xxx) { var xx = await xxx; Js_promise2.then(xx, (function (x) { - return Promise.resolve((console.log("Promise2.then", x), undefined)); - })); + return Promise.resolve((console.log("Promise2.then", x), undefined)); + })); Js_promise2.$$catch(xx, (function (x) { - console.log("Promise2.catch_", x); - return Promise.resolve(0); - })); + console.log("Promise2.catch_", x); + return Promise.resolve(0); + })); var arg1 = function (x) { return Promise.resolve((console.log("Promise.then_", x), undefined)); }; diff --git a/jscomp/test/UncurriedAlways.js b/jscomp/test/UncurriedAlways.js index 3998114976..3474f9929d 100644 --- a/jscomp/test/UncurriedAlways.js +++ b/jscomp/test/UncurriedAlways.js @@ -21,8 +21,8 @@ var a = 7; console.log(a); [1].map(function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); function ptl(extra) { return 10 + extra | 0; @@ -163,11 +163,11 @@ function fn(cb) { } ((function (s) { - console.log({ - NAME: "foo", - VAL: s - }); - })()); + console.log({ + NAME: "foo", + VAL: s + }); + })()); function fn1(a, b, param) { return a() + b | 0; @@ -175,8 +175,8 @@ function fn1(a, b, param) { function a$1(__x) { return fn1((function () { - return 1; - }), 2, __x); + return 1; + }), 2, __x); } function f3(x, y, z) { diff --git a/jscomp/test/UncurriedExternals.js b/jscomp/test/UncurriedExternals.js index ec16af52e4..5bfc1b5311 100644 --- a/jscomp/test/UncurriedExternals.js +++ b/jscomp/test/UncurriedExternals.js @@ -14,8 +14,8 @@ var h = sum(1.0, 2.0); var M = { sum: (function (prim0, prim1) { - return sum(prim0, prim1); - }) + return sum(prim0, prim1); + }) }; var hh = M.sum(1.0, 2.0); @@ -36,21 +36,21 @@ var tcr = {}; function tsiC(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } function tsiU(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } var match = React.useState(function (param) { - return 3; - }); + return 3; +}); var StandardNotation_get = match[0]; @@ -75,8 +75,8 @@ var StandardNotation = { function methodWithAsync(param) { var $$this = this ; return (async function (arg) { - return $$this + arg | 0; - })(param); + return $$this + arg | 0; + })(param); } function dd$1(param) { @@ -90,8 +90,8 @@ var h$1 = sum(1.0, 2.0); var M$1 = { sum: (function (prim0, prim1) { - return sum(prim0, prim1); - }) + return sum(prim0, prim1); + }) }; var hh$1 = M$1.sum(1.0, 2.0); @@ -112,21 +112,21 @@ var tcr$1 = {}; function tsiC$1(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } function tsiU$1(c) { c.increment = (function (amount) { - var me = this ; - console.log(me); - }); + var me = this ; + console.log(me); + }); } var match$1 = React.useState(function () { - return 3; - }); + return 3; +}); function methodWithAsyncU() { var $$this = this ; diff --git a/jscomp/test/UntaggedVariants.js b/jscomp/test/UntaggedVariants.js index a856c00f62..a711a227aa 100644 --- a/jscomp/test/UntaggedVariants.js +++ b/jscomp/test/UntaggedVariants.js @@ -378,8 +378,8 @@ function classify$9(v) { } var ff = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); var TestFunctionCase = { classify: classify$9, @@ -501,8 +501,8 @@ async function classify$10(a) { } else { if (Array.isArray(a)) { console.log(function (param) { - return Belt_Array.joinWith(a, "-", param); - }); + return Belt_Array.joinWith(a, "-", param); + }); return; } if (a instanceof Promise) { @@ -528,8 +528,8 @@ var Arr = { async function classifyAll(t) { if (Array.isArray(t)) { console.log(function (param) { - return Belt_Array.joinWith(t, "-", param); - }); + return Belt_Array.joinWith(t, "-", param); + }); return; } if (t instanceof Promise) { diff --git a/jscomp/test/a_filename_test.js b/jscomp/test/a_filename_test.js index ebf92f1c18..c02e4e8f4c 100644 --- a/jscomp/test/a_filename_test.js +++ b/jscomp/test/a_filename_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -36,89 +36,89 @@ function test(param, param$1) { if (process.platform !== "win32") { eq("File \"a_filename_test.res\", line 16, characters 4-11", [ - Ext_filename_test.combine("/tmp", "subdir/file.txt"), - Ext_filename_test.combine("/tmp", "/a/tmp.txt"), - Ext_filename_test.combine("/a/tmp.txt", "subdir/file.txt") - ], [ - "/tmp/subdir/file.txt", - "/a/tmp.txt", - "/a/tmp.txt/subdir/file.txt" - ]); + Ext_filename_test.combine("/tmp", "subdir/file.txt"), + Ext_filename_test.combine("/tmp", "/a/tmp.txt"), + Ext_filename_test.combine("/a/tmp.txt", "subdir/file.txt") + ], [ + "/tmp/subdir/file.txt", + "/a/tmp.txt", + "/a/tmp.txt/subdir/file.txt" + ]); eq("File \"a_filename_test.res\", line 28, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "./a/u/g.c" - }), "./u/g.c"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "./a/u/g.c" + }), "./u/g.c"); eq("File \"a_filename_test.res\", line 31, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules/buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 37, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules//buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 43, characters 4-11", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/b.c" - }, { - NAME: "File", - VAL: "xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js" - }), "buckle-stdlib/list.js"); + NAME: "File", + VAL: "./a/b.c" + }, { + NAME: "File", + VAL: "xxxghsoghos/ghsoghso/node_modules/./buckle-stdlib/list.js" + }), "buckle-stdlib/list.js"); eq("File \"a_filename_test.res\", line 48, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/c.js" - }, { - NAME: "File", - VAL: "./a/b" - }), "./b"); + NAME: "File", + VAL: "./a/c.js" + }, { + NAME: "File", + VAL: "./a/b" + }), "./b"); eq("File \"a_filename_test.res\", line 49, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "File", - VAL: "./a/c" - }, { - NAME: "File", - VAL: "./a/b.js" - }), "./b.js"); + NAME: "File", + VAL: "./a/c" + }, { + NAME: "File", + VAL: "./a/b.js" + }), "./b.js"); eq("File \"a_filename_test.res\", line 50, characters 5-12", Ext_filename_test.node_relative_path(true, { - NAME: "Dir", - VAL: "./a/" - }, { - NAME: "File", - VAL: "./a/b.js" - }), "./b.js"); + NAME: "Dir", + VAL: "./a/" + }, { + NAME: "File", + VAL: "./a/b.js" + }), "./b.js"); eq("File \"a_filename_test.res\", line 51, characters 5-12", Ext_filename_test.get_extension("a.txt"), ".txt"); eq("File \"a_filename_test.res\", line 52, characters 5-12", Ext_filename_test.get_extension("a"), ""); eq("File \"a_filename_test.res\", line 53, characters 5-12", Ext_filename_test.get_extension(".txt"), ".txt"); eq("File \"a_filename_test.res\", line 56, characters 4-11", $$Array.map(Ext_filename_test.normalize_absolute_path, [ - "/gsho/./..", - "/a/b/../c../d/e/f", - "/a/b/../c/../d/e/f", - "/gsho/./../..", - "/a/b/c/d", - "/a/b/c/d/", - "/a/", - "/a", - "/a.txt/", - "/a.txt" - ]), [ - "/", - "/a/c../d/e/f", - "/a/d/e/f", - "/", - "/a/b/c/d", - "/a/b/c/d", - "/a", - "/a", - "/a.txt", - "/a.txt" - ]); + "/gsho/./..", + "/a/b/../c../d/e/f", + "/a/b/../c/../d/e/f", + "/gsho/./../..", + "/a/b/c/d", + "/a/b/c/d/", + "/a/", + "/a", + "/a.txt/", + "/a.txt" + ]), [ + "/", + "/a/c../d/e/f", + "/a/d/e/f", + "/", + "/a/b/c/d", + "/a/b/c/d", + "/a", + "/a", + "/a.txt", + "/a.txt" + ]); } Mt.from_pair_suites("A_filename_test", suites.contents); diff --git a/jscomp/test/a_list_test.js b/jscomp/test/a_list_test.js index 106bb9547f..3b6697de30 100644 --- a/jscomp/test/a_list_test.js +++ b/jscomp/test/a_list_test.js @@ -7,98 +7,98 @@ var Ext_list_test = require("./ext_list_test.js"); var suites_0 = [ "drop", (function (param) { - return { - TAG: "Eq", - _0: Ext_list_test.drop(3, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }), - _1: /* [] */0 - }; - }) + return { + TAG: "Eq", + _0: Ext_list_test.drop(3, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } + }), + _1: /* [] */0 + }; + }) ]; var suites_1 = { hd: [ "drop1", (function (param) { - return { - TAG: "Eq", - _0: Ext_list_test.drop(2, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }), - _1: { - hd: 2, - tl: /* [] */0 + return { + TAG: "Eq", + _0: Ext_list_test.drop(2, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } } - }; - }) + }), + _1: { + hd: 2, + tl: /* [] */0 + } + }; + }) ], tl: { hd: [ "flat_map", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: 0, + tl: { hd: 0, tl: { - hd: 0, + hd: 1, tl: { hd: 1, tl: { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } + hd: 0, + tl: /* [] */0 } } } - }, - _1: Ext_list_test.flat_map((function (x) { - if (x % 2 === 0) { - return { - hd: 0, - tl: /* [] */0 - }; - } else { - return { - hd: 1, - tl: { - hd: 1, - tl: /* [] */0 - } - }; - } - }), { + } + }, + _1: Ext_list_test.flat_map((function (x) { + if (x % 2 === 0) { + return { + hd: 0, + tl: /* [] */0 + }; + } else { + return { + hd: 1, + tl: { + hd: 1, + tl: /* [] */0 + } + }; + } + }), { + hd: 0, + tl: { + hd: 0, + tl: { + hd: 3, + tl: { hd: 0, - tl: { - hd: 0, - tl: { - hd: 3, - tl: { - hd: 0, - tl: /* [] */0 - } - } - } - }) - }; - }) + tl: /* [] */0 + } + } + } + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/a_recursive_type.js b/jscomp/test/a_recursive_type.js index 5f102e5805..194921d99b 100644 --- a/jscomp/test/a_recursive_type.js +++ b/jscomp/test/a_recursive_type.js @@ -8,9 +8,9 @@ function g(x) { } var loop = g({ - TAG: "A", - _0: g - }); + TAG: "A", + _0: g +}); var x = { TAG: "A", diff --git a/jscomp/test/a_string_test.js b/jscomp/test/a_string_test.js index e66cec47a7..8d20dfabbf 100644 --- a/jscomp/test/a_string_test.js +++ b/jscomp/test/a_string_test.js @@ -8,101 +8,101 @@ var Ext_string_test = require("./ext_string_test.js"); var suites_0 = [ "split", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "hihi", /* 'i' */105), - _1: { + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", tl: { - hd: "h", - tl: { - hd: "", - tl: /* [] */0 - } + hd: "", + tl: /* [] */0 } } - }; - }) + } + }; + }) ]; var suites_1 = { hd: [ "split_non_empty", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), - _1: { + return { + TAG: "Eq", + _0: Ext_string_test.split(undefined, "hihi", /* 'i' */105), + _1: { + hd: "h", + tl: { hd: "h", - tl: { - hd: "h", - tl: /* [] */0 - } + tl: /* [] */0 } - }; - }) + } + }; + }) ], tl: { hd: [ "split_empty", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "", /* 'i' */105), - _1: /* [] */0 - }; - }) + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "", /* 'i' */105), + _1: /* [] */0 + }; + }) ], tl: { hd: [ "split_normal", (function (param) { - return { - TAG: "Eq", - _0: Ext_string_test.split(true, "h i i", /* ' ' */32), - _1: { - hd: "h", + return { + TAG: "Eq", + _0: Ext_string_test.split(true, "h i i", /* ' ' */32), + _1: { + hd: "h", + tl: { + hd: "i", tl: { hd: "i", - tl: { - hd: "i", - tl: /* [] */0 - } + tl: /* [] */0 } } - }; - }) + } + }; + }) ], tl: { hd: [ "split_by", (function (param) { - return { - TAG: "Eq", - _0: List.filter(function (s) { - return s !== ""; - })(Ext_string_test.split_by(undefined, (function (x) { - if (x === /* ' ' */32) { - return true; - } else { - return x === /* '\t' */9; - } - }), "h hgso hgso \t hi")), - _1: { - hd: "h", + return { + TAG: "Eq", + _0: List.filter(function (s) { + return s !== ""; + })(Ext_string_test.split_by(undefined, (function (x) { + if (x === /* ' ' */32) { + return true; + } else { + return x === /* '\t' */9; + } + }), "h hgso hgso \t hi")), + _1: { + hd: "h", + tl: { + hd: "hgso", tl: { hd: "hgso", tl: { - hd: "hgso", - tl: { - hd: "hi", - tl: /* [] */0 - } + hd: "hi", + tl: /* [] */0 } } } - }; - }) + } + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/and_or_tailcall_test.js b/jscomp/test/and_or_tailcall_test.js index c77a08e9f8..14799848d6 100644 --- a/jscomp/test/and_or_tailcall_test.js +++ b/jscomp/test/and_or_tailcall_test.js @@ -34,24 +34,24 @@ function or_f(b, x, _n) { var suites_0 = [ "and_tail", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: f(true, 1, 0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: f(true, 1, 0) + }; + }) ]; var suites_1 = { hd: [ "or_tail", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: or_f(false, 1, 0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: or_f(false, 1, 0) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/argv_test.js b/jscomp/test/argv_test.js index ddb4143b32..8d939ad3ae 100644 --- a/jscomp/test/argv_test.js +++ b/jscomp/test/argv_test.js @@ -44,10 +44,10 @@ var arg_spec = { }; Arg.parse_argv(undefined, [ - "prog.exe", - "-c", - "-d" - ], arg_spec, anno_fun, usage_msg); + "prog.exe", + "-c", + "-d" +], arg_spec, anno_fun, usage_msg); if (compile.contents !== true) { throw { diff --git a/jscomp/test/ari_regress_test.js b/jscomp/test/ari_regress_test.js index c798666753..1917447aae 100644 --- a/jscomp/test/ari_regress_test.js +++ b/jscomp/test/ari_regress_test.js @@ -31,46 +31,46 @@ function v(param) { var suites_0 = [ "curry", (function (param) { - return { - TAG: "Eq", - _0: g, - _1: 7 - }; - }) + return { + TAG: "Eq", + _0: g, + _1: 7 + }; + }) ]; var suites_1 = { hd: [ "curry2", (function (param) { - return { - TAG: "Eq", - _0: 14, - _1: (Curry._1(v, 1), Curry._1(v, 1)) - }; - }) + return { + TAG: "Eq", + _0: 14, + _1: (Curry._1(v, 1), Curry._1(v, 1)) + }; + }) ], tl: { hd: [ "curry3", (function (param) { - return { - TAG: "Eq", - _0: x, - _1: 14 - }; - }) + return { + TAG: "Eq", + _0: x, + _1: 14 + }; + }) ], tl: { hd: [ "File \"ari_regress_test.res\", line 35, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: h.contents, - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: h.contents, + _1: 1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/arith_parser.js b/jscomp/test/arith_parser.js index 58d71d866e..2a18696a6b 100644 --- a/jscomp/test/arith_parser.js +++ b/jscomp/test/arith_parser.js @@ -140,82 +140,82 @@ var yynames_block = "\ var yyact = [ (function (param) { - throw { - RE_EXN_ID: "Failure", - _1: "parser", - Error: new Error() - }; - }), + throw { + RE_EXN_ID: "Failure", + _1: "parser", + Error: new Error() + }; + }), (function (__caml_parser_env) { - return Parsing.peek_val(__caml_parser_env, 1); - }), + return Parsing.peek_val(__caml_parser_env, 1); + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Numeral", - _0: _1 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Numeral", + _0: _1 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Variable", - _0: _1 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Variable", + _0: _1 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Plus", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Plus", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Minus", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Minus", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Times", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Times", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _1 = Parsing.peek_val(__caml_parser_env, 2); - var _3 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Divide", - _0: _1, - _1: _3 - }; - }), + var _1 = Parsing.peek_val(__caml_parser_env, 2); + var _3 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Divide", + _0: _1, + _1: _3 + }; + }), (function (__caml_parser_env) { - var _2 = Parsing.peek_val(__caml_parser_env, 0); - return { - TAG: "Negate", - _0: _2 - }; - }), + var _2 = Parsing.peek_val(__caml_parser_env, 0); + return { + TAG: "Negate", + _0: _2 + }; + }), (function (__caml_parser_env) { - return Parsing.peek_val(__caml_parser_env, 1); - }), + return Parsing.peek_val(__caml_parser_env, 1); + }), (function (__caml_parser_env) { - throw { - RE_EXN_ID: Parsing.YYexit, - _1: Parsing.peek_val(__caml_parser_env, 0), - Error: new Error() - }; - }) + throw { + RE_EXN_ID: Parsing.YYexit, + _1: Parsing.peek_val(__caml_parser_env, 0), + Error: new Error() + }; + }) ]; var yytables = { diff --git a/jscomp/test/arity_deopt.js b/jscomp/test/arity_deopt.js index c499bc2d4b..721b1b85ef 100644 --- a/jscomp/test/arity_deopt.js +++ b/jscomp/test/arity_deopt.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,14 +53,14 @@ function f3(x) { eq("File \"arity_deopt.res\", line 47, characters 11-18", 6, 6); eq("File \"arity_deopt.res\", line 48, characters 11-18", 6, (function (y, z) { - return (1 + y | 0) + z | 0; - })(2, 3)); + return (1 + y | 0) + z | 0; +})(2, 3)); eq("File \"arity_deopt.res\", line 49, characters 11-18", 6, 6); eq("File \"arity_deopt.res\", line 50, characters 11-18", 6, (function (y, z) { - return (1 + y | 0) + z | 0; - })(2, 3)); + return (1 + y | 0) + z | 0; +})(2, 3)); Mt.from_pair_suites("Arity_deopt", suites.contents); diff --git a/jscomp/test/arity_infer.js b/jscomp/test/arity_infer.js index 4f44315821..8472ac3262 100644 --- a/jscomp/test/arity_infer.js +++ b/jscomp/test/arity_infer.js @@ -7,8 +7,8 @@ function f0(x) { var tmp; if (x > 3) { tmp = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; + }); } else { throw { RE_EXN_ID: "Not_found", @@ -31,23 +31,23 @@ function f3(x) { switch (x) { case 0 : tmp = (function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; + }); break; case 1 : tmp = (function (x) { - return x + 2 | 0; - }); + return x + 2 | 0; + }); break; case 2 : tmp = (function (x) { - return x + 3 | 0; - }); + return x + 3 | 0; + }); break; case 3 : tmp = (function (x) { - return x + 4 | 0; - }); + return x + 4 | 0; + }); break; default: throw { diff --git a/jscomp/test/array_data_util.js b/jscomp/test/array_data_util.js index 32919a1860..4a966b4ef3 100644 --- a/jscomp/test/array_data_util.js +++ b/jscomp/test/array_data_util.js @@ -5,14 +5,14 @@ var Belt_Array = require("../../lib/js/belt_Array.js"); function range(i, j) { return Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); } function randomRange(i, j) { var v = Belt_Array.makeBy((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); Belt_Array.shuffleInPlace(v); return v; } diff --git a/jscomp/test/array_subtle_test.js b/jscomp/test/array_subtle_test.js index a5bc2cbaa3..e736670a35 100644 --- a/jscomp/test/array_subtle_test.js +++ b/jscomp/test/array_subtle_test.js @@ -20,12 +20,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,45 +39,45 @@ var v = [ ]; eq("File \"array_subtle_test.res\", line 11, characters 12-19", [ - 4, - v.length - ]); + 4, + v.length +]); eq("File \"array_subtle_test.res\", line 14, characters 5-12", [ - 5, - v.push(3) - ]); + 5, + v.push(3) +]); eq("File \"array_subtle_test.res\", line 15, characters 5-12", [ - 5, - v.length - ]); + 5, + v.length +]); eq("File \"array_subtle_test.res\", line 16, characters 5-12", [ - 5, - v.length - ]); + 5, + v.length +]); eq("File \"array_subtle_test.res\", line 20, characters 5-12", [ - 3, - Caml_array.get(v, 2) - ]); + 3, + Caml_array.get(v, 2) +]); Caml_array.set(v, 2, 4); eq("File \"array_subtle_test.res\", line 22, characters 5-12", [ - 4, - Caml_array.get(v, 2) - ]); + 4, + Caml_array.get(v, 2) +]); while(v.length > 0) { v.pop(); }; eq("File \"array_subtle_test.res\", line 29, characters 5-12", [ - 0, - v.length - ]); + 0, + v.length +]); function f(v) { var x = v.pop(); @@ -114,19 +114,19 @@ function fff4(x) { } eq("File \"array_subtle_test.res\", line 61, characters 3-10", [ - fff3([]), - 1 - ]); + fff3([]), + 1 +]); eq("File \"array_subtle_test.res\", line 62, characters 3-10", [ - fff4([]), - 2 - ]); + fff4([]), + 2 +]); eq("File \"array_subtle_test.res\", line 63, characters 3-10", [ - fff4([1]), - 1 - ]); + fff4([1]), + 1 +]); Mt.from_pair_suites("Array_subtle_test", suites.contents); diff --git a/jscomp/test/array_test.js b/jscomp/test/array_test.js index 9fb0e84aaf..a1161cbe26 100644 --- a/jscomp/test/array_test.js +++ b/jscomp/test/array_test.js @@ -58,298 +58,298 @@ function is_sorted(x) { var array_suites_0 = [ "init", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(5, (function (x) { - return x; - })), - _1: [ - 0, - 1, - 2, - 3, - 4 - ] - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(5, (function (x) { + return x; + })), + _1: [ + 0, + 1, + 2, + 3, + 4 + ] + }; + }) ]; var array_suites_1 = { hd: [ "toList", (function (param) { - var aux = function (xs) { - return List.fold_left((function (acc, param) { - return { - hd: [ - $$Array.to_list(param[0]), - param[1] - ], - tl: acc - }; - }), /* [] */0, xs); - }; - var match = List.split(aux({ - hd: [ - [], - /* [] */0 - ], - tl: /* [] */0 - })); - return { - TAG: "Eq", - _0: match[0], - _1: match[1] - }; - }) + var aux = function (xs) { + return List.fold_left((function (acc, param) { + return { + hd: [ + $$Array.to_list(param[0]), + param[1] + ], + tl: acc + }; + }), /* [] */0, xs); + }; + var match = List.split(aux({ + hd: [ + [], + /* [] */0 + ], + tl: /* [] */0 + })); + return { + TAG: "Eq", + _0: match[0], + _1: match[1] + }; + }) ], tl: { hd: [ "concat", (function (param) { - return { - TAG: "Eq", - _0: [ + return { + TAG: "Eq", + _0: [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + _1: Caml_array.concat({ + hd: [ 0, 1, - 2, - 3, - 4, - 5 + 2 ], - _1: Caml_array.concat({ - hd: [ - 0, - 1, - 2 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: { - hd: [], - tl: { - hd: [5], - tl: /* [] */0 - } - } - } - }) - }; - }) + tl: { + hd: [ + 3, + 4 + ], + tl: { + hd: [], + tl: { + hd: [5], + tl: /* [] */0 + } + } + } + }) + }; + }) ], tl: { hd: [ "make", (function (param) { + return { + TAG: "Eq", + _0: [ + Caml_array.make(100, /* 'a' */97), + Caml_array.make_float(100) + ], + _1: [ + $$Array.init(100, (function (param) { + return /* 'a' */97; + })), + $$Array.init(100, (function (param) { + return 0; + })) + ] + }; + }) + ], + tl: { + hd: [ + "sub", + (function (param) { return { TAG: "Eq", - _0: [ - Caml_array.make(100, /* 'a' */97), - Caml_array.make_float(100) - ], + _0: $$Array.sub([ + 0, + 1, + 2, + 3, + 4 + ], 2, 2), _1: [ - $$Array.init(100, (function (param) { - return /* 'a' */97; - })), - $$Array.init(100, (function (param) { - return 0; - })) + 2, + 3 ] }; }) - ], - tl: { - hd: [ - "sub", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.sub([ - 0, - 1, - 2, - 3, - 4 - ], 2, 2), - _1: [ - 2, - 3 - ] - }; - }) ], tl: { hd: [ "blit", (function (param) { - var u = [ - 100, - 0, - 0 - ]; - var v = $$Array.init(3, (function (x) { - return (x << 1); - })); - $$Array.blit(v, 1, u, 1, 2); - return { - TAG: "Eq", - _0: [ - [ - 0, - 2, - 4 - ], - [ - 100, - 2, - 4 - ] + var u = [ + 100, + 0, + 0 + ]; + var v = $$Array.init(3, (function (x) { + return (x << 1); + })); + $$Array.blit(v, 1, u, 1, 2); + return { + TAG: "Eq", + _0: [ + [ + 0, + 2, + 4 ], - _1: [ - v, - u + [ + 100, + 2, + 4 ] - }; - }) + ], + _1: [ + v, + u + ] + }; + }) ], tl: { hd: [ "File \"array_test.res\", line 75, characters 8-15", (function (param) { + var a0 = $$Array.init(100, (function (i) { + return (i << 0); + })); + $$Array.blit(a0, 10, a0, 5, 20); + return { + TAG: "Eq", + _0: true, + _1: starts_with(a0, [ + 0, + 1, + 2, + 3, + 4, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ], (function (prim0, prim1) { + return prim0 === prim1; + })) + }; + }) + ], + tl: { + hd: [ + "File \"array_test.res\", line 118, characters 8-15", + (function (param) { var a0 = $$Array.init(100, (function (i) { - return (i << 0); - })); - $$Array.blit(a0, 10, a0, 5, 20); + return (i << 0); + })); + $$Array.blit(a0, 5, a0, 10, 20); return { TAG: "Eq", _0: true, _1: starts_with(a0, [ - 0, - 1, - 2, - 3, - 4, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28 - ], (function (prim0, prim1) { - return prim0 === prim1; - })) + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], (function (prim0, prim1) { + return prim0 === prim1; + })) }; }) - ], - tl: { - hd: [ - "File \"array_test.res\", line 118, characters 8-15", - (function (param) { - var a0 = $$Array.init(100, (function (i) { - return (i << 0); - })); - $$Array.blit(a0, 5, a0, 10, 20); - return { - TAG: "Eq", - _0: true, - _1: starts_with(a0, [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20 - ], (function (prim0, prim1) { - return prim0 === prim1; - })) - }; - }) ], tl: { hd: [ "make", (function (param) { - return { - TAG: "Eq", - _0: Caml_array.make(2, 1), - _1: [ - 1, - 1 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_array.make(2, 1), + _1: [ + 1, + 1 + ] + }; + }) ], tl: { hd: [ "sort", (function (param) { - var u = [ - 3, + var u = [ + 3, + 0, + 1 + ]; + $$Array.sort(Caml.int_compare, u); + return { + TAG: "Eq", + _0: Caml_obj.equal([ 0, - 1 - ]; - $$Array.sort(Caml.int_compare, u); - return { - TAG: "Eq", - _0: Caml_obj.equal([ - 0, - 1, - 3 - ], u), - _1: true - }; - }) + 1, + 3 + ], u), + _1: true + }; + }) ], tl: { hd: [ "sort_large", (function (param) { - var v = $$Array.init(4, (function (i) { - return i % 17; - })); - $$Array.sort(Caml.int_compare, v); - return { - TAG: "Eq", - _0: true, - _1: is_sorted(v) - }; - }) + var v = $$Array.init(4, (function (i) { + return i % 17; + })); + $$Array.sort(Caml.int_compare, v); + return { + TAG: "Eq", + _0: true, + _1: is_sorted(v) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ast_abstract_test.js b/jscomp/test/ast_abstract_test.js index 6238172472..967a7625c3 100644 --- a/jscomp/test/ast_abstract_test.js +++ b/jscomp/test/ast_abstract_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/async_inline.js b/jscomp/test/async_inline.js index c0094bf55d..50c38d479f 100644 --- a/jscomp/test/async_inline.js +++ b/jscomp/test/async_inline.js @@ -12,16 +12,16 @@ var inlined = willBeInlined(); function wrapSomethingAsync(param) { ((async function (param) { - var test = await Promise.resolve("Test"); - console.log(test); - })(777)); + var test = await Promise.resolve("Test"); + console.log(test); + })(777)); } function wrapSomethingAsync2(param) { ((async function (param) { - var test = await Promise.resolve("Test"); - console.log(test); - })()); + var test = await Promise.resolve("Test"); + console.log(test); + })()); } async function doSomethingAsync(someAsyncFunction) { @@ -76,8 +76,8 @@ async function nested2(param) { function onSubmit(param) { return React.useCallback(async function (_a, b) { - return await b; - }); + return await b; + }); } var tci = 3; diff --git a/jscomp/test/attr_test.js b/jscomp/test/attr_test.js index 72d0bdde2c..c1b21aff87 100644 --- a/jscomp/test/attr_test.js +++ b/jscomp/test/attr_test.js @@ -16,8 +16,8 @@ var hh = 1 + 2; function f(x) { des(x, (function (param) { - console.log("hei"); - })); + console.log("hei"); + })); } exports.u = u; diff --git a/jscomp/test/bdd.js b/jscomp/test/bdd.js index 48bae95cfa..5a62c994f1 100644 --- a/jscomp/test/bdd.js +++ b/jscomp/test/bdd.js @@ -89,9 +89,9 @@ function resize(newSize) { } else { var ind = hashVal(getId(n._0), getId(n._3), n._1) & newSz_1; Caml_array.set(newArr, ind, { - hd: n, - tl: Caml_array.get(newArr, ind) - }); + hd: n, + tl: Caml_array.get(newArr, ind) + }); _bucket = bucket.tl; continue ; } @@ -107,18 +107,18 @@ function resize(newSize) { function insert(idl, idh, v, ind, bucket, newNode) { if (n_items.contents <= sz_1.contents) { Caml_array.set(htab.contents, ind, { - hd: newNode, - tl: bucket - }); + hd: newNode, + tl: bucket + }); n_items.contents = n_items.contents + 1 | 0; return; } resize((sz_1.contents + sz_1.contents | 0) + 2 | 0); var ind$1 = hashVal(idl, idh, v) & sz_1.contents; Caml_array.set(htab.contents, ind$1, { - hd: newNode, - tl: Caml_array.get(htab.contents, ind$1) - }); + hd: newNode, + tl: Caml_array.get(htab.contents, ind$1) + }); } function resetUnique(param) { diff --git a/jscomp/test/belt_result_alias_test.js b/jscomp/test/belt_result_alias_test.js index b66a69291e..0a50a1287d 100644 --- a/jscomp/test/belt_result_alias_test.js +++ b/jscomp/test/belt_result_alias_test.js @@ -4,17 +4,17 @@ var Belt_Result = require("../../lib/js/belt_Result.js"); Belt_Result.map({ - TAG: "Ok", - _0: "Test" - }, (function (r) { - return "Value: " + r; - })); + TAG: "Ok", + _0: "Test" +}, (function (r) { + return "Value: " + r; +})); Belt_Result.getWithDefault(Belt_Result.map({ - TAG: "Error", - _0: "error" - }, (function (r) { - return "Value: " + r; - })), "success"); + TAG: "Error", + _0: "error" +}, (function (r) { + return "Value: " + r; +})), "success"); /* Not a pure module */ diff --git a/jscomp/test/bench.js b/jscomp/test/bench.js index d7206950d9..c7d2ae306f 100644 --- a/jscomp/test/bench.js +++ b/jscomp/test/bench.js @@ -48,14 +48,14 @@ function fold_left(f, x, a) { function f2(param) { var arr = init(3000000, (function (i) { - return i; - })); + return i; + })); var b = map((function (i) { - return i + i - 1; - }), arr); + return i + i - 1; + }), arr); var v = fold_left((function (prim0, prim1) { - return prim0 + prim1; - }), 0, b); + return prim0 + prim1; + }), 0, b); console.log(Pervasives.string_of_float(v)); } diff --git a/jscomp/test/bigint_test.js b/jscomp/test/bigint_test.js index 7cc08970f0..b6dac732aa 100644 --- a/jscomp/test/bigint_test.js +++ b/jscomp/test/bigint_test.js @@ -123,34 +123,34 @@ Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 42, charac Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 43, characters 5-12", Caml_obj.equal(1000000000000000000000000000000000000000000000000000000000000000000000000000000000000n, -1000000000000000000000000000000000000000000000000000000000000000000000000000000000000n), false); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 44, characters 5-12", ( - 1n !== 1n ? ( - 1n !== 2n ? 0n : 4n - ) : 3n - ) === 3n, true); + 1n !== 1n ? ( + 1n !== 2n ? 0n : 4n + ) : 3n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 49, characters 5-12", Caml_obj.equal(1n !== 1n ? ( - 1n !== 2n ? 0n : 4n - ) : 3n, 3n), true); + 1n !== 2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 54, characters 5-12", ( - -1n !== -2n ? ( - -1n !== -1n ? 0n : 3n - ) : 4n - ) === 3n, true); + -1n !== -2n ? ( + -1n !== -1n ? 0n : 3n + ) : 4n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 59, characters 5-12", Caml_obj.equal(-1n !== -1n ? ( - -1n !== 2n ? 0n : 4n - ) : 3n, 3n), true); + -1n !== 2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 64, characters 5-12", ( - -1000n !== -1000n ? ( - -1000n !== -2n ? 0n : 4n - ) : 3n - ) === 3n, true); + -1000n !== -1000n ? ( + -1000n !== -2n ? 0n : 4n + ) : 3n +) === 3n, true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 69, characters 5-12", Caml_obj.equal(-1000n !== -1000n ? ( - -1000n !== -2n ? 0n : 4n - ) : 3n, 3n), true); + -1000n !== -2n ? 0n : 4n + ) : 3n, 3n), true); Mt_global.collect_eq(test_id, suites, "File \"bigint_test.res\", line 74, characters 5-12", 9n & 1n, 1n); diff --git a/jscomp/test/block_alias_test.js b/jscomp/test/block_alias_test.js index f74dce09ac..20b7e2d643 100644 --- a/jscomp/test/block_alias_test.js +++ b/jscomp/test/block_alias_test.js @@ -53,18 +53,18 @@ var V = { var f = Caml_obj.equal; eq("File \"block_alias_test.res\", line 27, characters 3-10", List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); b("File \"block_alias_test.res\", line 28, characters 2-9", Caml_obj.equal(v0, { - TAG: "A", - _0: 0, - _1: 1 - })); + TAG: "A", + _0: 0, + _1: 1 +})); eq("File \"block_alias_test.res\", line 29, characters 3-10", v0, v1); diff --git a/jscomp/test/boolean_test.js b/jscomp/test/boolean_test.js index 2f60072ef0..d64ec5ae96 100644 --- a/jscomp/test/boolean_test.js +++ b/jscomp/test/boolean_test.js @@ -5,11 +5,11 @@ var Mt = require("./mt.js"); var Test_bool_equal = require("./test_bool_equal.js"); Mt.from_suites("boolean", { - hd: [ - "bool_equal", - Test_bool_equal.assertions - ], - tl: /* [] */0 - }); + hd: [ + "bool_equal", + Test_bool_equal.assertions + ], + tl: /* [] */0 +}); /* Not a pure module */ diff --git a/jscomp/test/bs_abstract_test.js b/jscomp/test/bs_abstract_test.js index 2590040e73..c05cf5631a 100644 --- a/jscomp/test/bs_abstract_test.js +++ b/jscomp/test/bs_abstract_test.js @@ -12,8 +12,8 @@ v.tl = v; var f = { k: (function (x, y) { - return x === y; - }), + return x === y; + }), y: "x" }; diff --git a/jscomp/test/bs_array_test.js b/jscomp/test/bs_array_test.js index edc4ee7425..f5e587d105 100644 --- a/jscomp/test/bs_array_test.js +++ b/jscomp/test/bs_array_test.js @@ -37,12 +37,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,17 +53,17 @@ function push(prim0, prim1) { } console.log([ - 1, - 2, - 3, - 4 - ].filter(function (x) { - return x > 2; - }).map(function (x, i) { - return x + i | 0; - }).reduce((function (x, y) { - return x + y | 0; - }), 0)); + 1, + 2, + 3, + 4 +].filter(function (x) { + return x > 2; +}).map(function (x, i) { + return x + i | 0; +}).reduce((function (x, y) { + return x + y | 0; +}), 0)); var v = [ 1, @@ -71,32 +71,32 @@ var v = [ ]; eq("File \"bs_array_test.res\", line 31, characters 4-11", [ - Belt_Array.get(v, 0), - Belt_Array.get(v, 1), - Belt_Array.get(v, 2), - Belt_Array.get(v, 3), - Belt_Array.get(v, -1) - ], [ - 1, - 2, - undefined, - undefined, - undefined - ]); + Belt_Array.get(v, 0), + Belt_Array.get(v, 1), + Belt_Array.get(v, 2), + Belt_Array.get(v, 3), + Belt_Array.get(v, -1) +], [ + 1, + 2, + undefined, + undefined, + undefined +]); $$throw("File \"bs_array_test.res\", line 35, characters 8-15", (function (param) { - Belt_Array.getExn([ - 0, - 1 - ], -1); - })); + Belt_Array.getExn([ + 0, + 1 + ], -1); +})); $$throw("File \"bs_array_test.res\", line 36, characters 8-15", (function (param) { - Belt_Array.getExn([ - 0, - 1 - ], 2); - })); + Belt_Array.getExn([ + 0, + 1 + ], 2); +})); var partial_arg = [ 0, @@ -108,31 +108,31 @@ function f(param) { } b("File \"bs_array_test.res\", line 38, characters 4-11", Caml_obj.equal([ - Curry._1(f, 0), - Curry._1(f, 1) - ], [ - 0, - 1 - ])); + Curry._1(f, 0), + Curry._1(f, 1) +], [ + 0, + 1 +])); $$throw("File \"bs_array_test.res\", line 44, characters 8-15", (function (param) { - Belt_Array.setExn([ - 0, - 1 - ], -1, 0); - })); + Belt_Array.setExn([ + 0, + 1 + ], -1, 0); +})); $$throw("File \"bs_array_test.res\", line 45, characters 8-15", (function (param) { - Belt_Array.setExn([ - 0, - 1 - ], 2, 0); - })); + Belt_Array.setExn([ + 0, + 1 + ], 2, 0); +})); b("File \"bs_array_test.res\", line 46, characters 4-11", !Belt_Array.set([ - 1, - 2 - ], 2, 0)); + 1, + 2 +], 2, 0)); var v$1 = [ 1, @@ -191,118 +191,118 @@ function id(x) { } eq("File \"bs_array_test.res\", line 84, characters 5-12", Js_list.toVector({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 85, characters 5-12", Js_vector.map((function (x) { - return x + 1 | 0; - }), [ - 1, - 2, - 3 - ]), [ - 2, - 3, - 4 - ]); + return x + 1 | 0; +}), [ + 1, + 2, + 3 +]), [ + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 86, characters 5-12", Caml_array.make(5, 3), [ - 3, - 3, - 3, - 3, - 3 - ]); + 3, + 3, + 3, + 3, + 3 +]); var a = Js_vector.init(5, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); eq("File \"bs_array_test.res\", line 88, characters 4-11", (Js_vector.filterInPlace((function (j) { - return j % 2 === 0; - }), a), a), [ - 2, - 4 - ]); + return j % 2 === 0; +}), a), a), [ + 2, + 4 +]); var a$1 = Js_vector.init(5, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); eq("File \"bs_array_test.res\", line 98, characters 4-11", (Js_vector.filterInPlace((function (j) { - return j % 2 !== 0; - }), a$1), a$1), [ - 1, - 3, - 5 - ]); + return j % 2 !== 0; +}), a$1), a$1), [ + 1, + 3, + 5 +]); eq("File \"bs_array_test.res\", line 107, characters 5-12", Js_list.toVector({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 108, characters 5-12", Js_list.toVector({ - hd: 1, - tl: /* [] */0 - }), [1]); + hd: 1, + tl: /* [] */0 +}), [1]); id(/* [] */0); id({ - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}); id({ - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 4, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: /* [] */0 - } - } + hd: 5, + tl: /* [] */0 } } - }); + } + } +}); id(Js_vector.toList(Js_vector.init(100, (function (i) { - return i; - })))); + return i; +})))); function add(x, y) { return x + y | 0; } var v$5 = Belt_Array.makeBy(3000, (function (i) { - return i; - })); + return i; +})); var u = Belt_Array.shuffle(v$5); @@ -311,30 +311,30 @@ neq("File \"bs_array_test.res\", line 122, characters 6-13", u, v$5); eq("File \"bs_array_test.res\", line 124, characters 5-12", Belt_Array.reduce(u, 0, add), Belt_Array.reduce(v$5, 0, add)); b("File \"bs_array_test.res\", line 129, characters 4-11", Caml_obj.equal(Belt_Array.range(0, 3), [ - 0, - 1, - 2, - 3 - ])); + 0, + 1, + 2, + 3 +])); b("File \"bs_array_test.res\", line 130, characters 4-11", Caml_obj.equal(Belt_Array.range(3, 0), [])); b("File \"bs_array_test.res\", line 131, characters 4-11", Caml_obj.equal(Belt_Array.range(3, 3), [3])); b("File \"bs_array_test.res\", line 133, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(0, 10, 3), [ - 0, - 3, - 6, - 9 - ])); + 0, + 3, + 6, + 9 +])); b("File \"bs_array_test.res\", line 134, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(0, 12, 3), [ - 0, - 3, - 6, - 9, - 12 - ])); + 0, + 3, + 6, + 9, + 12 +])); b("File \"bs_array_test.res\", line 135, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(33, 0, 1), [])); @@ -347,44 +347,44 @@ b("File \"bs_array_test.res\", line 138, characters 4-11", Caml_obj.equal(Belt_A b("File \"bs_array_test.res\", line 139, characters 4-11", Caml_obj.equal(Belt_Array.rangeBy(3, 3, 1), [3])); eq("File \"bs_array_test.res\", line 143, characters 5-12", Belt_Array.reduceReverse([], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 100); + return prim0 - prim1 | 0; +})), 100); eq("File \"bs_array_test.res\", line 144, characters 5-12", Belt_Array.reduceReverse([ - 1, - 2 - ], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 97); + 1, + 2 +], 100, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), 97); eq("File \"bs_array_test.res\", line 145, characters 5-12", Belt_Array.reduceReverse([ - 1, - 2, - 3, - 4 - ], 100, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), 90); + 1, + 2, + 3, + 4 +], 100, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), 90); eq("File \"bs_array_test.res\", line 146, characters 5-12", Belt_Array.reduceWithIndex([ - 1, - 2, - 3, - 4 - ], 0, (function (acc, x, i) { - return (acc + x | 0) + i | 0; - })), 16); + 1, + 2, + 3, + 4 +], 0, (function (acc, x, i) { + return (acc + x | 0) + i | 0; +})), 16); b("File \"bs_array_test.res\", line 147, characters 4-11", Belt_Array.reduceReverse2([ - 1, - 2, - 3 - ], [ - 1, - 2 - ], 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 6); + 1, + 2, + 3 +], [ + 1, + 2 +], 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 6); function addone(x) { return x + 1 | 0; @@ -414,43 +414,43 @@ function makeMatrixExn(sx, sy, init) { } eq("File \"bs_array_test.res\", line 166, characters 5-12", Belt_Array.makeBy(0, (function (param) { - return 1; - })), []); + return 1; +})), []); eq("File \"bs_array_test.res\", line 167, characters 5-12", Belt_Array.makeBy(3, (function (i) { - return i; - })), [ - 0, - 1, - 2 - ]); + return i; +})), [ + 0, + 1, + 2 +]); eq("File \"bs_array_test.res\", line 168, characters 5-12", makeMatrixExn(3, 4, 1), [ - [ - 1, - 1, - 1, - 1 - ], - [ - 1, - 1, - 1, - 1 - ], - [ - 1, - 1, - 1, - 1 - ] - ]); + [ + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1 + ] +]); eq("File \"bs_array_test.res\", line 169, characters 5-12", makeMatrixExn(3, 0, 0), [ - [], - [], - [] - ]); + [], + [], + [] +]); eq("File \"bs_array_test.res\", line 170, characters 5-12", makeMatrixExn(0, 3, 1), []); @@ -459,129 +459,129 @@ eq("File \"bs_array_test.res\", line 171, characters 5-12", makeMatrixExn(1, 1, eq("File \"bs_array_test.res\", line 172, characters 5-12", [].slice(0), []); eq("File \"bs_array_test.res\", line 173, characters 5-12", Belt_Array.map([], (function (prim) { - return prim + 1 | 0; - })), []); + return prim + 1 | 0; +})), []); eq("File \"bs_array_test.res\", line 174, characters 5-12", Belt_Array.mapWithIndex([], add), []); eq("File \"bs_array_test.res\", line 175, characters 5-12", Belt_Array.mapWithIndex([ - 1, - 2, - 3 - ], add), [ - 1, - 3, - 5 - ]); + 1, + 2, + 3 +], add), [ + 1, + 3, + 5 +]); eq("File \"bs_array_test.res\", line 176, characters 5-12", Belt_List.fromArray([]), /* [] */0); eq("File \"bs_array_test.res\", line 177, characters 5-12", Belt_List.fromArray([1]), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}); eq("File \"bs_array_test.res\", line 178, characters 5-12", Belt_List.fromArray([ - 1, - 2, - 3 - ]), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + 1, + 2, + 3 +]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); eq("File \"bs_array_test.res\", line 179, characters 5-12", Belt_Array.map([ - 1, - 2, - 3 - ], (function (prim) { - return prim + 1 | 0; - })), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +], (function (prim) { + return prim + 1 | 0; +})), [ + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 180, characters 5-12", Belt_List.toArray(/* [] */0), []); eq("File \"bs_array_test.res\", line 181, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: /* [] */0 - }), [1]); + hd: 1, + tl: /* [] */0 +}), [1]); eq("File \"bs_array_test.res\", line 182, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), [ - 1, - 2 - ]); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), [ + 1, + 2 +]); eq("File \"bs_array_test.res\", line 183, characters 5-12", Belt_List.toArray({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), [ - 1, - 2, - 3 - ]); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), [ + 1, + 2, + 3 +]); var v$6 = Belt_Array.makeBy(10, (function (i) { - return i; - })); + return i; +})); var v0 = Belt_Array.keep(v$6, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var v1 = Belt_Array.keep(v$6, (function (x) { - return x % 3 === 0; - })); + return x % 3 === 0; +})); var v2 = Belt_Array.keepMap(v$6, (function (x) { - if (x % 2 === 0) { - return x + 1 | 0; - } - - })); + if (x % 2 === 0) { + return x + 1 | 0; + } + +})); eq("File \"bs_array_test.res\", line 197, characters 5-12", v0, [ - 0, - 2, - 4, - 6, - 8 - ]); + 0, + 2, + 4, + 6, + 8 +]); eq("File \"bs_array_test.res\", line 198, characters 5-12", v1, [ - 0, - 3, - 6, - 9 - ]); + 0, + 3, + 6, + 9 +]); eq("File \"bs_array_test.res\", line 199, characters 5-12", v2, [ - 1, - 3, - 5, - 7, - 9 - ]); + 1, + 3, + 5, + 7, + 9 +]); var a$2 = [ 1, @@ -592,36 +592,36 @@ var a$2 = [ ]; var match = Belt_Array.partition(a$2, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); eq("File \"bs_array_test.res\", line 205, characters 5-12", match[0], [ - 2, - 4 - ]); + 2, + 4 +]); eq("File \"bs_array_test.res\", line 206, characters 5-12", match[1], [ - 1, - 3, - 5 - ]); + 1, + 3, + 5 +]); var match$1 = Belt_Array.partition(a$2, (function (x) { - return x === 2; - })); + return x === 2; +})); eq("File \"bs_array_test.res\", line 208, characters 5-12", match$1[0], [2]); eq("File \"bs_array_test.res\", line 209, characters 5-12", match$1[1], [ - 1, - 3, - 4, - 5 - ]); + 1, + 3, + 4, + 5 +]); var match$2 = Belt_Array.partition([], (function (x) { - return false; - })); + return false; +})); eq("File \"bs_array_test.res\", line 211, characters 5-12", match$2[0], []); @@ -636,25 +636,25 @@ var a$3 = [ ]; eq("File \"bs_array_test.res\", line 217, characters 5-12", Belt_Array.slice(a$3, 0, 2), [ - 1, - 2 - ]); + 1, + 2 +]); eq("File \"bs_array_test.res\", line 218, characters 5-12", Belt_Array.slice(a$3, 0, 5), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 219, characters 5-12", Belt_Array.slice(a$3, 0, 15), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 220, characters 5-12", Belt_Array.slice(a$3, 5, 1), []); @@ -667,43 +667,43 @@ eq("File \"bs_array_test.res\", line 223, characters 5-12", Belt_Array.slice(a$3 eq("File \"bs_array_test.res\", line 224, characters 5-12", Belt_Array.slice(a$3, -2, 1), [4]); eq("File \"bs_array_test.res\", line 225, characters 5-12", Belt_Array.slice(a$3, -2, 2), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 226, characters 5-12", Belt_Array.slice(a$3, -2, 3), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 227, characters 5-12", Belt_Array.slice(a$3, -10, 3), [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 228, characters 5-12", Belt_Array.slice(a$3, -10, 4), [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); eq("File \"bs_array_test.res\", line 229, characters 5-12", Belt_Array.slice(a$3, -10, 5), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 230, characters 5-12", Belt_Array.slice(a$3, -10, 6), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 231, characters 5-12", Belt_Array.slice(a$3, 0, 0), []); @@ -718,12 +718,12 @@ var a$4 = [ ]; eq("File \"bs_array_test.res\", line 237, characters 5-12", Belt_Array.sliceToEnd(a$4, 0), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 238, characters 5-12", Belt_Array.sliceToEnd(a$4, 5), []); @@ -732,158 +732,158 @@ eq("File \"bs_array_test.res\", line 239, characters 5-12", Belt_Array.sliceToEn eq("File \"bs_array_test.res\", line 240, characters 5-12", Belt_Array.sliceToEnd(a$4, -1), [5]); eq("File \"bs_array_test.res\", line 241, characters 5-12", Belt_Array.sliceToEnd(a$4, -2), [ - 4, - 5 - ]); + 4, + 5 +]); eq("File \"bs_array_test.res\", line 242, characters 5-12", Belt_Array.sliceToEnd(a$4, -10), [ - 1, - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4, + 5 +]); eq("File \"bs_array_test.res\", line 243, characters 5-12", Belt_Array.sliceToEnd(a$4, 6), []); var a$5 = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); Belt_Array.fill(a$5, 0, 3, 0); eq("File \"bs_array_test.res\", line 248, characters 5-12", a$5.slice(0), [ - 0, - 0, - 0, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 0, + 0, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.fill(a$5, 2, 8, 1); eq("File \"bs_array_test.res\", line 250, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 +]); Belt_Array.fill(a$5, 8, 1, 9); eq("File \"bs_array_test.res\", line 252, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 9, - 1 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 9, + 1 +]); Belt_Array.fill(a$5, 8, 2, 9); eq("File \"bs_array_test.res\", line 254, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 9, - 9 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 9, + 9 +]); Belt_Array.fill(a$5, 8, 3, 12); eq("File \"bs_array_test.res\", line 256, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 12, - 12 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 12, + 12 +]); Belt_Array.fill(a$5, -2, 3, 11); eq("File \"bs_array_test.res\", line 258, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 11, - 11 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 11, + 11 +]); Belt_Array.fill(a$5, -3, 3, 10); eq("File \"bs_array_test.res\", line 260, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 10, - 10, - 10 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 10, + 10, + 10 +]); Belt_Array.fill(a$5, -3, 1, 7); eq("File \"bs_array_test.res\", line 262, characters 5-12", a$5.slice(0), [ - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 7, - 10, - 10 - ]); + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 7, + 10, + 10 +]); Belt_Array.fill(a$5, -13, 1, 7); eq("File \"bs_array_test.res\", line 264, characters 5-12", a$5.slice(0), [ - 7, - 0, - 1, - 1, - 1, - 1, - 1, - 7, - 10, - 10 - ]); + 7, + 0, + 1, + 1, + 1, + 1, + 1, + 7, + 10, + 10 +]); Belt_Array.fill(a$5, -13, 12, 7); @@ -902,84 +902,84 @@ var b$1 = [ Belt_Array.fill(b$1, 0, 0, 0); eq("File \"bs_array_test.res\", line 271, characters 5-12", b$1, [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); Belt_Array.fill(b$1, 4, 1, 0); eq("File \"bs_array_test.res\", line 273, characters 5-12", b$1, [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); var a0 = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); var b0 = Belt_Array.make(10, 3); Belt_Array.blit(a0, 1, b0, 2, 5); eq("File \"bs_array_test.res\", line 280, characters 5-12", b0.slice(0), [ - 3, - 3, - 1, - 2, - 3, - 4, - 5, - 3, - 3, - 3 - ]); + 3, + 3, + 1, + 2, + 3, + 4, + 5, + 3, + 3, + 3 +]); Belt_Array.blit(a0, -1, b0, 2, 5); eq("File \"bs_array_test.res\", line 282, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 3, - 3 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 3, + 3 +]); Belt_Array.blit(a0, -1, b0, -2, 5); eq("File \"bs_array_test.res\", line 284, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 9, - 3 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 9, + 3 +]); Belt_Array.blit(a0, -2, b0, -2, 2); eq("File \"bs_array_test.res\", line 286, characters 5-12", b0.slice(0), [ - 3, - 3, - 9, - 2, - 3, - 4, - 5, - 3, - 8, - 9 - ]); + 3, + 3, + 9, + 2, + 3, + 4, + 5, + 3, + 8, + 9 +]); Belt_Array.blit(a0, -11, b0, -11, 100); @@ -990,68 +990,68 @@ Belt_Array.blit(a0, -11, b0, -11, 2); eq("File \"bs_array_test.res\", line 290, characters 5-12", b0.slice(0), a0); var aa = Belt_Array.makeBy(10, (function (x) { - return x; - })); + return x; +})); Belt_Array.blit(aa, -1, aa, 1, 2); eq("File \"bs_array_test.res\", line 293, characters 5-12", aa.slice(0), [ - 0, - 9, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 9, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.blit(aa, -2, aa, 1, 2); eq("File \"bs_array_test.res\", line 295, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 4, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 4, + 5, + 6, + 7, + 8, + 9 +]); Belt_Array.blit(aa, -5, aa, 4, 3); eq("File \"bs_array_test.res\", line 297, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 5, - 6, - 7, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 5, + 6, + 7, + 7, + 8, + 9 +]); Belt_Array.blit(aa, 4, aa, 5, 3); eq("File \"bs_array_test.res\", line 299, characters 5-12", aa.slice(0), [ - 0, - 8, - 9, - 3, - 5, - 5, - 6, - 7, - 8, - 9 - ]); + 0, + 8, + 9, + 3, + 5, + 5, + 6, + 7, + 8, + 9 +]); eq("File \"bs_array_test.res\", line 300, characters 5-12", Belt_Array.make(0, 3), []); @@ -1066,184 +1066,184 @@ var c = [ Belt_Array.blit(c, 4, c, 1, 1); eq("File \"bs_array_test.res\", line 304, characters 5-12", c, [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); eq("File \"bs_array_test.res\", line 308, characters 5-12", Belt_Array.zip([ - 1, - 2, - 3 - ], [ - 2, - 3, - 4, - 1 - ]), [ - [ - 1, - 2 - ], - [ - 2, - 3 - ], - [ - 3, - 4 - ] - ]); + 1, + 2, + 3 +], [ + 2, + 3, + 4, + 1 +]), [ + [ + 1, + 2 + ], + [ + 2, + 3 + ], + [ + 3, + 4 + ] +]); eq("File \"bs_array_test.res\", line 309, characters 5-12", Belt_Array.zip([ - 2, - 3, - 4, - 1 - ], [ - 1, - 2, - 3 - ]), [ - [ - 2, - 1 - ], - [ - 3, - 2 - ], - [ - 4, - 3 - ] - ]); + 2, + 3, + 4, + 1 +], [ + 1, + 2, + 3 +]), [ + [ + 2, + 1 + ], + [ + 3, + 2 + ], + [ + 4, + 3 + ] +]); eq("File \"bs_array_test.res\", line 310, characters 5-12", Belt_Array.zipBy([ - 2, - 3, - 4, - 1 - ], [ - 1, - 2, - 3 - ], (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), [ - 1, - 1, - 1 - ]); + 2, + 3, + 4, + 1 +], [ + 1, + 2, + 3 +], (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), [ + 1, + 1, + 1 +]); eq("File \"bs_array_test.res\", line 311, characters 5-12", Belt_Array.zipBy([ - 1, - 2, - 3 - ], [ - 2, - 3, - 4, - 1 - ], (function (prim0, prim1) { - return prim0 - prim1 | 0; - })), Belt_Array.map([ - 1, - 1, - 1 - ], (function (x) { - return -x | 0; - }))); + 1, + 2, + 3 +], [ + 2, + 3, + 4, + 1 +], (function (prim0, prim1) { + return prim0 - prim1 | 0; +})), Belt_Array.map([ + 1, + 1, + 1 +], (function (x) { + return -x | 0; +}))); eq("File \"bs_array_test.res\", line 312, characters 5-12", Belt_Array.unzip([ - [ - 1, - 2 - ], - [ - 2, - 3 - ], - [ - 3, - 4 - ] - ]), [ - [ - 1, - 2, - 3 - ], - [ - 2, - 3, - 4 - ] - ]); + [ + 1, + 2 + ], + [ + 2, + 3 + ], + [ + 3, + 4 + ] +]), [ + [ + 1, + 2, + 3 + ], + [ + 2, + 3, + 4 + ] +]); function sumUsingForEach(xs) { var v = { contents: 0 }; Belt_Array.forEach(xs, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } eq("File \"bs_array_test.res\", line 324, characters 5-12", sumUsingForEach([ - 0, - 1, - 2, - 3, - 4 - ]), 10); + 0, + 1, + 2, + 3, + 4 +]), 10); b("File \"bs_array_test.res\", line 325, characters 4-11", !Belt_Array.every([ - 0, - 1, - 2, - 3, - 4 - ], (function (x) { - return x > 2; - }))); + 0, + 1, + 2, + 3, + 4 +], (function (x) { + return x > 2; +}))); b("File \"bs_array_test.res\", line 326, characters 4-11", Belt_Array.some([ - 1, - 3, - 7, - 8 - ], (function (x) { - return x % 2 === 0; - }))); + 1, + 3, + 7, + 8 +], (function (x) { + return x % 2 === 0; +}))); b("File \"bs_array_test.res\", line 327, characters 4-11", !Belt_Array.some([ - 1, - 3, - 7 - ], (function (x) { - return x % 2 === 0; - }))); + 1, + 3, + 7 +], (function (x) { + return x % 2 === 0; +}))); b("File \"bs_array_test.res\", line 328, characters 4-11", !Belt_Array.eq([ - 0, - 1 - ], [1], (function (prim0, prim1) { - return prim0 === prim1; - }))); + 0, + 1 +], [1], (function (prim0, prim1) { + return prim0 === prim1; +}))); var c$1 = { contents: 0 }; b("File \"bs_array_test.res\", line 330, characters 4-11", (Belt_Array.forEachWithIndex([ - 1, - 1, - 1 - ], (function (i, v) { - c$1.contents = (c$1.contents + i | 0) + v | 0; - })), c$1.contents === 6)); + 1, + 1, + 1 +], (function (i, v) { + c$1.contents = (c$1.contents + i | 0) + v | 0; +})), c$1.contents === 6)); function id$1(loc, x) { var u = x.slice(0); @@ -1255,22 +1255,22 @@ id$1("File \"bs_array_test.res\", line 351, characters 5-12", []); id$1("File \"bs_array_test.res\", line 352, characters 5-12", [1]); id$1("File \"bs_array_test.res\", line 353, characters 5-12", [ - 1, - 2 - ]); + 1, + 2 +]); id$1("File \"bs_array_test.res\", line 354, characters 5-12", [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]); id$1("File \"bs_array_test.res\", line 355, characters 5-12", [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); function every2(xs, ys) { var partial_arg = Belt_List.toArray(ys); @@ -1289,311 +1289,311 @@ function some2(xs, ys) { } eq("File \"bs_array_test.res\", line 363, characters 5-12", every2(/* [] */0, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 364, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 365, characters 5-12", every2({ - hd: 2, - tl: /* [] */0 - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: /* [] */0 +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 366, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), false); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 367, characters 5-12", every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 0, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 368, characters 5-12", some2(/* [] */0, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), false); + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 369, characters 5-12", some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 370, characters 5-12", some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 371, characters 5-12", some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), false); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), false); eq("File \"bs_array_test.res\", line 372, characters 5-12", some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - })(function (x, y) { - return x > y; - }), true); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } +})(function (x, y) { + return x > y; +}), true); eq("File \"bs_array_test.res\", line 376, characters 5-12", Belt_Array.concat([], [ - 1, - 2, - 3 - ]), [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 +]), [ + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 377, characters 5-12", Belt_Array.concat([], []), []); eq("File \"bs_array_test.res\", line 378, characters 5-12", Belt_Array.concat([ - 3, - 2 - ], [ - 1, - 2, - 3 - ]), [ - 3, - 2, - 1, - 2, - 3 - ]); + 3, + 2 +], [ + 1, + 2, + 3 +]), [ + 3, + 2, + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 379, characters 5-12", Belt_Array.concatMany([ - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ] - ]), [ - 3, - 2, - 1, - 2, - 3 - ]); + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ] +]), [ + 3, + 2, + 1, + 2, + 3 +]); eq("File \"bs_array_test.res\", line 380, characters 5-12", Belt_Array.concatMany([ - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ], - [], - [0] - ]), [ - 3, - 2, - 1, - 2, - 3, - 0 - ]); + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ], + [], + [0] +]), [ + 3, + 2, + 1, + 2, + 3, + 0 +]); eq("File \"bs_array_test.res\", line 381, characters 5-12", Belt_Array.concatMany([ - [], - [ - 3, - 2 - ], - [ - 1, - 2, - 3 - ], - [], - [0] - ]), [ - 3, - 2, - 1, - 2, - 3, - 0 - ]); + [], + [ + 3, + 2 + ], + [ + 1, + 2, + 3 + ], + [], + [0] +]), [ + 3, + 2, + 1, + 2, + 3, + 0 +]); eq("File \"bs_array_test.res\", line 382, characters 5-12", Belt_Array.concatMany([ - [], - [] - ]), []); + [], + [] +]), []); b("File \"bs_array_test.res\", line 386, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 0, - 1, - 2, - 3 - ], Caml.int_compare) < 0); + 1, + 2, + 3 +], [ + 0, + 1, + 2, + 3 +], Caml.int_compare) < 0); b("File \"bs_array_test.res\", line 387, characters 4-11", Belt_Array.cmp([ - 0, - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) > 0); + 0, + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], Caml.int_compare) > 0); b("File \"bs_array_test.res\", line 388, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 0, - 1, - 2 - ], Caml.int_compare) > 0); + 1, + 2, + 3 +], [ + 0, + 1, + 2 +], Caml.int_compare) > 0); b("File \"bs_array_test.res\", line 389, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) === 0); + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], Caml.int_compare) === 0); b("File \"bs_array_test.res\", line 390, characters 4-11", Belt_Array.cmp([ - 1, - 2, - 4 - ], [ - 1, - 2, - 3 - ], Caml.int_compare) > 0); + 1, + 2, + 4 +], [ + 1, + 2, + 3 +], Caml.int_compare) > 0); eq("File \"bs_array_test.res\", line 394, characters 5-12", Belt_Array.getBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 1; - })), 2); + 1, + 2, + 3 +], (function (x) { + return x > 1; +})), 2); eq("File \"bs_array_test.res\", line 395, characters 5-12", Belt_Array.getBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 3; - })), undefined); + 1, + 2, + 3 +], (function (x) { + return x > 3; +})), undefined); eq("File \"bs_array_test.res\", line 399, characters 5-12", Belt_Array.getIndexBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 1; - })), 1); + 1, + 2, + 3 +], (function (x) { + return x > 1; +})), 1); eq("File \"bs_array_test.res\", line 400, characters 5-12", Belt_Array.getIndexBy([ - 1, - 2, - 3 - ], (function (x) { - return x > 3; - })), undefined); + 1, + 2, + 3 +], (function (x) { + return x > 3; +})), undefined); var arr = []; @@ -1604,10 +1604,10 @@ arr.push(2); arr.push(1); eq("File \"bs_array_test.res\", line 408, characters 5-12", arr, [ - 3, - 2, - 1 - ]); + 3, + 2, + 1 +]); Mt.from_pair_suites("File \"bs_array_test.res\", line 411, characters 20-27", suites.contents); diff --git a/jscomp/test/bs_auto_uncurry.js b/jscomp/test/bs_auto_uncurry.js index a5814f178b..1d8eb87f75 100644 --- a/jscomp/test/bs_auto_uncurry.js +++ b/jscomp/test/bs_auto_uncurry.js @@ -9,54 +9,54 @@ var Curry$1 = {}; var Block = {}; var xbs = Array.prototype.map.call([ - 1, - 2, - 3, - 5 - ], (function (x) { - return x + 1 | 0; - })); + 1, + 2, + 3, + 5 +], (function (x) { + return x + 1 | 0; +})); function f(cb) { return Array.prototype.map.call([ - 1, - 2, - 3, - 4 - ], Curry.__1(cb)); + 1, + 2, + 3, + 4 + ], Curry.__1(cb)); } var xs = Array.prototype.map.call([ - 1, - 1, - 2 - ], (function (x) { - return function (y) { - return (y + x | 0) + 1 | 0; - }; - })); + 1, + 1, + 2 +], (function (x) { + return function (y) { + return (y + x | 0) + 1 | 0; + }; +})); function f_0(param) { return hi(function (param) { - - }); + + }); } function f_01(param) { return hi(function (x) { - if (x === undefined) { - console.log("x"); - return; - } - - }); + if (x === undefined) { + console.log("x"); + return; + } + + }); } function f_02(xs) { return hi(function (x) { - xs.contents = x; - console.log("x"); - }); + xs.contents = x; + console.log("x"); + }); } function f_03(xs, u) { @@ -82,33 +82,33 @@ function add3(x, y, z) { function h2(x) { return ff(x, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })); + return prim0 + prim1 | 0; + })); } function h3(x) { return ff(x, (function (param, param$1) { - return add3(1, param, param$1); - })); + return add3(1, param, param$1); + })); } function h4(x) { return ff1(x, 3, (function (param, param$1) { - return add3(1, param, param$1); - })); + return add3(1, param, param$1); + })); } function h5(x) { return ff2(x, "3", (function (param, param$1) { - return add3(2, param, param$1); - })); + return add3(2, param, param$1); + })); } function add(x, y) { console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } @@ -127,9 +127,9 @@ var f_unit_magic = unit_magic(); function hh(xs) { return function (param) { Caml_splice_call.spliceApply(f_0002, [ - xs, - param - ]); + xs, + param + ]); }; } diff --git a/jscomp/test/bs_auto_uncurry_test.js b/jscomp/test/bs_auto_uncurry_test.js index f20547212c..d965725a81 100644 --- a/jscomp/test/bs_auto_uncurry_test.js +++ b/jscomp/test/bs_auto_uncurry_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,82 +39,82 @@ var xs = { }; hi(function (x) { - xs.contents = { - hd: x, - tl: xs.contents - }; - }); + xs.contents = { + hd: x, + tl: xs.contents + }; +}); hi(function (x) { - xs.contents = { - hd: x, - tl: xs.contents - }; - }); + xs.contents = { + hd: x, + tl: xs.contents + }; +}); eq("File \"bs_auto_uncurry_test.res\", line 24, characters 5-12", xs.contents, { - hd: undefined, - tl: { - hd: undefined, - tl: /* [] */0 - } - }); + hd: undefined, + tl: { + hd: undefined, + tl: /* [] */0 + } +}); eq("File \"bs_auto_uncurry_test.res\", line 28, characters 5-12", [ - 1, - 2, - 3 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4 +]); eq("File \"bs_auto_uncurry_test.res\", line 29, characters 5-12", [ - 1, - 2, - 3 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4 - ]); + 1, + 2, + 3 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4 +]); eq("File \"bs_auto_uncurry_test.res\", line 31, characters 5-12", [ - 1, - 2, - 3 - ].reduce((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 0), 6); + 1, + 2, + 3 +].reduce((function (prim0, prim1) { + return prim0 + prim1 | 0; +}), 0), 6); eq("File \"bs_auto_uncurry_test.res\", line 33, characters 5-12", [ - 1, - 2, - 3 - ].reduce((function (x, y, i) { - return (x + y | 0) + i | 0; - }), 0), 9); + 1, + 2, + 3 +].reduce((function (x, y, i) { + return (x + y | 0) + i | 0; +}), 0), 9); eq("File \"bs_auto_uncurry_test.res\", line 35, characters 5-12", [ - 1, - 2, - 3 - ].some(function (x) { - return x < 1; - }), false); + 1, + 2, + 3 +].some(function (x) { + return x < 1; +}), false); eq("File \"bs_auto_uncurry_test.res\", line 37, characters 5-12", [ - 1, - 2, - 3 - ].every(function (x) { - return x > 0; - }), true); + 1, + 2, + 3 +].every(function (x) { + return x > 0; +}), true); Mt.from_pair_suites("Bs_auto_uncurry_test", suites.contents); diff --git a/jscomp/test/bs_float_test.js b/jscomp/test/bs_float_test.js index 2322ef8c00..ea3940d789 100644 --- a/jscomp/test/bs_float_test.js +++ b/jscomp/test/bs_float_test.js @@ -30,12 +30,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/bs_hashmap_test.js b/jscomp/test/bs_hashmap_test.js index 10c30c94cc..b5ebd4a8d1 100644 --- a/jscomp/test/bs_hashmap_test.js +++ b/jscomp/test/bs_hashmap_test.js @@ -44,23 +44,23 @@ function add(prim0, prim1) { } Belt_HashMap.mergeMany(empty, [ - [ - 1, - 1 - ], - [ - 2, - 3 - ], - [ - 3, - 3 - ], - [ - 2, - 2 - ] - ]); + [ + 1, + 1 + ], + [ + 2, + 3 + ], + [ + 3, + 3 + ], + [ + 2, + 2 + ] +]); eqx("File \"bs_hashmap_test.res\", line 30, characters 6-13", Belt_HashMap.get(empty, 2), 2); @@ -97,8 +97,8 @@ for(var i$1 = 0; i$1 <= 2000; ++i$1){ eqx("File \"bs_hashmap_test.res\", line 57, characters 6-13", v$1.size, 98000); b("File \"bs_hashmap_test.res\", line 58, characters 4-11", Belt_Array.every(Array_data_util.range(2001, 100000), (function (x) { - return Belt_HashMap.has(v$1, x); - }))); + return Belt_HashMap.has(v$1, x); +}))); Mt.from_pair_suites("Bs_hashmap_test", suites.contents); diff --git a/jscomp/test/bs_hashset_int_test.js b/jscomp/test/bs_hashset_int_test.js index f75660f9cc..d15ad075ba 100644 --- a/jscomp/test/bs_hashset_int_test.js +++ b/jscomp/test/bs_hashset_int_test.js @@ -34,8 +34,8 @@ function sum2(h) { contents: 0 }; Belt_HashSetInt.forEach(h, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } diff --git a/jscomp/test/bs_hashtbl_string_test.js b/jscomp/test/bs_hashtbl_string_test.js index ed2ab79b2b..2b3d29e775 100644 --- a/jscomp/test/bs_hashtbl_string_test.js +++ b/jscomp/test/bs_hashtbl_string_test.js @@ -26,22 +26,22 @@ var hashString = (function(str){ return hash}); var $$String = Belt_Id.hashable(Hashtbl.hash, (function (x, y) { - return x === y; - })); + return x === y; +})); var String1 = Belt_Id.hashable(hashString, (function (x, y) { - return x === y; - })); + return x === y; +})); var String2 = Belt_Id.hashable((function (x) { - return Caml_hash_primitive.hash_final_mix(Caml_hash_primitive.hash_mix_string(0, x)); - }), (function (x, y) { - return x === y; - })); + return Caml_hash_primitive.hash_final_mix(Caml_hash_primitive.hash_mix_string(0, x)); +}), (function (x, y) { + return x === y; +})); var Int = Belt_Id.hashable(Hashtbl.hash, (function (x, y) { - return x === y; - })); + return x === y; +})); var empty = Belt_internalBucketsType.make(Int.hash, Int.eq, 500000); diff --git a/jscomp/test/bs_ignore_effect.js b/jscomp/test/bs_ignore_effect.js index 06a86d8fc5..42e21c8a57 100644 --- a/jscomp/test/bs_ignore_effect.js +++ b/jscomp/test/bs_ignore_effect.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -38,9 +38,9 @@ var v = { }; var h = (v.contents = v.contents + 1 | 0, { - hi: 2, - lo: 0 - }); + hi: 2, + lo: 0 +}); var z = (v.contents = v.contents + 1 | 0, "Float", add(3.0, 2.0)); diff --git a/jscomp/test/bs_int_test.js b/jscomp/test/bs_int_test.js index 8ba8800a0f..cd30e35d2f 100644 --- a/jscomp/test/bs_int_test.js +++ b/jscomp/test/bs_int_test.js @@ -30,12 +30,12 @@ function neq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/bs_list_test.js b/jscomp/test/bs_list_test.js index 0aa415b6d1..bee9d6169e 100644 --- a/jscomp/test/bs_list_test.js +++ b/jscomp/test/bs_list_test.js @@ -32,8 +32,8 @@ function sum(xs) { contents: 0 }; Belt_List.forEach(xs, (function (x) { - v.contents = v.contents + x | 0; - })); + v.contents = v.contents + x | 0; + })); return v.contents; } @@ -42,14 +42,14 @@ function sum2(xs, ys) { contents: 0 }; Belt_List.forEach2(xs, ys, (function (x, y) { - v.contents = (v.contents + x | 0) + y | 0; - })); + v.contents = (v.contents + x | 0) + y | 0; + })); return v.contents; } var u = Belt_List.makeBy(5, (function (i) { - return Math.imul(i, i); - })); + return Math.imul(i, i); +})); function f(i) { eq("File \"bs_list_test.res\", line 27, characters 18-25", Belt_List.getExn(u, i), Math.imul(i, i)); @@ -60,377 +60,377 @@ for(var i = 0; i <= 4; ++i){ } eq("File \"bs_list_test.res\", line 31, characters 5-12", Belt_List.map(u, (function (i) { - return i + 1 | 0; - })), { - hd: 1, + return i + 1 | 0; +})), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 5, tl: { - hd: 2, + hd: 10, tl: { - hd: 5, - tl: { - hd: 10, - tl: { - hd: 17, - tl: /* [] */0 - } - } + hd: 17, + tl: /* [] */0 } } - }); + } + } +}); eq("File \"bs_list_test.res\", line 32, characters 5-12", Belt_List.getBy({ - hd: 1, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, (function (x) { - return x % 2 === 0; - })), 4); + hd: 1, + tl: { + hd: 4, + tl: { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } + } + } +}, (function (x) { + return x % 2 === 0; +})), 4); eq("File \"bs_list_test.res\", line 33, characters 5-12", Belt_List.getBy({ - hd: 1, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, (function (x) { - return x % 5 === 0; - })), undefined); - -eq("FLATTEN", Belt_List.flatten({ - hd: { - hd: 1, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 3, - tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: { - hd: Belt_List.makeBy(4, (function (i) { - return i; - })), - tl: /* [] */0 - } - } - } - } - }), { - hd: 1, + hd: 1, + tl: { + hd: 4, + tl: { + hd: 3, tl: { hd: 2, - tl: { - hd: 3, - tl: { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - } - } - } + tl: /* [] */0 } - }); - -eq("FLATTEN", Belt_List.flatten(/* [] */0), /* [] */0); + } + } +}, (function (x) { + return x % 5 === 0; +})), undefined); eq("FLATTEN", Belt_List.flatten({ - hd: /* [] */0, - tl: { - hd: /* [] */0, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 1, - tl: /* [] */0 - }, - tl: { - hd: { - hd: 2, - tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: /* [] */0 - } - } - } - } - } - }), { + hd: { + hd: 1, + tl: /* [] */0 + }, + tl: { + hd: { hd: 2, + tl: /* [] */0 + }, + tl: { + hd: { + hd: 3, + tl: /* [] */0 + }, tl: { - hd: 1, + hd: /* [] */0, tl: { - hd: 2, + hd: Belt_List.makeBy(4, (function (i) { + return i; + })), tl: /* [] */0 } } - }); - -eq("CONCATMANY", Belt_List.concatMany([ - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - }, - { - hd: 3, - tl: /* [] */0 - }, - /* [] */0, - Belt_List.makeBy(4, (function (i) { - return i; - })) - ]), { - hd: 1, + } + } +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 0, tl: { - hd: 3, + hd: 1, tl: { - hd: 0, + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } } } } - }); + } + } +}); -eq("CONCATMANY", Belt_List.concatMany([]), /* [] */0); +eq("FLATTEN", Belt_List.flatten(/* [] */0), /* [] */0); -eq("CONCATMANY", Belt_List.concatMany([ - /* [] */0, - /* [] */0, - { +eq("FLATTEN", Belt_List.flatten({ + hd: /* [] */0, + tl: { + hd: /* [] */0, + tl: { + hd: { + hd: 2, + tl: /* [] */0 + }, + tl: { + hd: { + hd: 1, + tl: /* [] */0 + }, + tl: { + hd: { hd: 2, tl: /* [] */0 }, - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, + tl: { + hd: /* [] */0, tl: /* [] */0 - }, - /* [] */0 - ]), { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 + } } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}); eq("CONCATMANY", Belt_List.concatMany([ - /* [] */0, - /* [] */0, - { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - }, - /* [] */0 - ]), { - hd: 2, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + { + hd: 3, + tl: /* [] */0 + }, + /* [] */0, + Belt_List.makeBy(4, (function (i) { + return i; + })) +]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 0, tl: { hd: 1, tl: { hd: 2, - tl: /* [] */0 + tl: { + hd: 3, + tl: /* [] */0 + } } } } - }); + } + } +}); -eq("CONCATMANY", Belt_List.concatMany([{ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }]), { +eq("CONCATMANY", Belt_List.concatMany([]), /* [] */0); + +eq("CONCATMANY", Belt_List.concatMany([ + /* [] */0, + /* [] */0, + { + hd: 2, + tl: /* [] */0 + }, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + /* [] */0 +]), { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}); + +eq("CONCATMANY", Belt_List.concatMany([ + /* [] */0, + /* [] */0, + { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + }, + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + }, + /* [] */0 +]), { + hd: 2, + tl: { + hd: 3, + tl: { hd: 1, tl: { hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } + tl: /* [] */0 + } + } + } +}); + +eq("CONCATMANY", Belt_List.concatMany([{ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 } - }); + } + }]), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); eq("File \"bs_list_test.res\", line 66, characters 2-9", Belt_List.toArray(Belt_List.concat(Belt_List.makeBy(100, (function (i) { - return i; - })), Belt_List.makeBy(100, (function (i) { - return i; - })))), Belt_Array.concat(Belt_Array.makeBy(100, (function (i) { - return i; - })), Belt_Array.makeBy(100, (function (i) { - return i; - })))); + return i; +})), Belt_List.makeBy(100, (function (i) { + return i; +})))), Belt_Array.concat(Belt_Array.makeBy(100, (function (i) { + return i; +})), Belt_Array.makeBy(100, (function (i) { + return i; +})))); eq("APPEND", Belt_List.concat({ - hd: 1, - tl: /* [] */0 - }, /* [] */0), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}, /* [] */0), { + hd: 1, + tl: /* [] */0 +}); eq("APPEND", Belt_List.concat(/* [] */0, { - hd: 1, - tl: /* [] */0 - }), { - hd: 1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}), { + hd: 1, + tl: /* [] */0 +}); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - }), { - hd: [ - 1, - 3 - ], - tl: { - hd: [ - 2, - 4 - ], - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } +}), { + hd: [ + 1, + 3 + ], + tl: { + hd: [ + 2, + 4 + ], + tl: /* [] */0 + } +}); eq("ZIP", Belt_List.zip(/* [] */0, { - hd: 1, - tl: /* [] */0 - }), /* [] */0); + hd: 1, + tl: /* [] */0 +}), /* [] */0); eq("ZIP", Belt_List.zip(/* [] */0, /* [] */0), /* [] */0); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, /* [] */0), /* [] */0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, /* [] */0), /* [] */0); eq("ZIP", Belt_List.zip({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}), { + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 2, + 3 + ], + tl: { hd: [ - 1, - 2 + 3, + 4 ], - tl: { - hd: [ - 2, - 3 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function mod2(x) { return x % 2 === 0; @@ -441,321 +441,321 @@ function evenIndex(_x, i) { } eq("PARTITION", Belt_List.partition({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - } - } - }, mod2), [ - { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, - { - hd: 1, tl: { hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } } } - ]); + } + } +}, mod2), [ + { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + }, + { + hd: 1, + tl: { + hd: 3, + tl: { + hd: 3, + tl: /* [] */0 + } + } + } +]); eq("PARTITION", Belt_List.partition({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, mod2), [ - { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, mod2), [ + { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - }, - /* [] */0 - ]); + } + } + }, + /* [] */0 +]); eq("PARTITION", Belt_List.partition({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - return !mod2(x); - })), [ - /* [] */0, - { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + return !mod2(x); +})), [ + /* [] */0, + { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } } - ]); + } + } +]); eq("PARTITION", Belt_List.partition(/* [] */0, mod2), [ - /* [] */0, - /* [] */0 - ]); + /* [] */0, + /* [] */0 +]); eq("UNZIP", Belt_List.unzip(/* [] */0), [ - /* [] */0, - /* [] */0 - ]); + /* [] */0, + /* [] */0 +]); eq("UNZIP", Belt_List.unzip({ - hd: [ - 1, - 2 - ], - tl: /* [] */0 - }), [ - { - hd: 1, - tl: /* [] */0 - }, - { - hd: 2, - tl: /* [] */0 - } - ]); + hd: [ + 1, + 2 + ], + tl: /* [] */0 +}), [ + { + hd: 1, + tl: /* [] */0 + }, + { + hd: 2, + tl: /* [] */0 + } +]); eq("UNZIP", Belt_List.unzip({ - hd: [ - 1, - 2 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: /* [] */0 - } - }), [ - { - hd: 1, - tl: { - hd: 3, - tl: /* [] */0 - } - }, - { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - ]); + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 3, + 4 + ], + tl: /* [] */0 + } +}), [ + { + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } + }, + { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +]); eq("FILTER", Belt_List.keep({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, mod2), { - hd: 2, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { hd: 4, tl: /* [] */0 } - }); + } + } +}, mod2), { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } +}); eq("FILTER", Belt_List.keep({ - hd: 1, - tl: { - hd: 3, - tl: { - hd: 41, - tl: /* [] */0 - } - } - }, mod2), /* [] */0); + hd: 1, + tl: { + hd: 3, + tl: { + hd: 41, + tl: /* [] */0 + } + } +}, mod2), /* [] */0); eq("FILTER", Belt_List.keep(/* [] */0, mod2), /* [] */0); eq("FILTER", Belt_List.keep({ - hd: 2, - tl: { - hd: 2, - tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } - }, mod2), { + hd: 2, + tl: { + hd: 2, + tl: { hd: 2, tl: { - hd: 2, + hd: 4, tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } + hd: 6, + tl: /* [] */0 + } + } + } + } +}, mod2), { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 } } - }); + } + } +}); eq("FILTER2", Belt_List.keepWithIndex(/* [] */0, evenIndex), /* [] */0); eq("FILTER2", Belt_List.keepWithIndex({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, evenIndex), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } - }); + } + } +}, evenIndex), { + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } +}); eq("FILTER2", Belt_List.keepWithIndex({ - hd: 0, + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, tl: { - hd: 1, + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: { - hd: 7, - tl: /* [] */0 - } - } - } - } + hd: 7, + tl: /* [] */0 } } } - }, evenIndex), { - hd: 0, - tl: { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } } } - }); + } + } +}, evenIndex), { + hd: 0, + tl: { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } + } +}); function id(x) { return x; } eq("MAP", Belt_List.map(Belt_List.makeBy(5, id), (function (x) { - return (x << 1); - })), { - hd: 0, + return (x << 1); +})), { + hd: 0, + tl: { + hd: 2, + tl: { + hd: 4, tl: { - hd: 2, + hd: 6, tl: { - hd: 4, - tl: { - hd: 6, - tl: { - hd: 8, - tl: /* [] */0 - } - } + hd: 8, + tl: /* [] */0 } } - }); + } + } +}); eq("MAP", Belt_List.map(/* [] */0, id), /* [] */0); eq("MAP", Belt_List.map({ - hd: 1, - tl: /* [] */0 - }, (function (x) { - return -x | 0; - })), { - hd: -1, - tl: /* [] */0 - }); + hd: 1, + tl: /* [] */0 +}, (function (x) { + return -x | 0; +})), { + hd: -1, + tl: /* [] */0 +}); function add(a, b) { return a + b | 0; @@ -766,40 +766,40 @@ var length_10_id = Belt_List.makeBy(10, id); var length_8_id = Belt_List.makeBy(8, id); var d = Belt_List.makeBy(10, (function (x) { - return (x << 1); - })); + return (x << 1); +})); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), d); eq("MAP2", Belt_List.zipBy(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, add), /* [] */0); + hd: 1, + tl: /* [] */0 +}, add), /* [] */0); eq("MAP2", Belt_List.zipBy({ - hd: 1, - tl: /* [] */0 - }, /* [] */0, add), /* [] */0); + hd: 1, + tl: /* [] */0 +}, /* [] */0, add), /* [] */0); eq("MAP2", Belt_List.zipBy(/* [] */0, /* [] */0, add), /* [] */0); eq("MAP2", Belt_List.zipBy(length_10_id, length_10_id, add), Belt_List.concat(Belt_List.map(length_8_id, (function (x) { - return (x << 1); - })), { - hd: 16, - tl: { - hd: 18, - tl: /* [] */0 - } - })); + return (x << 1); +})), { + hd: 16, + tl: { + hd: 18, + tl: /* [] */0 + } +})); eq("MAP2", Belt_List.zipBy(length_10_id, length_8_id, add), Belt_List.mapWithIndex(length_8_id, (function (i, x) { - return i + x | 0; - }))); + return i + x | 0; +}))); eq("MAP2", Belt_List.reverse(Belt_List.mapReverse2(length_10_id, length_10_id, add)), Belt_List.map(length_10_id, (function (x) { - return (x << 1); - }))); + return (x << 1); +}))); var xs = Belt_List.reverse(Belt_List.mapReverse2(length_8_id, length_10_id, add)); @@ -808,70 +808,70 @@ eq("File \"bs_list_test.res\", line 163, characters 5-12", Belt_List.length(xs), eq("MAP2", xs, Belt_List.zipBy(length_10_id, length_8_id, add)); eq("MAP2", Belt_List.mapReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x + y | 0; - })), { - hd: 4, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x + y | 0; +})), { + hd: 4, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, 2), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, 2), { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take(/* [] */0, 1), undefined); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 3), undefined); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 3), undefined); eq("TAKE", Belt_List.take({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 2), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 2), { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); eq("TAKE", Belt_List.take(length_10_id, 8), length_8_id); @@ -882,12 +882,12 @@ eq("TAKE", Belt_List.take(length_8_id, -2), undefined); eq("DROP", Belt_List.drop(length_10_id, 10), /* [] */0); eq("DROP", Belt_List.drop(length_10_id, 8), { - hd: 8, - tl: { - hd: 9, - tl: /* [] */0 - } - }); + hd: 8, + tl: { + hd: 9, + tl: /* [] */0 + } +}); eq("DROP", Belt_List.drop(length_10_id, 0), length_10_id); @@ -900,94 +900,94 @@ eq("SPLIT", Belt_List.splitAt(/* [] */0, 1), undefined); eq("SPLIT", Belt_List.splitAt(a, 6), undefined); eq("SPLIT", Belt_List.splitAt(a, 5), [ - a, - /* [] */0 - ]); + a, + /* [] */0 +]); eq("SPLIT", Belt_List.splitAt(a, 4), [ - { - hd: 0, + { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } - }, - { - hd: 4, - tl: /* [] */0 } - ]); + } + }, + { + hd: 4, + tl: /* [] */0 + } +]); eq("SPLIT", Belt_List.splitAt(a, 3), [ - { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }, - { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } + { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 } - ]); + } + }, + { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 2), [ - { - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, - { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + { + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, + { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 } - ]); + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 1), [ - { - hd: 0, - tl: /* [] */0 - }, - { - hd: 1, + { + hd: 0, + tl: /* [] */0 + }, + { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } } - ]); + } + } +]); eq("SPLIT", Belt_List.splitAt(a, 0), [ - /* [] */0, - a - ]); + /* [] */0, + a +]); eq("SPLIT", Belt_List.splitAt(a, -1), undefined); @@ -1000,312 +1000,246 @@ function eqx(x, y) { } b("File \"bs_list_test.res\", line 205, characters 4-11", Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - }))); + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_list_test.res\", line 206, characters 4-11", !Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 4, (function (prim0, prim1) { - return prim0 === prim1; - }))); - -b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 4, (function (x, y) { - return (x + 1 | 0) === y; - }))); - -eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 3, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 4, (function (prim0, prim1) { + return prim0 === prim1; +}))); -eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 1, (function (prim0, prim1) { - return prim0 === prim1; - })), { +b("File \"bs_list_test.res\", line 207, characters 4-11", Belt_List.hasAssoc({ + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 2, - "2" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 4, (function (x, y) { + return (x + 1 | 0) === y; +}))); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 3, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 0, (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}, 1, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 3, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "2" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 1, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 2, - "2" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); + tl: /* [] */0 + } + } +}, 0, (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}); eq("REMOVEASSOQ", Belt_List.removeAssoc({ - hd: [ - 1, - "1" - ], - tl: { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }, 2, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - }); - -eq("REMOVEASSOQ", Belt_List.removeAssoc(/* [] */0, 2, eqx), /* [] */0); + tl: /* [] */0 + } + } +}, 3, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: /* [] */0 + } +}); -var ll = { +eq("REMOVEASSOQ", Belt_List.removeAssoc({ hd: [ 1, "1" @@ -1323,305 +1257,371 @@ var ll = { tl: /* [] */0 } } -}; - -var ll0 = Belt_List.removeAssoc(ll, 0, eqx); - -b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); - -var ll1 = Belt_List.setAssoc(ll, 2, "22", (function (prim0, prim1) { - return prim0 === prim1; - })); +}, 1, eqx), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); -eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { +eq("REMOVEASSOQ", Belt_List.removeAssoc({ + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { hd: [ - 1, - "1" + 3, + "3" ], - tl: { - hd: [ - 2, - "22" - ], - tl: { - hd: [ - 3, - "3" - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}, 2, eqx), { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } +}); + +eq("REMOVEASSOQ", Belt_List.removeAssoc(/* [] */0, 2, eqx), /* [] */0); + +var ll = { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}; + +var ll0 = Belt_List.removeAssoc(ll, 0, eqx); + +b("File \"bs_list_test.res\", line 222, characters 4-11", ll === ll0); + +var ll1 = Belt_List.setAssoc(ll, 2, "22", (function (prim0, prim1) { + return prim0 === prim1; +})); + +eq("File \"bs_list_test.res\", line 224, characters 5-12", ll1, { + hd: [ + 1, + "1" + ], + tl: { + hd: [ + 2, + "22" + ], + tl: { + hd: [ + 3, + "3" + ], + tl: /* [] */0 + } + } +}); var ll2 = Belt_List.setAssoc(ll1, 22, "2", (function (prim0, prim1) { - return prim0 === prim1; - })); + return prim0 === prim1; +})); b("File \"bs_list_test.res\", line 226, characters 4-11", Caml_obj.equal(ll2, { - hd: [ - 22, - "2" - ], - tl: ll1 - })); + hd: [ + 22, + "2" + ], + tl: ll1 +})); b("File \"bs_list_test.res\", line 227, characters 4-11", Belt_List.tailExn(ll2) === ll1); b("File \"bs_list_test.res\", line 229, characters 4-11", Caml_obj.equal(Belt_List.setAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 2, "x", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "x" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - })); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 2, "x", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "x" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +})); b("File \"bs_list_test.res\", line 234, characters 4-11", Caml_obj.equal(Belt_List.setAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - }, 2, "2", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 2, - "2" - ], - tl: { - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - })); - -eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } +}, 2, "2", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 2, + "2" + ], + tl: { + hd: [ + 1, + "a" + ], + tl: { hd: [ - 1, - "1" + 3, + "c" ], tl: /* [] */0 - }); + } + } +})); + +eq("File \"bs_list_test.res\", line 237, characters 5-12", Belt_List.setAssoc(/* [] */0, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: /* [] */0 +}); debugger; eq("File \"bs_list_test.res\", line 239, characters 5-12", Belt_List.setAssoc({ - hd: [ - 1, - "2" - ], - tl: /* [] */0 - }, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 1, - "1" - ], - tl: /* [] */0 - }); + hd: [ + 1, + "2" + ], + tl: /* [] */0 +}, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 1, + "1" + ], + tl: /* [] */0 +}); eq("File \"bs_list_test.res\", line 241, characters 5-12", Belt_List.setAssoc({ - hd: [ - 0, - "0" - ], - tl: { - hd: [ - 1, - "2" - ], - tl: /* [] */0 - } - }, 1, "1", (function (prim0, prim1) { - return prim0 === prim1; - })), { - hd: [ - 0, - "0" - ], - tl: { - hd: [ - 1, - "1" - ], - tl: /* [] */0 - } - }); + hd: [ + 0, + "0" + ], + tl: { + hd: [ + 1, + "2" + ], + tl: /* [] */0 + } +}, 1, "1", (function (prim0, prim1) { + return prim0 === prim1; +})), { + hd: [ + 0, + "0" + ], + tl: { + hd: [ + 1, + "1" + ], + tl: /* [] */0 + } +}); b("File \"bs_list_test.res\", line 242, characters 4-11", Caml_obj.equal(Belt_List.getAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 2, (function (prim0, prim1) { - return prim0 === prim1; - })), "b")); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 2, (function (prim0, prim1) { + return prim0 === prim1; +})), "b")); b("File \"bs_list_test.res\", line 243, characters 4-11", Belt_List.getAssoc({ - hd: [ - 1, - "a" - ], - tl: { - hd: [ - 2, - "b" - ], - tl: { - hd: [ - 3, - "c" - ], - tl: /* [] */0 - } - } - }, 4, (function (prim0, prim1) { - return prim0 === prim1; - })) === undefined); + hd: [ + 1, + "a" + ], + tl: { + hd: [ + 2, + "b" + ], + tl: { + hd: [ + 3, + "c" + ], + tl: /* [] */0 + } + } +}, 4, (function (prim0, prim1) { + return prim0 === prim1; +})) === undefined); eq("File \"bs_list_test.res\", line 248, characters 4-11", [ - Belt_List.head(length_10_id), - Belt_List.tail(length_10_id) - ], [ - 0, - Belt_List.drop(length_10_id, 1) - ]); + Belt_List.head(length_10_id), + Belt_List.tail(length_10_id) +], [ + 0, + Belt_List.drop(length_10_id, 1) +]); eq("File \"bs_list_test.res\", line 255, characters 5-12", Belt_List.head(/* [] */0), undefined); $$throw("File \"bs_list_test.res\", line 256, characters 8-15", (function (param) { - Belt_List.headExn(/* [] */0); - })); + Belt_List.headExn(/* [] */0); +})); $$throw("File \"bs_list_test.res\", line 257, characters 8-15", (function (param) { - Belt_List.tailExn(/* [] */0); - })); + Belt_List.tailExn(/* [] */0); +})); $$throw("File \"bs_list_test.res\", line 258, characters 8-15", (function (param) { - Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, -1); - })); + Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, -1); +})); $$throw("File \"bs_list_test.res\", line 259, characters 8-15", (function (param) { - Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, 2); - })); + Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, 2); +})); eq("File \"bs_list_test.res\", line 260, characters 5-12", Belt_List.map({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, (function (i) { - return Belt_List.getExn({ - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }, i); - })), { - hd: 0, - tl: { - hd: 1, - tl: /* [] */0 - } - }); + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } +}, (function (i) { + return Belt_List.getExn({ + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } + }, i); +})), { + hd: 0, + tl: { + hd: 1, + tl: /* [] */0 + } +}); eq("File \"bs_list_test.res\", line 261, characters 5-12", Belt_List.headExn({ - hd: 1, - tl: /* [] */0 - }), 1); + hd: 1, + tl: /* [] */0 +}), 1); eq("File \"bs_list_test.res\", line 262, characters 5-12", Belt_List.tailExn({ - hd: 1, - tl: /* [] */0 - }), /* [] */0); + hd: 1, + tl: /* [] */0 +}), /* [] */0); Belt_List.forEachWithIndex(length_10_id, (function (i, x) { - eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); - })); + eq("File \"bs_list_test.res\", line 263, characters 48-55", Belt_List.get(length_10_id, i), x); +})); eq("File \"bs_list_test.res\", line 264, characters 5-12", Belt_List.tail(/* [] */0), undefined); eq("File \"bs_list_test.res\", line 265, characters 5-12", Belt_List.drop(/* [] */0, 3), undefined); eq("File \"bs_list_test.res\", line 266, characters 5-12", Belt_List.mapWithIndex(/* [] */0, (function (i, x) { - return i + x | 0; - })), /* [] */0); + return i + x | 0; +})), /* [] */0); eq("File \"bs_list_test.res\", line 267, characters 5-12", Belt_List.get(length_10_id, -1), undefined); @@ -1646,10 +1646,10 @@ eq("File \"bs_list_test.res\", line 290, characters 5-12", Belt_List.reduce(leng eq("File \"bs_list_test.res\", line 291, characters 5-12", Belt_List.reduceReverse(length_10_id, 0, add), 45); eq("File \"bs_list_test.res\", line 292, characters 5-12", Belt_List.reduceReverse(Belt_List.makeBy(10000, (function (i) { - return i; - })), 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })), 49995000); + return i; +})), 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})), 49995000); eq("File \"bs_list_test.res\", line 295, characters 5-12", sum2(length_10_id, length_10_id), 90); @@ -1658,633 +1658,633 @@ eq("File \"bs_list_test.res\", line 296, characters 5-12", sum2(length_8_id, len eq("File \"bs_list_test.res\", line 297, characters 5-12", sum2(length_10_id, length_8_id), 56); eq("File \"bs_list_test.res\", line 298, characters 5-12", Belt_List.reduce2(length_10_id, length_8_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 56); + return (acc + x | 0) + y | 0; +})), 56); eq("File \"bs_list_test.res\", line 299, characters 5-12", Belt_List.reduce2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - }, 0, (function (a, b, c) { - return (a + b | 0) + c | 0; - })), 18); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}, 0, (function (a, b, c) { + return (a + b | 0) + c | 0; +})), 18); eq("File \"bs_list_test.res\", line 300, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_8_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 56); + return (acc + x | 0) + y | 0; +})), 56); eq("File \"bs_list_test.res\", line 301, characters 5-12", Belt_List.reduceReverse2(length_10_id, length_10_id, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 90); + return (acc + x | 0) + y | 0; +})), 90); eq("File \"bs_list_test.res\", line 302, characters 5-12", Belt_List.reduceReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })), 6); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})), 6); eq("File \"bs_list_test.res\", line 303, characters 5-12", Belt_List.every({ - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 - } - } - }, mod2), true); + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}, mod2), true); eq("File \"bs_list_test.res\", line 304, characters 5-12", Belt_List.every({ - hd: 1, - tl: /* [] */0 - }, mod2), false); + hd: 1, + tl: /* [] */0 +}, mod2), false); eq("File \"bs_list_test.res\", line 305, characters 5-12", Belt_List.every(/* [] */0, mod2), true); eq("File \"bs_list_test.res\", line 306, characters 5-12", Belt_List.some({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 5, - tl: /* [] */0 - } - } - }, mod2), true); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 5, + tl: /* [] */0 + } + } +}, mod2), true); eq("File \"bs_list_test.res\", line 307, characters 5-12", Belt_List.some({ - hd: 1, - tl: { - hd: 3, - tl: { - hd: 5, - tl: /* [] */0 - } - } - }, mod2), false); + hd: 1, + tl: { + hd: 3, + tl: { + hd: 5, + tl: /* [] */0 + } + } +}, mod2), false); eq("File \"bs_list_test.res\", line 308, characters 5-12", Belt_List.some(/* [] */0, mod2), false); eq("File \"bs_list_test.res\", line 309, characters 5-12", Belt_List.has({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, "2", (function (x, s) { - return String(x) === s; - })), true); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, "2", (function (x, s) { + return String(x) === s; +})), true); eq("File \"bs_list_test.res\", line 310, characters 5-12", Belt_List.has({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, "0", (function (x, s) { - return String(x) === s; - })), false); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, "0", (function (x, s) { + return String(x) === s; +})), false); b("File \"bs_list_test.res\", line 312, characters 4-11", Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })) === 10); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})) === 10); b("File \"bs_list_test.res\", line 313, characters 4-11", Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 10, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 10, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})) === 0); b("File \"bs_list_test.res\", line 314, characters 4-11", Caml_obj.equal(Belt_List.reduceReverse({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, /* [] */0, Belt_List.add), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, /* [] */0, Belt_List.add), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +})); b("File \"bs_list_test.res\", line 315, characters 4-11", Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - })) === 10); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +})) === 10); b("File \"bs_list_test.res\", line 316, characters 4-11", Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 10, (function (prim0, prim1) { - return prim0 - prim1 | 0; - })) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 10, (function (prim0, prim1) { + return prim0 - prim1 | 0; +})) === 0); b("File \"bs_list_test.res\", line 317, characters 4-11", Caml_obj.equal(Belt_List.reduce({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, /* [] */0, Belt_List.add), { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, /* [] */0, Belt_List.add), { + hd: 4, + tl: { + hd: 3, + tl: { + hd: 2, + tl: { + hd: 1, + tl: /* [] */0 + } + } + } +})); b("File \"bs_list_test.res\", line 318, characters 4-11", Belt_List.reduceWithIndex({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, 0, (function (acc, x, i) { - return (acc + x | 0) + i | 0; - })) === 16); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, 0, (function (acc, x, i) { + return (acc + x | 0) + i | 0; +})) === 16); b("File \"bs_list_test.res\", line 319, characters 4-11", Belt_List.reduceReverse2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 6); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 6); var a$1 = Belt_List.makeBy(10000, (function (i) { - return i; - })); + return i; +})); b("File \"bs_list_test.res\", line 322, characters 4-11", Belt_List.reduceReverse2(a$1, { - hd: 0, - tl: a$1 - }, 0, (function (acc, x, y) { - return (acc + x | 0) + y | 0; - })) === 99980001); + hd: 0, + tl: a$1 +}, 0, (function (acc, x, y) { + return (acc + x | 0) + y | 0; +})) === 99980001); eq("File \"bs_list_test.res\", line 328, characters 5-12", Belt_List.every2(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 329, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 330, characters 5-12", Belt_List.every2({ - hd: 2, - tl: /* [] */0 - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: /* [] */0 +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 331, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), false); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 332, characters 5-12", Belt_List.every2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 0, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 0, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 333, characters 5-12", Belt_List.some2(/* [] */0, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), false); + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 334, characters 5-12", Belt_List.some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 335, characters 5-12", Belt_List.some2({ - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 336, characters 5-12", Belt_List.some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 4, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), false); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 4, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), false); eq("File \"bs_list_test.res\", line 337, characters 5-12", Belt_List.some2({ - hd: 0, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x > y; - })), true); + hd: 0, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 3, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x > y; +})), true); eq("File \"bs_list_test.res\", line 338, characters 5-12", Belt_List.some2({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: -1, - tl: { - hd: -2, - tl: /* [] */0 - } - }, (function (x, y) { - return x === y; - })), false); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: -1, + tl: { + hd: -2, + tl: /* [] */0 + } +}, (function (x, y) { + return x === y; +})), false); function makeTest(n) { eq("File \"bs_list_test.res\", line 341, characters 23-30", Belt_List.make(n, 3), Belt_List.makeBy(n, (function (param) { - return 3; - }))); + return 3; + }))); } eq("File \"bs_list_test.res\", line 343, characters 12-19", { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } +}); + +b("File \"bs_list_test.res\", line 345, characters 4-11", Belt_List.cmp({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 0, + tl: { + hd: 1, + tl: { hd: 2, tl: { hd: 3, tl: /* [] */0 } - }, { - hd: 2, + } + } +}, Caml.int_compare) > 0); + +b("File \"bs_list_test.res\", line 346, characters 4-11", Belt_List.cmp({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 3, + hd: 4, tl: /* [] */0 } - }); - -b("File \"bs_list_test.res\", line 345, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - } - }, Caml.int_compare) > 0); - -b("File \"bs_list_test.res\", line 346, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 347, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, Caml.int_compare) < 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, Caml.int_compare) < 0); b("File \"bs_list_test.res\", line 348, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 0, - tl: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 349, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) === 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) === 0); b("File \"bs_list_test.res\", line 350, characters 4-11", Belt_List.cmp({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, Caml.int_compare) > 0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, Caml.int_compare) > 0); b("File \"bs_list_test.res\", line 351, characters 4-11", Belt_List.cmpByLength(/* [] */0, /* [] */0) === 0); b("File \"bs_list_test.res\", line 352, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: /* [] */0 - }, /* [] */0) > 0); + hd: 1, + tl: /* [] */0 +}, /* [] */0) > 0); b("File \"bs_list_test.res\", line 353, characters 4-11", Belt_List.cmpByLength(/* [] */0, { - hd: 1, - tl: /* [] */0 - }) < 0); + hd: 1, + tl: /* [] */0 +}) < 0); b("File \"bs_list_test.res\", line 354, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, { - hd: 1, - tl: /* [] */0 - }) > 0); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, { + hd: 1, + tl: /* [] */0 +}) > 0); b("File \"bs_list_test.res\", line 355, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: /* [] */0 - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) < 0); + hd: 1, + tl: /* [] */0 +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) < 0); b("File \"bs_list_test.res\", line 356, characters 4-11", Belt_List.cmpByLength({ - hd: 1, - tl: { - hd: 3, - tl: /* [] */0 - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) === 0); + hd: 1, + tl: { + hd: 3, + tl: /* [] */0 + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) === 0); makeTest(0); @@ -2299,216 +2299,216 @@ function cmp(a, b) { } eq("SORT", Belt_List.sort({ - hd: 5, - tl: { - hd: 4, - tl: { - hd: 3, - tl: { - hd: 2, - tl: /* [] */0 - } - } - } - }, cmp), { - hd: 2, + hd: 5, + tl: { + hd: 4, + tl: { + hd: 3, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: /* [] */0 - } - } + hd: 2, + tl: /* [] */0 + } + } + } +}, cmp), { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, + tl: /* [] */0 } - }); + } + } +}); eq("SORT", Belt_List.sort({ - hd: 3, - tl: { - hd: 9, - tl: { - hd: 37, - tl: { - hd: 3, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - } - }, cmp), { - hd: 1, + hd: 3, + tl: { + hd: 9, + tl: { + hd: 37, tl: { hd: 3, tl: { - hd: 3, - tl: { - hd: 9, - tl: { - hd: 37, - tl: /* [] */0 - } - } + hd: 1, + tl: /* [] */0 + } + } + } + } +}, cmp), { + hd: 1, + tl: { + hd: 3, + tl: { + hd: 3, + tl: { + hd: 9, + tl: { + hd: 37, + tl: /* [] */0 } } - }); + } + } +}); b("File \"bs_list_test.res\", line 374, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 375, characters 4-11", Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 376, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }, (function (x, y) { - return x === y; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 4, + tl: /* [] */0 + } + } +}, (function (x, y) { + return x === y; +}))); b("File \"bs_list_test.res\", line 377, characters 4-11", !Belt_List.eq({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (prim0, prim1) { - return prim0 === prim1; - }))); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (prim0, prim1) { + return prim0 === prim1; +}))); var u0 = Belt_List.makeBy(20, (function (x) { - return x; - })); + return x; +})); var u1 = Belt_List.keepMap(u0, (function (x) { - if (x % 7 === 0) { - return x + 1 | 0; - } - - })); + if (x % 7 === 0) { + return x + 1 | 0; + } + +})); eq("File \"bs_list_test.res\", line 388, characters 5-12", u1, { - hd: 1, - tl: { - hd: 8, - tl: { - hd: 15, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 8, + tl: { + hd: 15, + tl: /* [] */0 + } + } +}); b("File \"bs_list_test.res\", line 390, characters 4-11", Caml_obj.equal(Belt_List.keepMap({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - if (x % 2 === 0) { - return -x | 0; - } - - })), { - hd: -2, - tl: { - hd: -4, - tl: /* [] */0 - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + if (x % 2 === 0) { + return -x | 0; + } + +})), { + hd: -2, + tl: { + hd: -4, + tl: /* [] */0 + } +})); b("File \"bs_list_test.res\", line 404, characters 4-11", Belt_List.keepMap({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }, (function (x) { - if (x % 5 === 0) { - return x; - } - - })) === /* [] */0); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}, (function (x) { + if (x % 5 === 0) { + return x; + } + +})) === /* [] */0); Mt.from_pair_suites("Bs_list_test", suites.contents); diff --git a/jscomp/test/bs_map_set_dict_test.js b/jscomp/test/bs_map_set_dict_test.js index a3d19ae5a9..8be6144f13 100644 --- a/jscomp/test/bs_map_set_dict_test.js +++ b/jscomp/test/bs_map_set_dict_test.js @@ -48,8 +48,8 @@ var m00 = { }; var I2 = Belt_Id.comparable(function (x, y) { - return Caml.int_compare(y, x); - }); + return Caml.int_compare(y, x); +}); var m_cmp = Icmp2.cmp; @@ -113,57 +113,57 @@ function $eq$tilde(a, b) { } var u0 = f(Belt_Array.map(Array_data_util.randomRange(0, 39), (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); var u1 = Belt_Map.set(u0, 39, 120); b("File \"bs_map_set_dict_test.res\", line 72, characters 4-11", Belt_Array.every2(Belt_MapDict.toArray(u0.data), Belt_Array.map(Array_data_util.range(0, 39), (function (x) { - return [ - x, - x - ]; - })), (function (param, param$1) { - if (param[0] === param$1[0]) { - return param[1] === param$1[1]; - } else { - return false; - } - }))); + return [ + x, + x + ]; +})), (function (param, param$1) { + if (param[0] === param$1[0]) { + return param[1] === param$1[1]; + } else { + return false; + } +}))); b("File \"bs_map_set_dict_test.res\", line 79, characters 4-11", Belt_List.every2(Belt_MapDict.toList(u0.data), Belt_List.fromArray(Belt_Array.map(Array_data_util.range(0, 39), (function (x) { - return [ - x, - x - ]; - }))), (function (param, param$1) { - if (param[0] === param$1[0]) { - return param[1] === param$1[1]; - } else { - return false; - } - }))); + return [ + x, + x + ]; +}))), (function (param, param$1) { + if (param[0] === param$1[0]) { + return param[1] === param$1[1]; + } else { + return false; + } +}))); eq("File \"bs_map_set_dict_test.res\", line 84, characters 5-12", Belt_Map.get(u0, 39), 39); eq("File \"bs_map_set_dict_test.res\", line 85, characters 5-12", Belt_Map.get(u1, 39), 120); var u = f(Belt_Array.makeByAndShuffle(10000, (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); eq("File \"bs_map_set_dict_test.res\", line 90, characters 5-12", Belt_Array.makeBy(10000, (function (x) { - return [ - x, - x - ]; - })), Belt_MapDict.toArray(u.data)); + return [ + x, + x + ]; +})), Belt_MapDict.toArray(u.data)); Mt.from_pair_suites("Bs_map_set_dict_test", suites.contents); diff --git a/jscomp/test/bs_map_test.js b/jscomp/test/bs_map_test.js index a94fb08ecd..dd411928f0 100644 --- a/jscomp/test/bs_map_test.js +++ b/jscomp/test/bs_map_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -37,11 +37,11 @@ function b(loc, v) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Ok", - _0: v - }; - }) + return { + TAG: "Ok", + _0: v + }; + }) ], tl: suites.contents }; @@ -56,11 +56,11 @@ function emptyMap(param) { } var v = Belt_Array.makeByAndShuffle(1000000, (function (i) { - return [ - i, - i - ]; - })); + return [ + i, + i + ]; +})); var u = Belt_MapInt.fromArray(v); @@ -69,8 +69,8 @@ Belt_MapInt.checkInvariantInternal(u); var firstHalf = Belt_Array.slice(v, 0, 2000); var xx = Belt_Array.reduce(firstHalf, u, (function (acc, param) { - return Belt_MapInt.remove(acc, param[0]); - })); + return Belt_MapInt.remove(acc, param[0]); +})); Belt_MapInt.checkInvariantInternal(u); diff --git a/jscomp/test/bs_min_max_test.js b/jscomp/test/bs_min_max_test.js index 850139a42f..d15a770798 100644 --- a/jscomp/test/bs_min_max_test.js +++ b/jscomp/test/bs_min_max_test.js @@ -47,23 +47,23 @@ var f5_max = Caml_obj.max; b("File \"bs_min_max_test.res\", line 19, characters 4-11", Caml.i64_eq(Caml.i64_min(Caml_int64.zero, Caml_int64.one), Caml_int64.zero)); b("File \"bs_min_max_test.res\", line 20, characters 4-11", Caml.i64_eq(Caml.i64_max([ - 0, - 22 - ], Caml_int64.one), [ - 0, - 22 - ])); + 0, + 22 +], Caml_int64.one), [ + 0, + 22 +])); b("File \"bs_min_max_test.res\", line 21, characters 4-11", Caml.i64_eq(Caml.i64_max([ - -1, - 4294967293 - ], [ - 0, - 3 - ]), [ - 0, - 3 - ])); + -1, + 4294967293 +], [ + 0, + 3 +]), [ + 0, + 3 +])); eq("File \"bs_min_max_test.res\", line 22, characters 5-12", Caml_obj.min(undefined, 3), undefined); diff --git a/jscomp/test/bs_mutable_set_test.js b/jscomp/test/bs_mutable_set_test.js index bc6b575833..8348831a38 100644 --- a/jscomp/test/bs_mutable_set_test.js +++ b/jscomp/test/bs_mutable_set_test.js @@ -114,40 +114,40 @@ var v = { }; var bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { - return Belt_MutableSetInt.removeCheck(v, x); - })); + return Belt_MutableSetInt.removeCheck(v, x); +})); var indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_mutable_set_test.res\", line 72, characters 9-16", indeedRemoved, 500); eq("File \"bs_mutable_set_test.res\", line 73, characters 9-16", Belt_internalAVLset.size(v.data), 501); var cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { - return Belt_MutableSetInt.addCheck(v, x); - })); + return Belt_MutableSetInt.addCheck(v, x); +})); var indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_mutable_set_test.res\", line 82, characters 9-16", indeedAded, 1000); eq("File \"bs_mutable_set_test.res\", line 83, characters 9-16", Belt_internalAVLset.size(v.data), 1501); b("File \"bs_mutable_set_test.res\", line 84, characters 8-15", Belt_MutableSetInt.isEmpty({ - data: undefined - })); + data: undefined +})); eq("File \"bs_mutable_set_test.res\", line 85, characters 9-16", Belt_internalAVLset.minimum(v.data), 500); @@ -158,14 +158,14 @@ eq("File \"bs_mutable_set_test.res\", line 87, characters 9-16", Belt_internalAV eq("File \"bs_mutable_set_test.res\", line 88, characters 9-16", Belt_internalAVLset.maxUndefined(v.data), 2000); eq("File \"bs_mutable_set_test.res\", line 89, characters 9-16", Belt_MutableSetInt.reduce(v, 0, (function (x, y) { - return x + y | 0; - })), 1876250); + return x + y | 0; +})), 1876250); b("File \"bs_mutable_set_test.res\", line 90, characters 8-15", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { - return i + 500 | 0; - })), (function (x, y) { - return x === y; - }))); + return i + 500 | 0; +})), (function (x, y) { + return x === y; +}))); eq("File \"bs_mutable_set_test.res\", line 91, characters 9-16", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -186,12 +186,12 @@ var aa = match$1[0]; b("File \"bs_mutable_set_test.res\", line 96, characters 8-15", match[1]); b("File \"bs_mutable_set_test.res\", line 97, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (x, y) { - return x === y; - }))); + return x === y; +}))); b("File \"bs_mutable_set_test.res\", line 98, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 99, characters 8-15", Belt_MutableSetInt.subset(aa, v)); @@ -214,12 +214,12 @@ var aa$1 = match$3[0]; b("File \"bs_mutable_set_test.res\", line 105, characters 8-15", !match$2[1]); b("File \"bs_mutable_set_test.res\", line 106, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 107, characters 8-15", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_mutable_set_test.res\", line 108, characters 8-15", Belt_MutableSetInt.subset(aa$1, v)); @@ -244,8 +244,8 @@ var cc = Belt_MutableSetInt.union(aa$2, bb$2); var xs$4 = Array_data_util.randomRange(0, 120); b("File \"bs_mutable_set_test.res\", line 120, characters 8-15", Belt_MutableSetInt.eq(cc, { - data: Belt_internalSetInt.fromArray(xs$4) - })); + data: Belt_internalSetInt.fromArray(xs$4) +})); var xs$5 = Array_data_util.randomRange(0, 20); @@ -254,81 +254,81 @@ var xs$6 = Array_data_util.randomRange(21, 40); var xs$7 = Array_data_util.randomRange(0, 40); b("File \"bs_mutable_set_test.res\", line 123, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.union({ - data: Belt_internalSetInt.fromArray(xs$5) - }, { - data: Belt_internalSetInt.fromArray(xs$6) - }), { - data: Belt_internalSetInt.fromArray(xs$7) - })); + data: Belt_internalSetInt.fromArray(xs$5) +}, { + data: Belt_internalSetInt.fromArray(xs$6) +}), { + data: Belt_internalSetInt.fromArray(xs$7) +})); var dd = Belt_MutableSetInt.intersect(aa$2, bb$2); var xs$8 = Array_data_util.randomRange(40, 100); b("File \"bs_mutable_set_test.res\", line 127, characters 8-15", Belt_MutableSetInt.eq(dd, { - data: Belt_internalSetInt.fromArray(xs$8) - })); + data: Belt_internalSetInt.fromArray(xs$8) +})); var xs$9 = Array_data_util.randomRange(0, 20); var xs$10 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 129, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$9) - }, { - data: Belt_internalSetInt.fromArray(xs$10) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$9) +}, { + data: Belt_internalSetInt.fromArray(xs$10) +}), { + data: undefined +})); var xs$11 = Array_data_util.randomRange(21, 40); var xs$12 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 136, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$11) - }, { - data: Belt_internalSetInt.fromArray(xs$12) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$11) +}, { + data: Belt_internalSetInt.fromArray(xs$12) +}), { + data: undefined +})); b("File \"bs_mutable_set_test.res\", line 142, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]) - }, { - data: Belt_internalSetInt.fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ]) - }), { - data: Belt_internalSetInt.fromArray([ - 4, - 5 - ]) - })); + data: Belt_internalSetInt.fromArray([ + 1, + 3, + 4, + 5, + 7, + 9 + ]) +}, { + data: Belt_internalSetInt.fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 + ]) +}), { + data: Belt_internalSetInt.fromArray([ + 4, + 5 + ]) +})); var xs$13 = Array_data_util.randomRange(0, 39); b("File \"bs_mutable_set_test.res\", line 143, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(aa$2, bb$2), { - data: Belt_internalSetInt.fromArray(xs$13) - })); + data: Belt_internalSetInt.fromArray(xs$13) +})); var xs$14 = Array_data_util.randomRange(101, 120); b("File \"bs_mutable_set_test.res\", line 144, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(bb$2, aa$2), { - data: Belt_internalSetInt.fromArray(xs$14) - })); + data: Belt_internalSetInt.fromArray(xs$14) +})); var xs$15 = Array_data_util.randomRange(21, 40); @@ -337,12 +337,12 @@ var xs$16 = Array_data_util.randomRange(0, 20); var xs$17 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 146, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$15) - }, { - data: Belt_internalSetInt.fromArray(xs$16) - }), { - data: Belt_internalSetInt.fromArray(xs$17) - })); + data: Belt_internalSetInt.fromArray(xs$15) +}, { + data: Belt_internalSetInt.fromArray(xs$16) +}), { + data: Belt_internalSetInt.fromArray(xs$17) +})); var xs$18 = Array_data_util.randomRange(0, 20); @@ -351,12 +351,12 @@ var xs$19 = Array_data_util.randomRange(21, 40); var xs$20 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 153, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$18) - }, { - data: Belt_internalSetInt.fromArray(xs$19) - }), { - data: Belt_internalSetInt.fromArray(xs$20) - })); + data: Belt_internalSetInt.fromArray(xs$18) +}, { + data: Belt_internalSetInt.fromArray(xs$19) +}), { + data: Belt_internalSetInt.fromArray(xs$20) +})); var xs$21 = Array_data_util.randomRange(0, 20); @@ -365,12 +365,12 @@ var xs$22 = Array_data_util.randomRange(0, 40); var xs$23 = Array_data_util.randomRange(0, -1); b("File \"bs_mutable_set_test.res\", line 161, characters 8-15", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$21) - }, { - data: Belt_internalSetInt.fromArray(xs$22) - }), { - data: Belt_internalSetInt.fromArray(xs$23) - })); + data: Belt_internalSetInt.fromArray(xs$21) +}, { + data: Belt_internalSetInt.fromArray(xs$22) +}), { + data: Belt_internalSetInt.fromArray(xs$23) +})); var xs$24 = Array_data_util.randomRange(0, 1000); @@ -379,16 +379,16 @@ var a0 = { }; var a1 = Belt_MutableSetInt.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_MutableSetInt.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match$4 = Belt_MutableSetInt.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match$4[1]; @@ -399,23 +399,23 @@ b("File \"bs_mutable_set_test.res\", line 173, characters 8-15", Belt_MutableSet b("File \"bs_mutable_set_test.res\", line 174, characters 8-15", Belt_MutableSetInt.eq(a2, a4)); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_internalAVLset.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_internalAVLset.checkInvariantInternal(x.data); +})); var v$1 = { data: undefined @@ -428,8 +428,8 @@ for(var i$2 = 0; i$2 <= 100000; ++i$2){ Belt_internalAVLset.checkInvariantInternal(v$1.data); b("File \"bs_mutable_set_test.res\", line 188, characters 10-17", Belt_Range.every(0, 100000, (function (i) { - return Belt_internalSetInt.has(v$1.data, i); - }))); + return Belt_internalSetInt.has(v$1.data, i); +}))); eq("File \"bs_mutable_set_test.res\", line 189, characters 5-12", Belt_internalAVLset.size(v$1.data), 100001); @@ -472,8 +472,8 @@ eq("File \"bs_mutable_set_test.res\", line 216, characters 5-12", Belt_internalA b("File \"bs_mutable_set_test.res\", line 217, characters 4-11", Belt_MutableSetInt.isEmpty(v$3)); var xs$25 = Belt_Array.makeBy(30, (function (i) { - return i; - })); + return i; +})); var v$4 = { data: Belt_internalSetInt.fromArray(xs$25) @@ -505,8 +505,8 @@ function id(loc, x) { }; Belt_internalAVLset.checkInvariantInternal(u.data); b(loc, Belt_Array.every2(Belt_internalAVLset.toArray(u.data), x, (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; + }))); } id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); @@ -514,81 +514,81 @@ id("File \"bs_mutable_set_test.res\", line 242, characters 5-12", []); id("File \"bs_mutable_set_test.res\", line 243, characters 5-12", [0]); id("File \"bs_mutable_set_test.res\", line 244, characters 5-12", [ - 0, - 1 - ]); + 0, + 1 +]); id("File \"bs_mutable_set_test.res\", line 245, characters 5-12", [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); id("File \"bs_mutable_set_test.res\", line 246, characters 5-12", [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); id("File \"bs_mutable_set_test.res\", line 247, characters 5-12", [ - 0, - 1, - 2, - 3, - 4 - ]); + 0, + 1, + 2, + 3, + 4 +]); id("File \"bs_mutable_set_test.res\", line 248, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 5 - ]); + 0, + 1, + 2, + 3, + 4, + 5 +]); id("File \"bs_mutable_set_test.res\", line 249, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6 - ]); + 0, + 1, + 2, + 3, + 4, + 6 +]); id("File \"bs_mutable_set_test.res\", line 250, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7 +]); id("File \"bs_mutable_set_test.res\", line 251, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7, - 8 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8 +]); id("File \"bs_mutable_set_test.res\", line 252, characters 5-12", [ - 0, - 1, - 2, - 3, - 4, - 6, - 7, - 8, - 9 - ]); + 0, + 1, + 2, + 3, + 4, + 6, + 7, + 8, + 9 +]); id("File \"bs_mutable_set_test.res\", line 253, characters 5-12", Array_data_util.range(0, 1000)); @@ -599,16 +599,16 @@ var v$5 = { }; var copyV = Belt_MutableSetInt.keep(v$5, (function (x) { - return x % 8 === 0; - })); + return x % 8 === 0; +})); var match$5 = Belt_MutableSetInt.partition(v$5, (function (x) { - return x % 8 === 0; - })); + return x % 8 === 0; +})); var cc$1 = Belt_MutableSetInt.keep(v$5, (function (x) { - return x % 8 !== 0; - })); + return x % 8 !== 0; +})); for(var i$6 = 0; i$6 <= 200; ++i$6){ Belt_MutableSetInt.remove(v$5, i$6); @@ -617,8 +617,8 @@ for(var i$6 = 0; i$6 <= 200; ++i$6){ eq("File \"bs_mutable_set_test.res\", line 264, characters 5-12", Belt_internalAVLset.size(copyV.data), 126); eq("File \"bs_mutable_set_test.res\", line 265, characters 5-12", Belt_internalAVLset.toArray(copyV.data), Belt_Array.makeBy(126, (function (i) { - return (i << 3); - }))); + return (i << 3); +}))); eq("File \"bs_mutable_set_test.res\", line 266, characters 5-12", Belt_internalAVLset.size(v$5.data), 800); @@ -639,18 +639,18 @@ var match$7 = match$6[0]; var xs$28 = Array_data_util.randomRange(0, 399); b("File \"bs_mutable_set_test.res\", line 274, characters 4-11", Belt_MutableSetInt.eq(match$7[0], { - data: Belt_internalSetInt.fromArray(xs$28) - })); + data: Belt_internalSetInt.fromArray(xs$28) +})); var xs$29 = Array_data_util.randomRange(401, 1000); b("File \"bs_mutable_set_test.res\", line 275, characters 4-11", Belt_MutableSetInt.eq(match$7[1], { - data: Belt_internalSetInt.fromArray(xs$29) - })); + data: Belt_internalSetInt.fromArray(xs$29) +})); var xs$30 = Belt_Array.map(Array_data_util.randomRange(0, 1000), (function (x) { - return (x << 1); - })); + return (x << 1); +})); var d = { data: Belt_internalSetInt.fromArray(xs$30) @@ -661,20 +661,20 @@ var match$8 = Belt_MutableSetInt.split(d, 1001); var match$9 = match$8[0]; var xs$31 = Belt_Array.makeBy(501, (function (x) { - return (x << 1); - })); + return (x << 1); +})); b("File \"bs_mutable_set_test.res\", line 278, characters 4-11", Belt_MutableSetInt.eq(match$9[0], { - data: Belt_internalSetInt.fromArray(xs$31) - })); + data: Belt_internalSetInt.fromArray(xs$31) +})); var xs$32 = Belt_Array.makeBy(500, (function (x) { - return 1002 + (x << 1) | 0; - })); + return 1002 + (x << 1) | 0; +})); b("File \"bs_mutable_set_test.res\", line 279, characters 4-11", Belt_MutableSetInt.eq(match$9[1], { - data: Belt_internalSetInt.fromArray(xs$32) - })); + data: Belt_internalSetInt.fromArray(xs$32) +})); var xs$33 = Array_data_util.randomRange(0, 100); @@ -693,8 +693,8 @@ var cc$2 = Belt_MutableSetInt.union(aa$3, bb$3); var xs$35 = Array_data_util.randomRange(0, 120); b("File \"bs_mutable_set_test.res\", line 289, characters 4-11", Belt_MutableSetInt.eq(cc$2, { - data: Belt_internalSetInt.fromArray(xs$35) - })); + data: Belt_internalSetInt.fromArray(xs$35) +})); var xs$36 = Array_data_util.randomRange(0, 20); @@ -703,81 +703,81 @@ var xs$37 = Array_data_util.randomRange(21, 40); var xs$38 = Array_data_util.randomRange(0, 40); b("File \"bs_mutable_set_test.res\", line 292, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.union({ - data: Belt_internalSetInt.fromArray(xs$36) - }, { - data: Belt_internalSetInt.fromArray(xs$37) - }), { - data: Belt_internalSetInt.fromArray(xs$38) - })); + data: Belt_internalSetInt.fromArray(xs$36) +}, { + data: Belt_internalSetInt.fromArray(xs$37) +}), { + data: Belt_internalSetInt.fromArray(xs$38) +})); var dd$1 = Belt_MutableSetInt.intersect(aa$3, bb$3); var xs$39 = Array_data_util.randomRange(40, 100); b("File \"bs_mutable_set_test.res\", line 296, characters 4-11", Belt_MutableSetInt.eq(dd$1, { - data: Belt_internalSetInt.fromArray(xs$39) - })); + data: Belt_internalSetInt.fromArray(xs$39) +})); var xs$40 = Array_data_util.randomRange(0, 20); var xs$41 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 298, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$40) - }, { - data: Belt_internalSetInt.fromArray(xs$41) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$40) +}, { + data: Belt_internalSetInt.fromArray(xs$41) +}), { + data: undefined +})); var xs$42 = Array_data_util.randomRange(21, 40); var xs$43 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 302, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray(xs$42) - }, { - data: Belt_internalSetInt.fromArray(xs$43) - }), { - data: undefined - })); + data: Belt_internalSetInt.fromArray(xs$42) +}, { + data: Belt_internalSetInt.fromArray(xs$43) +}), { + data: undefined +})); b("File \"bs_mutable_set_test.res\", line 305, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.intersect({ - data: Belt_internalSetInt.fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]) - }, { - data: Belt_internalSetInt.fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ]) - }), { - data: Belt_internalSetInt.fromArray([ - 4, - 5 - ]) - })); + data: Belt_internalSetInt.fromArray([ + 1, + 3, + 4, + 5, + 7, + 9 + ]) +}, { + data: Belt_internalSetInt.fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 + ]) +}), { + data: Belt_internalSetInt.fromArray([ + 4, + 5 + ]) +})); var xs$44 = Array_data_util.randomRange(0, 39); b("File \"bs_mutable_set_test.res\", line 306, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(aa$3, bb$3), { - data: Belt_internalSetInt.fromArray(xs$44) - })); + data: Belt_internalSetInt.fromArray(xs$44) +})); var xs$45 = Array_data_util.randomRange(101, 120); b("File \"bs_mutable_set_test.res\", line 307, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff(bb$3, aa$3), { - data: Belt_internalSetInt.fromArray(xs$45) - })); + data: Belt_internalSetInt.fromArray(xs$45) +})); var xs$46 = Array_data_util.randomRange(21, 40); @@ -786,12 +786,12 @@ var xs$47 = Array_data_util.randomRange(0, 20); var xs$48 = Array_data_util.randomRange(21, 40); b("File \"bs_mutable_set_test.res\", line 309, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$46) - }, { - data: Belt_internalSetInt.fromArray(xs$47) - }), { - data: Belt_internalSetInt.fromArray(xs$48) - })); + data: Belt_internalSetInt.fromArray(xs$46) +}, { + data: Belt_internalSetInt.fromArray(xs$47) +}), { + data: Belt_internalSetInt.fromArray(xs$48) +})); var xs$49 = Array_data_util.randomRange(0, 20); @@ -800,12 +800,12 @@ var xs$50 = Array_data_util.randomRange(21, 40); var xs$51 = Array_data_util.randomRange(0, 20); b("File \"bs_mutable_set_test.res\", line 316, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$49) - }, { - data: Belt_internalSetInt.fromArray(xs$50) - }), { - data: Belt_internalSetInt.fromArray(xs$51) - })); + data: Belt_internalSetInt.fromArray(xs$49) +}, { + data: Belt_internalSetInt.fromArray(xs$50) +}), { + data: Belt_internalSetInt.fromArray(xs$51) +})); var xs$52 = Array_data_util.randomRange(0, 20); @@ -814,12 +814,12 @@ var xs$53 = Array_data_util.randomRange(0, 40); var xs$54 = Array_data_util.randomRange(0, -1); b("File \"bs_mutable_set_test.res\", line 324, characters 4-11", Belt_MutableSetInt.eq(Belt_MutableSetInt.diff({ - data: Belt_internalSetInt.fromArray(xs$52) - }, { - data: Belt_internalSetInt.fromArray(xs$53) - }), { - data: Belt_internalSetInt.fromArray(xs$54) - })); + data: Belt_internalSetInt.fromArray(xs$52) +}, { + data: Belt_internalSetInt.fromArray(xs$53) +}), { + data: Belt_internalSetInt.fromArray(xs$54) +})); Mt.from_pair_suites("Bs_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_map_test.js b/jscomp/test/bs_poly_map_test.js index 0ea395f0a2..6e91009013 100644 --- a/jscomp/test/bs_poly_map_test.js +++ b/jscomp/test/bs_poly_map_test.js @@ -46,41 +46,41 @@ function emptyMap(param) { function mergeInter(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined && v2 !== undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined && v2 !== undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeUnion(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined || v2 !== undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined || v2 !== undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function mergeDiff(s1, s2) { var m = Belt_Map.merge(s1, s2, (function (k, v1, v2) { - if (v1 !== undefined && v2 === undefined) { - return Caml_option.some(undefined); - } - - })); + if (v1 !== undefined && v2 === undefined) { + return Caml_option.some(undefined); + } + + })); return Belt_Set.fromArray(Belt_MapDict.keysToArray(m.data), Icmp); } function randomRange(i, j) { return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { - return [ - x, - x - ]; - })); + return [ + x, + x + ]; + })); } var u0 = Belt_Map.fromArray(randomRange(0, 100), Icmp); @@ -102,19 +102,19 @@ var a1 = Belt_Map.set(a0, 3, 33); var a2 = Belt_Map.remove(a1, 3); var a3 = Belt_Map.update(a2, 3, (function (k) { - if (k !== undefined) { - return k + 1 | 0; - } else { - return 11; - } - })); + if (k !== undefined) { + return k + 1 | 0; + } else { + return 11; + } +})); var a4 = Belt_Map.update(a2, 3, (function (k) { - if (k !== undefined) { - return k + 1 | 0; - } - - })); + if (k !== undefined) { + return k + 1 | 0; + } + +})); var a5 = Belt_Map.remove(a0, 3); @@ -137,23 +137,23 @@ b("File \"bs_poly_map_test.res\", line 95, characters 4-11", 11 === Belt_Map.get b("File \"bs_poly_map_test.res\", line 96, characters 4-11", Belt_Map.getUndefined(a4, 3) === undefined); var a7 = Belt_Map.removeMany(a0, [ - 7, - 8, - 0, - 1, - 3, - 2, - 4, - 922, - 4, - 5, - 6 - ]); + 7, + 8, + 0, + 1, + 3, + 2, + 4, + 922, + 4, + 5, + 6 +]); eq("File \"bs_poly_map_test.res\", line 99, characters 5-12", Belt_MapDict.keysToArray(a7.data), [ - 9, - 10 - ]); + 9, + 10 +]); var a8 = Belt_Map.removeMany(a7, Array_data_util.randomRange(0, 100)); @@ -169,14 +169,14 @@ eq("File \"bs_poly_map_test.res\", line 109, characters 5-12", Belt_Map.get(u0$1 function acc(m, is) { return Belt_Array.reduce(is, m, (function (a, i) { - return Belt_Map.update(a, i, (function (n) { - if (n !== undefined) { - return n + 1 | 0; - } else { - return 1; - } - })); - })); + return Belt_Map.update(a, i, (function (n) { + if (n !== undefined) { + return n + 1 | 0; + } else { + return 1; + } + })); + })); } var m_cmp = Icmp.cmp; @@ -189,13 +189,13 @@ var m = { var m1 = acc(m, Belt_Array.concat(Array_data_util.randomRange(0, 20), Array_data_util.randomRange(10, 30))); b("File \"bs_poly_map_test.res\", line 126, characters 4-11", Belt_Map.eq(m1, Belt_Map.fromArray(Belt_Array.makeBy(31, (function (i) { - return [ - i, - i >= 10 && i <= 20 ? 2 : 1 - ]; - })), Icmp), (function (x, y) { - return x === y; - }))); + return [ + i, + i >= 10 && i <= 20 ? 2 : 1 + ]; +})), Icmp), (function (x, y) { + return x === y; +}))); var v0_cmp = Icmp.cmp; @@ -205,22 +205,22 @@ var v0 = { }; var v1 = Belt_Map.mergeMany(v0, Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { - return [ - x, - x - ]; - }))); + return [ + x, + x + ]; +}))); var v2 = Belt_Map.fromArray(Belt_Array.map(Array_data_util.randomRange(0, 10000), (function (x) { - return [ - x, - x - ]; - })), Icmp); + return [ + x, + x + ]; +})), Icmp); b("File \"bs_poly_map_test.res\", line 150, characters 4-11", Belt_Map.eq(v1, v2, (function (x, y) { - return x === y; - }))); + return x === y; +}))); function inc(x) { if (x !== undefined) { @@ -253,32 +253,32 @@ var match$4 = Belt_Map.get(v4, -10); b("File \"bs_poly_map_test.res\", line 175, characters 4-11", match$4 !== undefined ? match$4 === 0 : false); var map = Belt_Map.remove({ - cmp: Icmp.cmp, - data: undefined - }, 0); + cmp: Icmp.cmp, + data: undefined +}, 0); b("File \"bs_poly_map_test.res\", line 181, characters 4-11", Belt_MapDict.isEmpty(map.data)); var map$1 = Belt_Map.removeMany({ - cmp: Icmp.cmp, - data: undefined - }, [0]); + cmp: Icmp.cmp, + data: undefined +}, [0]); b("File \"bs_poly_map_test.res\", line 182, characters 4-11", Belt_MapDict.isEmpty(map$1.data)); b("File \"bs_poly_map_test.res\", line 184, characters 4-11", pres !== undefined ? pres === 5000 : false); b("File \"bs_poly_map_test.res\", line 190, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[0].data), Belt_Array.makeBy(5000, (function (i) { - return i; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return i; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_poly_map_test.res\", line 191, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$1[1].data), Belt_Array.makeBy(5000, (function (i) { - return 5001 + i | 0; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return 5001 + i | 0; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); var v7 = Belt_Map.remove(v3, 5000); @@ -289,16 +289,16 @@ var match$6 = match$5[0]; b("File \"bs_poly_map_test.res\", line 196, characters 4-11", match$5[1] === undefined); b("File \"bs_poly_map_test.res\", line 202, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[0].data), Belt_Array.makeBy(5000, (function (i) { - return i; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return i; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); b("File \"bs_poly_map_test.res\", line 203, characters 4-11", Belt_Array.eq(Belt_MapDict.keysToArray(match$6[1].data), Belt_Array.makeBy(5000, (function (i) { - return 5001 + i | 0; - })), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return 5001 + i | 0; +})), (function (prim0, prim1) { + return prim0 === prim1; +}))); Mt.from_pair_suites("Bs_poly_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_map_test.js b/jscomp/test/bs_poly_mutable_map_test.js index 314cb7a4d8..2e4816b6e0 100644 --- a/jscomp/test/bs_poly_mutable_map_test.js +++ b/jscomp/test/bs_poly_mutable_map_test.js @@ -38,11 +38,11 @@ function ff(x) { function randomRange(i, j) { return Belt_Array.map(Array_data_util.randomRange(i, j), (function (x) { - return [ - x, - x - ]; - })); + return [ + x, + x + ]; + })); } var a0 = Belt_MutableMap.fromArray(randomRange(0, 10), Icmp); @@ -52,23 +52,23 @@ Belt_MutableMap.set(a0, 3, 33); eq("File \"bs_poly_mutable_map_test.res\", line 27, characters 5-12", Belt_MutableMap.getExn(a0, 3), 33); Belt_MutableMap.removeMany(a0, [ - 7, - 8, - 0, - 1, - 3, - 2, - 4, - 922, - 4, - 5, - 6 - ]); + 7, + 8, + 0, + 1, + 3, + 2, + 4, + 922, + 4, + 5, + 6 +]); eq("File \"bs_poly_mutable_map_test.res\", line 29, characters 5-12", Belt_internalAVLtree.keysToArray(a0.data), [ - 9, - 10 - ]); + 9, + 10 +]); Belt_MutableMap.removeMany(a0, Array_data_util.randomRange(0, 100)); @@ -79,27 +79,27 @@ var a0$1 = Belt_MutableMap.fromArray(randomRange(0, 10000), Icmp); Belt_MutableMap.set(a0$1, 2000, 33); Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(0, 1998), (function (prim) { - return prim[0]; - }))); + return prim[0]; +}))); Belt_MutableMap.removeMany(a0$1, Belt_Array.map(randomRange(2002, 11000), (function (prim) { - return prim[0]; - }))); + return prim[0]; +}))); eq("File \"bs_poly_mutable_map_test.res\", line 39, characters 5-12", Belt_internalAVLtree.toArray(a0$1.data), [ - [ - 1999, - 1999 - ], - [ - 2000, - 33 - ], - [ - 2001, - 2001 - ] - ]); + [ + 1999, + 1999 + ], + [ + 2000, + 33 + ], + [ + 2001, + 2001 + ] +]); Mt.from_pair_suites("Bs_poly_mutable_map_test", suites.contents); diff --git a/jscomp/test/bs_poly_mutable_set_test.js b/jscomp/test/bs_poly_mutable_set_test.js index 1cff8858bf..1dcf4eaf38 100644 --- a/jscomp/test/bs_poly_mutable_set_test.js +++ b/jscomp/test/bs_poly_mutable_set_test.js @@ -118,41 +118,41 @@ b("File \"bs_poly_mutable_set_test.res\", line 54, characters 4-11", Belt_Mutabl var v = fromArray(Array_data_util.randomRange(1000, 2000)); var bs = Belt_Array.map(Array_data_util.randomRange(500, 1499), (function (x) { - return Belt_MutableSet.removeCheck(v, x); - })); + return Belt_MutableSet.removeCheck(v, x); +})); var indeedRemoved = Belt_Array.reduce(bs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_poly_mutable_set_test.res\", line 67, characters 5-12", indeedRemoved, 500); eq("File \"bs_poly_mutable_set_test.res\", line 68, characters 5-12", Belt_internalAVLset.size(v.data), 501); var cs = Belt_Array.map(Array_data_util.randomRange(500, 2000), (function (x) { - return Belt_MutableSet.addCheck(v, x); - })); + return Belt_MutableSet.addCheck(v, x); +})); var indeedAded = Belt_Array.reduce(cs, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_poly_mutable_set_test.res\", line 77, characters 5-12", indeedAded, 1000); eq("File \"bs_poly_mutable_set_test.res\", line 78, characters 5-12", Belt_internalAVLset.size(v.data), 1501); b("File \"bs_poly_mutable_set_test.res\", line 79, characters 4-11", Belt_MutableSet.isEmpty({ - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); eq("File \"bs_poly_mutable_set_test.res\", line 80, characters 5-12", Belt_internalAVLset.minimum(v.data), 500); @@ -163,14 +163,14 @@ eq("File \"bs_poly_mutable_set_test.res\", line 82, characters 5-12", Belt_inter eq("File \"bs_poly_mutable_set_test.res\", line 83, characters 5-12", Belt_internalAVLset.maxUndefined(v.data), 2000); eq("File \"bs_poly_mutable_set_test.res\", line 84, characters 5-12", Belt_MutableSet.reduce(v, 0, (function (x, y) { - return x + y | 0; - })), 1876250); + return x + y | 0; +})), 1876250); b("File \"bs_poly_mutable_set_test.res\", line 85, characters 4-11", Belt_List.eq(Belt_internalAVLset.toList(v.data), Belt_List.makeBy(1501, (function (i) { - return i + 500 | 0; - })), (function (x, y) { - return x === y; - }))); + return i + 500 | 0; +})), (function (x, y) { + return x === y; +}))); eq("File \"bs_poly_mutable_set_test.res\", line 86, characters 5-12", Belt_internalAVLset.toArray(v.data), Array_data_util.range(500, 2000)); @@ -191,12 +191,12 @@ var aa = match$1[0]; b("File \"bs_poly_mutable_set_test.res\", line 91, characters 4-11", match[1]); b("File \"bs_poly_mutable_set_test.res\", line 92, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 93, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 94, characters 4-11", Belt_MutableSet.subset(aa, v)); @@ -219,12 +219,12 @@ var aa$1 = match$3[0]; b("File \"bs_poly_mutable_set_test.res\", line 100, characters 4-11", !match$2[1]); b("File \"bs_poly_mutable_set_test.res\", line 101, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(aa$1.data), Array_data_util.range(500, 999), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 102, characters 4-11", Belt_Array.eq(Belt_internalAVLset.toArray(bb$1.data), Array_data_util.range(1001, 2000), (function (prim0, prim1) { - return prim0 === prim1; - }))); + return prim0 === prim1; +}))); b("File \"bs_poly_mutable_set_test.res\", line 103, characters 4-11", Belt_MutableSet.subset(aa$1, v)); @@ -247,33 +247,33 @@ var dd = Belt_MutableSet.intersect(aa$2, bb$2); b("File \"bs_poly_mutable_set_test.res\", line 122, characters 4-11", Belt_MutableSet.eq(dd, fromArray(Array_data_util.randomRange(40, 100)))); b("File \"bs_poly_mutable_set_test.res\", line 124, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray(Array_data_util.randomRange(0, 20)), fromArray(Array_data_util.randomRange(21, 40))), { - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); b("File \"bs_poly_mutable_set_test.res\", line 128, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray(Array_data_util.randomRange(21, 40)), fromArray(Array_data_util.randomRange(0, 20))), { - cmp: IntCmp.cmp, - data: undefined - })); + cmp: IntCmp.cmp, + data: undefined +})); b("File \"bs_poly_mutable_set_test.res\", line 131, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.intersect(fromArray([ - 1, - 3, - 4, - 5, - 7, - 9 - ]), fromArray([ - 2, - 4, - 5, - 6, - 8, - 10 - ])), fromArray([ - 4, - 5 - ]))); + 1, + 3, + 4, + 5, + 7, + 9 +]), fromArray([ + 2, + 4, + 5, + 6, + 8, + 10 +])), fromArray([ + 4, + 5 +]))); b("File \"bs_poly_mutable_set_test.res\", line 132, characters 4-11", Belt_MutableSet.eq(Belt_MutableSet.diff(aa$2, bb$2), fromArray(Array_data_util.randomRange(0, 39)))); @@ -288,16 +288,16 @@ b("File \"bs_poly_mutable_set_test.res\", line 150, characters 4-11", Belt_Mutab var a0 = fromArray(Array_data_util.randomRange(0, 1000)); var a1 = Belt_MutableSet.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_MutableSet.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match$4 = Belt_MutableSet.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match$4[1]; @@ -308,23 +308,23 @@ b("File \"bs_poly_mutable_set_test.res\", line 162, characters 4-11", Belt_Mutab b("File \"bs_poly_mutable_set_test.res\", line 163, characters 4-11", Belt_MutableSet.eq(a2, a4)); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_internalAVLset.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_internalAVLset.checkInvariantInternal(x.data); +})); Mt.from_pair_suites("Bs_poly_mutable_set_test", suites.contents); diff --git a/jscomp/test/bs_poly_set_test.js b/jscomp/test/bs_poly_set_test.js index d2a95f712b..1a76db7941 100644 --- a/jscomp/test/bs_poly_set_test.js +++ b/jscomp/test/bs_poly_set_test.js @@ -51,18 +51,18 @@ var u5 = Belt_Set.add(u4, 3); var u6 = Belt_Set.removeMany(u5, r); var u7 = Belt_Set.mergeMany(u6, [ - 0, - 1, - 2, - 0 - ]); + 0, + 1, + 2, + 0 +]); var u8 = Belt_Set.removeMany(u7, [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); var u9 = Belt_Set.mergeMany(u8, Array_data_util.randomRange(0, 20000)); @@ -141,13 +141,13 @@ var u24 = Belt_Set.union(u18, u17); var u25 = Belt_Set.add(u22, 59); var u26 = Belt_Set.add({ - cmp: IntCmp.cmp, - data: undefined - }, 3); + cmp: IntCmp.cmp, + data: undefined +}, 3); var ss = Belt_Array.makeByAndShuffle(100, (function (i) { - return (i << 1); - })); + return (i << 1); +})); var u27 = Belt_Set.fromArray(ss, IntCmp); @@ -200,11 +200,11 @@ function testIterToList(xs) { contents: /* [] */0 }; Belt_Set.forEach(xs, (function (x) { - v.contents = { - hd: x, - tl: v.contents - }; - })); + v.contents = { + hd: x, + tl: v.contents + }; + })); return Belt_List.reverse(v.contents); } @@ -213,11 +213,11 @@ function testIterToList2(xs) { contents: /* [] */0 }; Belt_SetDict.forEach(xs.data, (function (x) { - v.contents = { - hd: x, - tl: v.contents - }; - })); + v.contents = { + hd: x, + tl: v.contents + }; + })); return Belt_List.reverse(v.contents); } @@ -228,48 +228,48 @@ var u1$1 = Belt_Set.remove(u0$1, 17); var u2$1 = Belt_Set.add(u1$1, 33); b("File \"bs_poly_set_test.res\", line 110, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_List.makeBy(21, (function (i) { - return i; - })), (function (x, y) { - return x === y; - }))); + return i; +})), (function (x, y) { + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 111, characters 4-11", Belt_List.every2(testIterToList2(u0$1), Belt_List.makeBy(21, (function (i) { - return i; - })), (function (x, y) { - return x === y; - }))); + return i; +})), (function (x, y) { + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 112, characters 4-11", Belt_List.every2(testIterToList(u0$1), Belt_SetDict.toList(u0$1.data), (function (x, y) { - return x === y; - }))); + return x === y; +}))); b("File \"bs_poly_set_test.res\", line 113, characters 4-11", Belt_Set.some(u0$1, (function (x) { - return x === 17; - }))); + return x === 17; +}))); b("File \"bs_poly_set_test.res\", line 114, characters 4-11", !Belt_Set.some(u1$1, (function (x) { - return x === 17; - }))); + return x === 17; +}))); b("File \"bs_poly_set_test.res\", line 115, characters 4-11", Belt_Set.every(u0$1, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 116, characters 4-11", Belt_SetDict.every(u0$1.data, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 117, characters 4-11", !Belt_Set.every(u2$1, (function (x) { - return x < 24; - }))); + return x < 24; +}))); b("File \"bs_poly_set_test.res\", line 118, characters 4-11", !Belt_Set.every(Belt_Set.fromArray([ - 1, - 2, - 3 - ], IntCmp), (function (x) { - return x === 2; - }))); + 1, + 2, + 3 +], IntCmp), (function (x) { + return x === 2; +}))); b("File \"bs_poly_set_test.res\", line 119, characters 4-11", Belt_Set.cmp(u1$1, u0$1) < 0); @@ -278,16 +278,16 @@ b("File \"bs_poly_set_test.res\", line 120, characters 4-11", Belt_Set.cmp(u0$1, var a0 = Belt_Set.fromArray(Array_data_util.randomRange(0, 1000), IntCmp); var a1 = Belt_Set.keep(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a2 = Belt_Set.keep(a0, (function (x) { - return x % 2 !== 0; - })); + return x % 2 !== 0; +})); var match = Belt_Set.partition(a0, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); var a4 = match[1]; @@ -302,12 +302,12 @@ eq("File \"bs_poly_set_test.res\", line 129, characters 5-12", Belt_Set.getExn(a eq("File \"bs_poly_set_test.res\", line 130, characters 5-12", Belt_Set.getExn(a0, 4), 4); t("File \"bs_poly_set_test.res\", line 131, characters 4-11", (function (param) { - Belt_Set.getExn(a0, 1002); - })); + Belt_Set.getExn(a0, 1002); +})); t("File \"bs_poly_set_test.res\", line 132, characters 4-11", (function (param) { - Belt_Set.getExn(a0, -1); - })); + Belt_Set.getExn(a0, -1); +})); eq("File \"bs_poly_set_test.res\", line 133, characters 5-12", Belt_SetDict.size(a0.data), 1001); @@ -320,12 +320,12 @@ var match$2 = match$1[0]; b("File \"bs_poly_set_test.res\", line 136, characters 4-11", match$1[1]); eq("File \"bs_poly_set_test.res\", line 137, characters 5-12", Belt_SetDict.toArray(match$2[0].data), Belt_Array.makeBy(200, (function (i) { - return i; - }))); + return i; +}))); eq("File \"bs_poly_set_test.res\", line 138, characters 5-12", Belt_SetDict.toList(match$2[1].data), Belt_List.makeBy(800, (function (i) { - return i + 201 | 0; - }))); + return i + 201 | 0; +}))); var a7 = Belt_Set.remove(a0, 200); @@ -340,48 +340,48 @@ var a8 = match$4[0]; b("File \"bs_poly_set_test.res\", line 141, characters 4-11", !match$3[1]); eq("File \"bs_poly_set_test.res\", line 142, characters 5-12", Belt_SetDict.toArray(a8.data), Belt_Array.makeBy(200, (function (i) { - return i; - }))); + return i; +}))); eq("File \"bs_poly_set_test.res\", line 143, characters 5-12", Belt_SetDict.toList(a9.data), Belt_List.makeBy(800, (function (i) { - return i + 201 | 0; - }))); + return i + 201 | 0; +}))); eq("File \"bs_poly_set_test.res\", line 144, characters 5-12", Belt_SetDict.minimum(a8.data), 0); eq("File \"bs_poly_set_test.res\", line 145, characters 5-12", Belt_SetDict.minimum(a9.data), 201); Belt_List.forEach({ - hd: a0, + hd: a0, + tl: { + hd: a1, + tl: { + hd: a2, tl: { - hd: a1, + hd: a3, tl: { - hd: a2, - tl: { - hd: a3, - tl: { - hd: a4, - tl: /* [] */0 - } - } + hd: a4, + tl: /* [] */0 } } - }, (function (x) { - Belt_SetDict.checkInvariantInternal(x.data); - })); + } + } +}, (function (x) { + Belt_SetDict.checkInvariantInternal(x.data); +})); var a = Belt_Set.fromArray([], IntCmp); var m = Belt_Set.keep(a, (function (x) { - return x % 2 === 0; - })); + return x % 2 === 0; +})); b("File \"bs_poly_set_test.res\", line 151, characters 4-11", Belt_SetDict.isEmpty(m.data)); var match$5 = Belt_Set.split({ - cmp: IntCmp.cmp, - data: undefined - }, 0); + cmp: IntCmp.cmp, + data: undefined +}, 0); var match$6 = match$5[0]; diff --git a/jscomp/test/bs_queue_test.js b/jscomp/test/bs_queue_test.js index e62b95136c..f45e5ce2a2 100644 --- a/jscomp/test/bs_queue_test.js +++ b/jscomp/test/bs_queue_test.js @@ -69,9 +69,9 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 1), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)), [ - 1, - 2 - ]) && q.length === 2)) { + 1, + 2 + ]) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -84,10 +84,10 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 2), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)), [ - 1, - 2, - 3 - ]) && q.length === 3)) { + 1, + 2, + 3 + ]) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -100,11 +100,11 @@ if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 3), q)) } if (!(Caml_obj.equal(Belt_MutableQueue.toArray((Belt_MutableQueue.add(q, 4), q)), [ - 1, - 2, - 3, - 4 - ]) && q.length === 4)) { + 1, + 2, + 3, + 4 + ]) && q.length === 4)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -129,10 +129,10 @@ if (Belt_MutableQueue.popExn(q) !== 1) { } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ - 2, - 3, - 4 - ]) && q.length === 3)) { + 2, + 3, + 4 + ]) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -157,9 +157,9 @@ if (Belt_MutableQueue.popExn(q) !== 2) { } if (!(Caml_obj.equal(Belt_MutableQueue.toArray(q), [ - 3, - 4 - ]) && q.length === 2)) { + 3, + 4 + ]) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -472,10 +472,10 @@ if (!does_raise(Belt_MutableQueue.popExn, q$3)) { } if (!Caml_obj.equal(q$3, { - length: 0, - first: undefined, - last: undefined - })) { + length: 0, + first: undefined, + last: undefined + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -514,17 +514,17 @@ for(var i$1 = 1; i$1 <= 10; ++i$1){ var q2 = Belt_MutableQueue.copy(q1); if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1), [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ])) { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -537,17 +537,17 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1), [ } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2), [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10 - ])) { + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -723,19 +723,19 @@ var i$7 = { }; Belt_MutableQueue.forEach(q$5, (function (j) { - if (i$7.contents !== j) { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "bs_queue_test.res", - 120, - 4 - ], - Error: new Error() - }; - } - i$7.contents = i$7.contents + 1 | 0; - })); + if (i$7.contents !== j) { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "bs_queue_test.res", + 120, + 4 + ], + Error: new Error() + }; + } + i$7.contents = i$7.contents + 1 | 0; +})); var q1$1 = { length: 0, @@ -876,11 +876,11 @@ if (q1$2.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$2), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -955,11 +955,11 @@ if (q2$2.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$2), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1024,11 +1024,11 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1079,11 +1079,11 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$3), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1128,11 +1128,11 @@ if (q1$4.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q1$4), [ - 1, - 2, - 3, - 4 - ])) { + 1, + 2, + 3, + 4 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1157,11 +1157,11 @@ if (q2$4.length !== 4) { } if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), [ - 5, - 6, - 7, - 8 - ])) { + 5, + 6, + 7, + 8 + ])) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1235,10 +1235,10 @@ if (!Caml_obj.equal(Belt_MutableQueue.toArray(q2$4), v)) { } if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { - return x - y | 0; - })) !== Belt_Array.reduce(v, 0, (function (x, y) { - return x - y | 0; - }))) { + return x - y | 0; + })) !== Belt_Array.reduce(v, 0, (function (x, y) { + return x - y | 0; + }))) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1253,30 +1253,30 @@ if (Belt_MutableQueue.reduce(q2$4, 0, (function (x, y) { console.log("OK"); var q$6 = Belt_MutableQueue.fromArray([ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); var q1$5 = Belt_MutableQueue.map(q$6, (function (x) { - return x - 1 | 0; - })); + return x - 1 | 0; +})); eq("File \"bs_queue_test.res\", line 197, characters 5-12", Belt_MutableQueue.toArray(q1$5), [ - 0, - 1, - 2, - 3 - ]); + 0, + 1, + 2, + 3 +]); var q$7 = Belt_MutableQueue.fromArray([]); b("File \"bs_queue_test.res\", line 198, characters 4-11", q$7.length === 0); var q$8 = Belt_MutableQueue.map(Belt_MutableQueue.fromArray([]), (function (x) { - return x + 1 | 0; - })); + return x + 1 | 0; +})); b("File \"bs_queue_test.res\", line 199, characters 4-11", q$8.length === 0); diff --git a/jscomp/test/bs_set_int_test.js b/jscomp/test/bs_set_int_test.js index c356c462f8..3e86d1feb4 100644 --- a/jscomp/test/bs_set_int_test.js +++ b/jscomp/test/bs_set_int_test.js @@ -33,37 +33,37 @@ function $eq$star(a, b) { } b("File \"bs_set_int_test.res\", line 21, characters 11-18", $eq$star([ - 1, - 2, - 3 - ], [ - 3, - 2, - 1 - ])); + 1, + 2, + 3 +], [ + 3, + 2, + 1 +])); var u = Belt_SetInt.intersect(Belt_SetInt.fromArray([ - 1, - 2, - 3 - ]), Belt_SetInt.fromArray([ - 3, - 4, - 5 - ])); + 1, + 2, + 3 +]), Belt_SetInt.fromArray([ + 3, + 4, + 5 +])); b("File \"bs_set_int_test.res\", line 27, characters 11-18", Belt_SetInt.eq(Belt_SetInt.fromArray([3]), u)); function range(i, j) { return $$Array.init((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - })); + return k + i | 0; + })); } function revRange(i, j) { return $$Array.of_list(List.rev($$Array.to_list($$Array.init((j - i | 0) + 1 | 0, (function (k) { - return k + i | 0; - }))))); + return k + i | 0; + }))))); } var v = Belt_SetInt.fromArray($$Array.append(range(100, 1000), revRange(400, 1500))); @@ -73,8 +73,8 @@ var i = range(100, 1500); b("File \"bs_set_int_test.res\", line 37, characters 4-11", Belt_SetInt.eq(Belt_SetInt.fromArray(i), v)); var match = Belt_SetInt.partition(v, (function (x) { - return x % 3 === 0; - })); + return x % 3 === 0; +})); var l; @@ -144,15 +144,15 @@ var ss = [ ]; var v$1 = Belt_SetInt.fromArray([ - 1, - 222, - 3, - 4, - 2, - 0, - 33, - -1 - ]); + 1, + 222, + 3, + 4, + 2, + 0, + 33, + -1 +]); var minv = Belt_SetInt.minUndefined(v$1); @@ -163,10 +163,10 @@ function approx(loc, x, y) { } eq("File \"bs_set_int_test.res\", line 125, characters 5-12", Belt_SetInt.reduce(v$1, 0, (function (x, y) { - return x + y | 0; - })), Belt_Array.reduce(ss, 0, (function (prim0, prim1) { - return prim0 + prim1 | 0; - }))); + return x + y | 0; +})), Belt_Array.reduce(ss, 0, (function (prim0, prim1) { + return prim0 + prim1 | 0; +}))); approx("File \"bs_set_int_test.res\", line 126, characters 9-16", -1, minv); @@ -217,8 +217,8 @@ var v$10 = Belt_SetInt.remove(v$9, 1); b("File \"bs_set_int_test.res\", line 146, characters 4-11", Belt_SetInt.isEmpty(v$10)); var v$11 = Belt_Array.makeByAndShuffle(1000000, (function (i) { - return i; - })); + return i; +})); var u$1 = Belt_SetInt.fromArray(v$11); @@ -337,21 +337,21 @@ var v1 = Belt_SetInt.fromArray(Array_data_util.randomRange(1, 2001)); var v2 = Belt_SetInt.fromArray(Array_data_util.randomRange(3, 2002)); var v3 = Belt_SetInt.removeMany(v2, [ - 2002, - 2001 - ]); + 2002, + 2001 +]); var us = Belt_Array.map(Array_data_util.randomRange(1000, 3000), (function (x) { - return Belt_SetInt.has(v$12, x); - })); + return Belt_SetInt.has(v$12, x); +})); var counted = Belt_Array.reduce(us, 0, (function (acc, x) { - if (x) { - return acc + 1 | 0; - } else { - return acc; - } - })); + if (x) { + return acc + 1 | 0; + } else { + return acc; + } +})); eq("File \"bs_set_int_test.res\", line 235, characters 5-12", counted, 1001); diff --git a/jscomp/test/bs_sort_test.js b/jscomp/test/bs_sort_test.js index 1ee8bbce68..2640bf94f8 100644 --- a/jscomp/test/bs_sort_test.js +++ b/jscomp/test/bs_sort_test.js @@ -63,14 +63,14 @@ eq("File \"bs_sort_test.res\", line 36, characters 5-12", unions(Array_data_util eq("File \"bs_sort_test.res\", line 37, characters 5-12", unions(Array_data_util.range(8, 10), Array_data_util.range(9, 13)), Array_data_util.range(8, 13)); eq("File \"bs_sort_test.res\", line 38, characters 5-12", unions(Array_data_util.range(0, 2), Array_data_util.range(4, 7)), [ - 0, - 1, - 2, - 4, - 5, - 6, - 7 - ]); + 0, + 1, + 2, + 4, + 5, + 6, + 7 +]); eq("File \"bs_sort_test.res\", line 42, characters 5-12", inters(Array_data_util.range(1, 10), Array_data_util.range(3, 13)), Array_data_util.range(3, 10)); @@ -87,36 +87,36 @@ eq("File \"bs_sort_test.res\", line 50, characters 5-12", diffs(Array_data_util. eq("File \"bs_sort_test.res\", line 51, characters 5-12", diffs(Array_data_util.range(8, 10), Array_data_util.range(9, 13)), Array_data_util.range(8, 8)); eq("File \"bs_sort_test.res\", line 52, characters 5-12", diffs(Array_data_util.range(0, 2), Array_data_util.range(4, 7)), [ - 0, - 1, - 2 - ]); + 0, + 1, + 2 +]); b("File \"bs_sort_test.res\", line 56, characters 4-11", Belt_Range.every(0, 200, (function (i) { - var v = Array_data_util.randomRange(0, i); - Belt_SortArray.stableSortInPlaceBy(v, cmp); - return Belt_SortArray.isSorted(v, cmp); - }))); + var v = Array_data_util.randomRange(0, i); + Belt_SortArray.stableSortInPlaceBy(v, cmp); + return Belt_SortArray.isSorted(v, cmp); +}))); b("File \"bs_sort_test.res\", line 64, characters 4-11", Belt_Range.every(0, 200, (function (i) { - var v = Array_data_util.randomRange(0, i); - Belt_SortArray.stableSortInPlaceBy(v, cmp); - return Belt_SortArray.isSorted(v, cmp); - }))); + var v = Array_data_util.randomRange(0, i); + Belt_SortArray.stableSortInPlaceBy(v, cmp); + return Belt_SortArray.isSorted(v, cmp); +}))); b("File \"bs_sort_test.res\", line 71, characters 4-11", Belt_SortArray.isSorted([], cmp)); b("File \"bs_sort_test.res\", line 73, characters 4-11", Belt_SortArray.isSorted([0], cmp)); b("File \"bs_sort_test.res\", line 75, characters 4-11", Belt_SortArray.isSorted([ - 0, - 1 - ], cmp)); + 0, + 1 +], cmp)); b("File \"bs_sort_test.res\", line 76, characters 4-11", !Belt_SortArray.isSorted([ - 1, - 0 - ], cmp)); + 1, + 0 +], cmp)); var u = Array_data_util.randomRange(0, 1000000); @@ -164,21 +164,21 @@ var u$1 = [ ]; eq("File \"bs_sort_test.res\", line 95, characters 5-12", Belt_SortArray.stableSortBy(u$1, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 2, + "a" + ] +]); var u$2 = [ [ @@ -200,25 +200,25 @@ var u$2 = [ ]; eq("File \"bs_sort_test.res\", line 98, characters 4-11", Belt_SortArray.stableSortBy(u$2, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "b" - ], - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "b" + ], + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 2, + "a" + ] +]); var u$3 = [ [ @@ -248,100 +248,100 @@ var u$3 = [ ]; eq("File \"bs_sort_test.res\", line 104, characters 4-11", Belt_SortArray.stableSortBy(u$3, (function (param, param$1) { - return param[0] - param$1[0] | 0; - })), [ - [ - 1, - "c" - ], - [ - 1, - "b" - ], - [ - 1, - "a" - ], - [ - 1, - "b" - ], - [ - 1, - "c" - ], - [ - 2, - "a" - ] - ]); + return param[0] - param$1[0] | 0; +})), [ + [ + 1, + "c" + ], + [ + 1, + "b" + ], + [ + 1, + "a" + ], + [ + 1, + "b" + ], + [ + 1, + "c" + ], + [ + 2, + "a" + ] +]); eq("File \"bs_sort_test.res\", line 111, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 3, - 5, - 7 - ], 4, Caml.int_compare) ^ -1, 2); + 1, + 3, + 5, + 7 +], 4, Caml.int_compare) ^ -1, 2); eq("File \"bs_sort_test.res\", line 112, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 33, cmp), 4); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 33, cmp), 4); eq("File \"bs_sort_test.res\", line 113, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 1, cmp), 0); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 1, cmp), 0); eq("File \"bs_sort_test.res\", line 114, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 2, cmp), 1); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 2, cmp), 1); eq("File \"bs_sort_test.res\", line 115, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 3, cmp), 2); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 3, cmp), 2); eq("File \"bs_sort_test.res\", line 116, characters 5-12", Belt_SortArray.binarySearchBy([ - 1, - 2, - 3, - 4, - 33, - 35, - 36 - ], 4, cmp), 3); + 1, + 2, + 3, + 4, + 33, + 35, + 36 +], 4, cmp), 3); var aa = Array_data_util.range(0, 1000); b("File \"bs_sort_test.res\", line 118, characters 10-17", Belt_Range.every(0, 1000, (function (i) { - return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; - }))); + return Belt_SortArray.binarySearchBy(aa, i, cmp) === i; +}))); var cc = Belt_Array.map(Array_data_util.range(0, 2000), (function (x) { - return (x << 1); - })); + return (x << 1); +})); eq("File \"bs_sort_test.res\", line 121, characters 5-12", Belt_SortArray.binarySearchBy(cc, 5000, cmp) ^ -1, 2001); @@ -352,8 +352,8 @@ eq("File \"bs_sort_test.res\", line 123, characters 5-12", Belt_SortArray.binary eq("File \"bs_sort_test.res\", line 125, characters 5-12", Belt_SortArray.binarySearchBy(cc, 1, cmp) ^ -1, 1); b("File \"bs_sort_test.res\", line 127, characters 6-13", Belt_Range.every(0, 1999, (function (i) { - return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); - }))); + return (Belt_SortArray.binarySearchBy(cc, (i << 1) + 1 | 0, cmp) ^ -1) === (i + 1 | 0); +}))); function lt(x, y) { return x < y; @@ -364,51 +364,51 @@ eq("File \"bs_sort_test.res\", line 137, characters 5-12", Belt_SortArray.strict eq("File \"bs_sort_test.res\", line 138, characters 5-12", Belt_SortArray.strictlySortedLength([1], lt), 1); eq("File \"bs_sort_test.res\", line 139, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 1 - ], lt), 1); + 1, + 1 +], lt), 1); eq("File \"bs_sort_test.res\", line 140, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 1, - 2 - ], lt), 1); + 1, + 1, + 2 +], lt), 1); eq("File \"bs_sort_test.res\", line 141, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 2 - ], lt), 2); + 1, + 2 +], lt), 2); eq("File \"bs_sort_test.res\", line 142, characters 5-12", Belt_SortArray.strictlySortedLength([ - 1, - 2, - 3, - 4, - 3 - ], lt), 4); + 1, + 2, + 3, + 4, + 3 +], lt), 4); eq("File \"bs_sort_test.res\", line 143, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 4, - 3, - 2, - 1 - ], lt), 1); + 4, + 4, + 3, + 2, + 1 +], lt), 1); eq("File \"bs_sort_test.res\", line 144, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 3, - 2, - 1 - ], lt), -4); + 4, + 3, + 2, + 1 +], lt), -4); eq("File \"bs_sort_test.res\", line 145, characters 5-12", Belt_SortArray.strictlySortedLength([ - 4, - 3, - 2, - 1, - 0 - ], lt), -5); + 4, + 3, + 2, + 1, + 0 +], lt), -5); Mt.from_pair_suites("Bs_sort_test", suites.contents); diff --git a/jscomp/test/bs_stack_test.js b/jscomp/test/bs_stack_test.js index 71b1582de7..e9f0caffd8 100644 --- a/jscomp/test/bs_stack_test.js +++ b/jscomp/test/bs_stack_test.js @@ -64,14 +64,14 @@ function inOrder3(v) { current = v$1.left; }; Belt_MutableStack.dynamicPopIter(s, (function (popped) { - Belt_MutableQueue.add(q, popped.value); - var current = popped.right; - while(current !== undefined) { - var v = current; - Belt_MutableStack.push(s, v); - current = v.left; - }; - })); + Belt_MutableQueue.add(q, popped.value); + var current = popped.right; + while(current !== undefined) { + var v = current; + Belt_MutableStack.push(s, v); + current = v.left; + }; + })); return Belt_MutableQueue.toArray(q); } @@ -126,20 +126,20 @@ var test2 = n(Caml_option.some(n(Caml_option.some(n(Caml_option.some(n(Caml_opti var test3 = n(Caml_option.some(n(Caml_option.some(n(Caml_option.some(n(undefined, undefined, 4)), undefined, 2)), undefined, 5)), Caml_option.some(n(undefined, undefined, 3)), 1); eq("File \"bs_stack_test.res\", line 98, characters 3-10", inOrder(test1), [ - 4, - 2, - 5, - 1, - 3 - ]); + 4, + 2, + 5, + 1, + 3 +]); eq("File \"bs_stack_test.res\", line 99, characters 3-10", inOrder3(test1), [ - 4, - 2, - 5, - 1, - 3 - ]); + 4, + 2, + 5, + 1, + 3 +]); Mt.from_pair_suites("bs_stack_test.res", suites.contents); diff --git a/jscomp/test/bs_string_test.js b/jscomp/test/bs_string_test.js index 5e0c2226f8..f9e0ee90b2 100644 --- a/jscomp/test/bs_string_test.js +++ b/jscomp/test/bs_string_test.js @@ -17,20 +17,20 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"bs_string_test.res\", line 10, characters 2-9", "ghso ghso g".split(" ").reduce((function (x, y) { - return x + ("-" + y); - }), ""), "-ghso-ghso-g"); + return x + ("-" + y); +}), ""), "-ghso-ghso-g"); Mt.from_pair_suites("Bs_string_test", suites.contents); diff --git a/jscomp/test/bs_unwrap_test.js b/jscomp/test/bs_unwrap_test.js index 328c837471..88e44b139a 100644 --- a/jscomp/test/bs_unwrap_test.js +++ b/jscomp/test/bs_unwrap_test.js @@ -5,9 +5,9 @@ var Curry = require("../../lib/js/curry.js"); var Caml_option = require("../../lib/js/caml_option.js"); console.log([ - "hello world", - 1 - ]); + "hello world", + 1 +]); console.log(1337); @@ -56,26 +56,26 @@ function dyn_log3(prim0, prim1, prim2) { } dyn_log3({ - NAME: "Int", - VAL: 8 - }, { - NAME: "Bool", - VAL: true - }, undefined); + NAME: "Int", + VAL: 8 +}, { + NAME: "Bool", + VAL: true +}, undefined); console.log("foo"); console.log({ - foo: 1 - }); + foo: 1 +}); function dyn_log4(prim) { console.log(prim.VAL); } console.log({ - foo: 2 - }); + foo: 2 +}); function f(x) { console.log(x.VAL); diff --git a/jscomp/test/buffer_test.js b/jscomp/test/buffer_test.js index 21c640ac5f..dd7705f22c 100644 --- a/jscomp/test/buffer_test.js +++ b/jscomp/test/buffer_test.js @@ -12,53 +12,53 @@ var v = "gso"; var suites_0 = [ "equal", (function (param) { + return { + TAG: "Eq", + _0: [ + Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), + Bytes.make(3, /* 'a' */97)[0] + ], + _1: [ + /* 'a' */97, + /* 'a' */97 + ] + }; + }) +]; + +var suites_1 = { + hd: [ + "equal2", + (function (param) { + var u = Bytes.make(3, /* 'a' */97); + u[0] = /* 'b' */98; return { TAG: "Eq", _0: [ - Caml_bytes.get(Bytes.make(3, /* 'a' */97), 0), - Bytes.make(3, /* 'a' */97)[0] + u[0], + Caml_string.get(v, 0) ], _1: [ - /* 'a' */97, - /* 'a' */97 + /* 'b' */98, + /* 'g' */103 ] }; }) -]; - -var suites_1 = { - hd: [ - "equal2", - (function (param) { - var u = Bytes.make(3, /* 'a' */97); - u[0] = /* 'b' */98; - return { - TAG: "Eq", - _0: [ - u[0], - Caml_string.get(v, 0) - ], - _1: [ - /* 'b' */98, - /* 'g' */103 - ] - }; - }) ], tl: { hd: [ "buffer", (function (param) { - var v = $$Buffer.create(30); - for(var i = 0; i <= 10; ++i){ - $$Buffer.add_string(v, String(i)); - } - return { - TAG: "Eq", - _0: $$Buffer.contents(v), - _1: "012345678910" - }; - }) + var v = $$Buffer.create(30); + for(var i = 0; i <= 10; ++i){ + $$Buffer.add_string(v, String(i)); + } + return { + TAG: "Eq", + _0: $$Buffer.contents(v), + _1: "012345678910" + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/bytes_split_gpr_743_test.js b/jscomp/test/bytes_split_gpr_743_test.js index 278f2792dc..520d8142f2 100644 --- a/jscomp/test/bytes_split_gpr_743_test.js +++ b/jscomp/test/bytes_split_gpr_743_test.js @@ -21,12 +21,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -51,9 +51,9 @@ var res = Bytes.unsafe_to_string(b); console.log(res); eq("File \"bytes_split_gpr_743_test.res\", line 17, characters 5-12", [ - "aab", - res - ]); + "aab", + res +]); var b$1 = [ 0, @@ -74,9 +74,9 @@ var res2 = Bytes.unsafe_to_string(b$1); console.log(res2); eq("File \"bytes_split_gpr_743_test.res\", line 32, characters 5-12", [ - "bcc", - res2 - ]); + "bcc", + res2 +]); Mt.from_pair_suites("Bytes_split_gpr_743_test", suites.contents); diff --git a/jscomp/test/caml_compare_bigint_test.js b/jscomp/test/caml_compare_bigint_test.js index 598914e697..ffbb87e527 100644 --- a/jscomp/test/caml_compare_bigint_test.js +++ b/jscomp/test/caml_compare_bigint_test.js @@ -10,199 +10,199 @@ function isLessThan(title, small, big) { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(big, small) > 0 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(big, small) > 0 + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.compare(small, big) < 0 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.compare(small, big) < 0 + }; + }) ], tl: { hd: [ "< operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(small, big) + }; + }) ], tl: { hd: [ "<= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(small, big) + }; + }) ], tl: { hd: [ "> operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan(big, small) + }; + }) ], tl: { hd: [ ">= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(big, small) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(big, small) - }; - }) + return { + TAG: "Eq", + _0: small, + _1: Caml_obj.min(big, small) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: small, - _1: Caml_obj.min(small, big) - }; - }) + return { + TAG: "Eq", + _0: small, + _1: Caml_obj.min(small, big) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(big, small) - }; - }) + return { + TAG: "Eq", + _0: big, + _1: Caml_obj.max(big, small) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: big, - _1: Caml_obj.max(small, big) - }; - }) + return { + TAG: "Eq", + _0: big, + _1: Caml_obj.max(small, big) + }; + }) ], tl: { hd: [ "!== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: big !== small - }; - }) + return { + TAG: "Eq", + _0: true, + _1: big !== small + }; + }) ], tl: { hd: [ "!== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: small !== big - }; - }) + return { + TAG: "Eq", + _0: true, + _1: small !== big + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(big, small) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(big, small) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.notequal(small, big) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.notequal(small, big) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(big, small) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(big, small) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal(small, big) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal(small, big) + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: big === small - }; - }) + return { + TAG: "Eq", + _0: false, + _1: big === small + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: small === big - }; - }) + return { + TAG: "Eq", + _0: false, + _1: small === big + }; + }) ], tl: /* [] */0 } @@ -230,177 +230,177 @@ function isEqual(title, num1, num2) { hd: [ "< operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.lessthan(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.lessthan(num2, num1) + }; + }) ], tl: { hd: [ "<= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessequal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessequal(num2, num1) + }; + }) ], tl: { hd: [ "> operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.greaterthan(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.greaterthan(num1, num2) + }; + }) ], tl: { hd: [ ">= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterequal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterequal(num1, num2) + }; + }) ], tl: { hd: [ "min: " + title, (function (param) { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.min(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: num1, + _1: Caml_obj.min(num1, num2) + }; + }) ], tl: { hd: [ "max: " + title, (function (param) { - return { - TAG: "Eq", - _0: num1, - _1: Caml_obj.max(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: num1, + _1: Caml_obj.max(num1, num2) + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num1, num2) + }; + }) ], tl: { hd: [ "compare: " + title, (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Caml_obj.compare(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Caml_obj.compare(num2, num1) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: num1 !== num2 - }; - }) + return { + TAG: "Eq", + _0: false, + _1: num1 !== num2 + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: num2 !== num1 - }; - }) + return { + TAG: "Eq", + _0: false, + _1: num2 !== num1 + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num1, num2) + }; + }) ], tl: { hd: [ "!= operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.notequal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.notequal(num2, num1) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num1, num2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num1, num2) + }; + }) ], tl: { hd: [ "== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal(num2, num1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal(num2, num1) + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: num1 === num2 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: num1 === num2 + }; + }) ], tl: { hd: [ "=== operator: " + title, (function (param) { - return { - TAG: "Eq", - _0: true, - _1: num2 === num1 - }; - }) + return { + TAG: "Eq", + _0: true, + _1: num2 === num1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/caml_compare_test.js b/jscomp/test/caml_compare_test.js index 0ee723edd0..43a2c638b3 100644 --- a/jscomp/test/caml_compare_test.js +++ b/jscomp/test/caml_compare_test.js @@ -9,10 +9,10 @@ var function_equal_test; try { function_equal_test = Caml_obj.equal((function (x) { - return x + 1 | 0; - }), (function (x) { - return x + 2 | 0; - })); + return x + 1 | 0; + }), (function (x) { + return x + 2 | 0; + })); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); @@ -24,232 +24,334 @@ var suites = { hd: [ "File \"caml_compare_test.res\", line 12, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + }; + }) ], tl: { hd: [ "option2", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(1, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(1, 2) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 14, characters 5-12", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 1, + tl: /* [] */0 + }, /* [] */0) + }; + }) + ], + tl: { + hd: [ + "listeq", + (function (param) { return { TAG: "Eq", _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, + _1: Caml_obj.equal({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: /* [] */0 - }, /* [] */0) + } + } + }, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) }; }) - ], - tl: { - hd: [ - "listeq", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) - }; - }) ], tl: { hd: [ "listneq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 2, - tl: /* [] */0 - } - } - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 2, + tl: /* [] */0 + } + } + }) + }; + }) ], tl: { hd: [ "custom_u", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan([ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ], [ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 0 - } - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ], [ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 0 + } + ]) + }; + }) ], tl: { hd: [ "custom_u2", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.equal([ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ], [ - { - TAG: "A", - _0: 3 - }, - { - TAG: "B", - _0: 2, - _1: false - }, - { - TAG: "C", - _0: 1 - } - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.equal([ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ], [ + { + TAG: "A", + _0: 3 + }, + { + TAG: "B", + _0: 2, + _1: false + }, + { + TAG: "C", + _0: 1 + } + ]) + }; + }) ], tl: { hd: [ "function", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: function_equal_test - }; - }) + return { + TAG: "Eq", + _0: true, + _1: function_equal_test + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 20, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, 1) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, 1) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 21, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(undefined, [ - 1, - 30 - ]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(undefined, [ + 1, + 30 + ]) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 22, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan([ - 1, - 30 - ], undefined) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan([ + 1, + 30 + ], undefined) + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 24, characters 6-13", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan({ + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 4, + tl: { + hd: 2, + tl: { + hd: 1, + tl: /* [] */0 + } + } + } + } + } + } + } + } + }, { + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 4, + tl: { + hd: 2, + tl: { + hd: 1, + tl: { + hd: 409, + tl: /* [] */0 + } + } + } + } + } + } + } + } + } + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 27, characters 5-12", + (function (param) { return { TAG: "Eq", _0: true, _1: Caml_obj.lessthan({ + hd: 1, + tl: /* [] */0 + }, { + hd: 1, + tl: { + hd: 409, + tl: /* [] */0 + } + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 28, characters 5-12", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.lessthan(/* [] */0, { + hd: 409, + tl: /* [] */0 + }) + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 30, characters 6-13", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Caml_obj.greaterthan({ hd: 2, tl: { hd: 6, @@ -267,7 +369,10 @@ var suites = { hd: 2, tl: { hd: 1, - tl: /* [] */0 + tl: { + hd: 409, + tl: /* [] */0 + } } } } @@ -294,10 +399,7 @@ var suites = { hd: 2, tl: { hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + tl: /* [] */0 } } } @@ -307,51 +409,39 @@ var suites = { } } }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 27, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan({ - hd: 1, - tl: /* [] */0 - }, { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 28, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Caml_obj.lessthan(/* [] */0, { - hd: 409, - tl: /* [] */0 - }) }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 30, characters 6-13", - (function (param) { + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 33, characters 5-12", + (function (param) { return { TAG: "Eq", - _0: true, - _1: Caml_obj.greaterthan({ + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 34, characters 5-12", + (function (param) { + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 36, characters 6-13", + (function (param) { + return { + TAG: "Eq", + _0: false, + _1: Caml_obj.equal({ hd: 2, tl: { hd: 6, @@ -369,10 +459,7 @@ var suites = { hd: 2, tl: { hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } + tl: /* [] */0 } } } @@ -399,7 +486,10 @@ var suites = { hd: 2, tl: { hd: 1, - tl: /* [] */0 + tl: { + hd: 409, + tl: /* [] */0 + } } } } @@ -409,58 +499,37 @@ var suites = { } } }) - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 33, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 34, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 36, characters 6-13", - (function (param) { + ], + tl: { + hd: [ + "File \"caml_compare_test.res\", line 40, characters 6-13", + (function (param) { return { TAG: "Eq", _0: false, _1: Caml_obj.equal({ - hd: 2, + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, tl: { - hd: 6, + hd: 1, tl: { - hd: 1, + hd: 2, tl: { hd: 1, tl: { - hd: 2, + hd: 4, tl: { - hd: 1, + hd: 2, tl: { - hd: 4, + hd: 1, tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } + hd: 409, + tl: /* [] */0 } } } @@ -468,606 +537,537 @@ var suites = { } } } - }, { - hd: 2, + } + } + }, { + hd: 2, + tl: { + hd: 6, + tl: { + hd: 1, tl: { - hd: 6, + hd: 1, tl: { - hd: 1, + hd: 2, tl: { hd: 1, tl: { - hd: 2, + hd: 4, tl: { - hd: 1, + hd: 2, tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - } - } + hd: 1, + tl: /* [] */0 } } } } } } - }) + } + } + }) }; }) - ], - tl: { - hd: [ - "File \"caml_compare_test.res\", line 40, characters 6-13", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Caml_obj.equal({ - hd: 2, - tl: { - hd: 6, - tl: { - hd: 1, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 409, - tl: /* [] */0 - } - } - } - } - } - } - } - } - } - }, { - hd: 2, - tl: { - hd: 6, - tl: { - hd: 1, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 1, - tl: { - hd: 4, - tl: { - hd: 2, - tl: { - hd: 1, - tl: /* [] */0 - } - } - } - } - } - } - } - } - }) - }; - }) ], tl: { hd: [ "cmp_id", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_val", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1 - }, { - x: 2 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1 + }, { + x: 2 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_val2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 2 - }, { - x: 1 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 2 + }, { + x: 1 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_empty", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {}), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({}, {}), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_empty2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({}, {x:1}), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({}, {x:1}), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_swap", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }), - _1: 0 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }), + _1: 0 + }; + }) ], tl: { hd: [ "cmp_size", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1}, {x:1, y:2}), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({x:1}, {x:1, y:2}), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_size2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({x:1, y:2}, {x:1}), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({x:1, y:2}, {x:1}), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_order", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 0, - y: 1 - }, { - x: 1, - y: 0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 0, + y: 1 + }, { + x: 1, + y: 0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_order2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: 1, - y: 0 - }, { - x: 0, - y: 1 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: 1, + y: 0 + }, { + x: 0, + y: 1 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_in_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: { - x: 1 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_in_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: { - x: 2 - }, - tl: /* [] */0 - }, { - hd: { - x: 1 - }, - tl: /* [] */0 - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: { + x: 2 + }, + tl: /* [] */0 + }, { + hd: { + x: 1 + }, + tl: /* [] */0 + }), + _1: 1 + }; + }) ], tl: { hd: [ "cmp_with_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 1, - tl: /* [] */0 - } - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 1, + tl: /* [] */0 + } + }), + _1: -1 + }; + }) ], tl: { hd: [ "cmp_with_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - x: { - hd: 1, - tl: /* [] */0 - } - }, { - x: { - hd: 0, - tl: /* [] */0 - } - }), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + x: { + hd: 1, + tl: /* [] */0 + } + }, { + x: { + hd: 0, + tl: /* [] */0 + } + }), + _1: 1 + }; + }) ], tl: { hd: [ "eq_id", (function (param) { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - x: 1, - y: 2 - }) - }; - }) + return { + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + x: 1, + y: 2 + }) + }; + }) ], tl: { hd: [ "eq_val", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.equal({ + x: 1 + }, { + x: 2 + }), + _1: false + }; + }) + ], + tl: { + hd: [ + "eq_val2", + (function (param) { return { TAG: "Eq", _0: Caml_obj.equal({ - x: 1 - }, { - x: 2 - }), + x: 2 + }, { + x: 1 + }), _1: false }; }) - ], - tl: { - hd: [ - "eq_val2", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: 2 - }, { - x: 1 - }), - _1: false - }; - }) ], tl: { hd: [ "eq_empty", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {}), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({}, {}), + _1: true + }; + }) ], tl: { hd: [ "eq_empty2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({}, {x:1}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({}, {x:1}), + _1: false + }; + }) ], tl: { hd: [ "eq_swap", (function (param) { - return { - TAG: "Ok", - _0: Caml_obj.equal({ - x: 1, - y: 2 - }, { - y: 2, - x: 1 - }) - }; - }) + return { + TAG: "Ok", + _0: Caml_obj.equal({ + x: 1, + y: 2 + }, { + y: 2, + x: 1 + }) + }; + }) ], tl: { hd: [ "eq_size", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, {x:1, y:2}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1}, {x:1, y:2}), + _1: false + }; + }) ], tl: { hd: [ "eq_size2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1, y:2}, {x:1}), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1, y:2}, {x:1}), + _1: false + }; + }) ], tl: { hd: [ "eq_in_list", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - hd: { - x: 1 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({ + hd: { + x: 1 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: false + }; + }) ], tl: { hd: [ "eq_in_list2", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.equal({ + hd: { + x: 2 + }, + tl: /* [] */0 + }, { + hd: { + x: 2 + }, + tl: /* [] */0 + }), + _1: true + }; + }) + ], + tl: { + hd: [ + "eq_with_list", + (function (param) { return { TAG: "Eq", _0: Caml_obj.equal({ - hd: { - x: 2 - }, - tl: /* [] */0 - }, { - hd: { - x: 2 - }, - tl: /* [] */0 - }), + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 0, + tl: /* [] */0 + } + }), _1: true }; }) - ], - tl: { - hd: [ - "eq_with_list", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 0, - tl: /* [] */0 - } - }), - _1: true - }; - }) ], tl: { hd: [ "eq_with_list2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({ - x: { - hd: 0, - tl: /* [] */0 - } - }, { - x: { - hd: 1, - tl: /* [] */0 - } - }), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({ + x: { + hd: 0, + tl: /* [] */0 + } + }, { + x: { + hd: 1, + tl: /* [] */0 + } + }), + _1: false + }; + }) ], tl: { hd: [ "eq_no_prototype", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.equal({x:1}, ((function(){let o = Object.create(null);o.x = 1;return o;})())), + _1: true + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 76, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, { - hd: 3, - tl: /* [] */0 - }), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(null, { + hd: 3, + tl: /* [] */0 + }), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 77, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare({ - hd: 3, - tl: /* [] */0 - }, null), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare({ + hd: 3, + tl: /* [] */0 + }, null), + _1: 1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 78, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(null, 0), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(null, 0), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 79, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, null), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(0, null), + _1: 1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 80, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(undefined, 0), - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(undefined, 0), + _1: -1 + }; + }) ], tl: { hd: [ "File \"caml_compare_test.res\", line 81, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare(0, undefined), - _1: 1 - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare(0, undefined), + _1: 1 + }; + }) ], tl: /* [] */0 } @@ -1135,21 +1135,21 @@ function eq(loc, x, y) { eq("File \"caml_compare_test.res\", line 88, characters 3-10", true, Caml_obj.greaterthan(1, undefined)); eq("File \"caml_compare_test.res\", line 89, characters 3-10", true, Caml_obj.lessthan(/* [] */0, { - hd: 1, - tl: /* [] */0 - })); + hd: 1, + tl: /* [] */0 +})); eq("File \"caml_compare_test.res\", line 90, characters 3-10", false, Caml_obj.greaterthan(undefined, 1)); eq("File \"caml_compare_test.res\", line 91, characters 3-10", false, Caml_obj.greaterthan(undefined, [ - 1, - 30 - ])); + 1, + 30 +])); eq("File \"caml_compare_test.res\", line 92, characters 3-10", false, Caml_obj.lessthan([ - 1, - 30 - ], undefined)); + 1, + 30 +], undefined)); Mt.from_pair_suites("Caml_compare_test", suites.contents); diff --git a/jscomp/test/caml_format_test.js b/jscomp/test/caml_format_test.js index 1668aef977..ce1fce3b8c 100644 --- a/jscomp/test/caml_format_test.js +++ b/jscomp/test/caml_format_test.js @@ -80,25 +80,25 @@ var of_string = [ function from_float_of_string(xs) { return $$Array.mapi((function (i, param) { - return Pervasives.string_of_float; - }), xs); + return Pervasives.string_of_float; + }), xs); } function from_of_string(xs) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.int_of_string(b), - _1: a - }; - }) - ]; - }), of_string)); + var b = param[1]; + var a = param[0]; + return [ + "of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.int_of_string(b), + _1: a + }; + }) + ]; + }), of_string)); } var to_str = Caml_format.int_of_string; @@ -142,69 +142,69 @@ var pairs$1 = [ ]; var suites = Pervasives.$at(from_of_string(of_string), Pervasives.$at({ - hd: [ - "isnan_of_string", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" - }; - }) - ], - tl: /* [] */0 - }, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "infinity_of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: Pervasives.classify_float(Caml_format.float_of_string(b)) - }; - }) - ]; - }), pairs)), Pervasives.$at({ - hd: [ - "throw", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_format.float_of_string(""); - }) - }; - }) - ], - tl: { - hd: [ - "format_int", - (function (param) { - return { - TAG: "Eq", - _0: " 33", - _1: Caml_format.format_int("%32d", 33) - }; - }) - ], - tl: /* [] */0 - } - }, $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "normal_float_of_string " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: Caml_format.float_of_string(b) - }; - }) - ]; - }), pairs$1)))))); + hd: [ + "isnan_of_string", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: Pervasives.classify_float(Caml_format.float_of_string("nan")) === "FP_nan" + }; + }) + ], + tl: /* [] */0 +}, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "infinity_of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: Pervasives.classify_float(Caml_format.float_of_string(b)) + }; + }) + ]; +}), pairs)), Pervasives.$at({ + hd: [ + "throw", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_format.float_of_string(""); + }) + }; + }) + ], + tl: { + hd: [ + "format_int", + (function (param) { + return { + TAG: "Eq", + _0: " 33", + _1: Caml_format.format_int("%32d", 33) + }; + }) + ], + tl: /* [] */0 + } +}, $$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "normal_float_of_string " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: Caml_format.float_of_string(b) + }; + }) + ]; +}), pairs$1)))))); function ff(param) { return Caml_format.format_int("%32d", param); @@ -321,41 +321,41 @@ var float_data = [ var int64_suites_0 = [ "i64_simple7", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - 0, - 3333 - ]), - _1: "3333" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string([ + 0, + 3333 + ]), + _1: "3333" + }; + }) ]; var int64_suites_1 = { hd: [ "i64_simple15", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string(Caml_int64.neg_one), - _1: "-1" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string(Caml_int64.neg_one), + _1: "-1" + }; + }) ], tl: { hd: [ "i64_simple16", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_string([ - -1, - 4294956185 - ]), - _1: "-11111" - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_string([ + -1, + 4294956185 + ]), + _1: "-11111" + }; + }) ], tl: /* [] */0 } @@ -424,33 +424,33 @@ var of_string_data = [ ]; Mt.from_pair_suites("Caml_format_test", Pervasives.$at(suites, Pervasives.$at($$Array.to_list($$Array.mapi((function (i, param) { - var str_result = param[2]; - var f = param[1]; - var fmt = param[0]; - return [ - "loat_format " + String(i), - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.format_float(fmt, f), - _1: str_result - }; - }) - ]; - }), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "int64_of_string " + String(i) + " ", - (function (param) { - return { - TAG: "Eq", - _0: Caml_format.int64_of_string(b), - _1: a - }; - }) - ]; - }), of_string_data)))))); + var str_result = param[2]; + var f = param[1]; + var fmt = param[0]; + return [ + "loat_format " + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.format_float(fmt, f), + _1: str_result + }; + }) + ]; +}), float_data)), Pervasives.$at(int64_suites, $$Array.to_list($$Array.mapi((function (i, param) { + var b = param[1]; + var a = param[0]; + return [ + "int64_of_string " + String(i) + " ", + (function (param) { + return { + TAG: "Eq", + _0: Caml_format.int64_of_string(b), + _1: a + }; + }) + ]; +}), of_string_data)))))); var float_suites = { hd: "float_nan", diff --git a/jscomp/test/chain_code_test.js b/jscomp/test/chain_code_test.js index 6426eff2c5..e5524db491 100644 --- a/jscomp/test/chain_code_test.js +++ b/jscomp/test/chain_code_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -53,12 +53,12 @@ function f4(h, x, y) { } eq("File \"chain_code_test.res\", line 24, characters 12-19", 32, ({ - x: { - y: { - z: 32 - } - } - }).x.y.z); + x: { + y: { + z: 32 + } + } +}).x.y.z); Mt.from_pair_suites("Chain_code_test", suites.contents); diff --git a/jscomp/test/chn_test.js b/jscomp/test/chn_test.js index 8ba5ca93f9..cb8977688b 100644 --- a/jscomp/test/chn_test.js +++ b/jscomp/test/chn_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -36,65 +36,63 @@ console.log("\x3f\u003f\b\t\n\v\f\r\0\"'"); function convert(s) { return $$Array.to_list(Array.from(s, (function (x) { - var x$1 = x.codePointAt(0); - if (x$1 !== undefined) { - return x$1; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "chn_test.res", - 17, - 14 - ], - Error: new Error() - }; - }))); + var x$1 = x.codePointAt(0); + if (x$1 !== undefined) { + return x$1; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "chn_test.res", + 17, + 14 + ], + Error: new Error() + }; + }))); } eq("File \"chn_test.res\", line 24, characters 4-11", "你好,\n世界", "你好,\n世界"); eq("File \"chn_test.res\", line 30, characters 4-11", convert("汉字是世界上最美丽的character"), { - hd: 27721, + hd: 27721, + tl: { + hd: 23383, + tl: { + hd: 26159, tl: { - hd: 23383, + hd: 19990, tl: { - hd: 26159, + hd: 30028, tl: { - hd: 19990, + hd: 19978, tl: { - hd: 30028, + hd: 26368, tl: { - hd: 19978, + hd: 32654, tl: { - hd: 26368, + hd: 20029, tl: { - hd: 32654, + hd: 30340, tl: { - hd: 20029, + hd: 99, tl: { - hd: 30340, + hd: 104, tl: { - hd: 99, + hd: 97, tl: { - hd: 104, + hd: 114, tl: { hd: 97, tl: { - hd: 114, + hd: 99, tl: { - hd: 97, + hd: 116, tl: { - hd: 99, + hd: 101, tl: { - hd: 116, - tl: { - hd: 101, - tl: { - hd: 114, - tl: /* [] */0 - } - } + hd: 114, + tl: /* [] */0 } } } @@ -111,78 +109,80 @@ eq("File \"chn_test.res\", line 30, characters 4-11", convert("汉字是世界 } } } - }); + } + } +}); eq("File \"chn_test.res\", line 54, characters 5-12", convert("\x3f\x3fa"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 55, characters 5-12", convert("??a"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 56, characters 5-12", convert("\u003f\x3fa"), { - hd: 63, - tl: { - hd: 63, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 63, + tl: { + hd: 63, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 57, characters 5-12", convert("🚀🚀a"), { - hd: 128640, - tl: { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("File \"chn_test.res\", line 58, characters 5-12", convert("\uD83D\uDE80a"), { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 59, characters 5-12", convert("\uD83D\uDE80\x3f"), { - hd: 128640, - tl: { - hd: 63, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 63, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 63, characters 5-12", convert("\uD83D\uDE80\uD83D\uDE80a"), { - hd: 128640, - tl: { - hd: 128640, - tl: { - hd: 97, - tl: /* [] */0 - } - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: { + hd: 97, + tl: /* [] */0 + } + } +}); eq("No inline string length", "\uD83D\uDE80\0".length, 3); @@ -191,71 +191,69 @@ eq("File \"chn_test.res\", line 70, characters 4-11", Caml_string.get("\uD83D\uD eq("File \"chn_test.res\", line 75, characters 5-12", Caml_string.get("🚀", 0), 128640); eq("File \"chn_test.res\", line 80, characters 5-12", convert("\uD83D\uDE80"), { - hd: 128640, - tl: /* [] */0 - }); + hd: 128640, + tl: /* [] */0 +}); eq("File \"chn_test.res\", line 81, characters 5-12", convert("\uD83D\uDE80\uD83D\uDE80"), { - hd: 128640, - tl: { - hd: 128640, - tl: /* [] */0 - } - }); + hd: 128640, + tl: { + hd: 128640, + tl: /* [] */0 + } +}); eq("File \"chn_test.res\", line 82, characters 5-12", convert(" \b\t\n\v\f\ra"), { - hd: 32, + hd: 32, + tl: { + hd: 8, + tl: { + hd: 9, tl: { - hd: 8, + hd: 10, tl: { - hd: 9, + hd: 11, tl: { - hd: 10, + hd: 12, tl: { - hd: 11, + hd: 13, tl: { - hd: 12, - tl: { - hd: 13, - tl: { - hd: 97, - tl: /* [] */0 - } - } + hd: 97, + tl: /* [] */0 } } } } } - }); + } + } +}); eq("File \"chn_test.res\", line 89, characters 4-11", convert(" \b\t\n\v\f\r\"'\\\0a"), { - hd: 32, + hd: 32, + tl: { + hd: 8, + tl: { + hd: 9, tl: { - hd: 8, + hd: 10, tl: { - hd: 9, + hd: 11, tl: { - hd: 10, + hd: 12, tl: { - hd: 11, + hd: 13, tl: { - hd: 12, + hd: 34, tl: { - hd: 13, + hd: 39, tl: { - hd: 34, + hd: 92, tl: { - hd: 39, + hd: 0, tl: { - hd: 92, - tl: { - hd: 0, - tl: { - hd: 97, - tl: /* [] */0 - } - } + hd: 97, + tl: /* [] */0 } } } @@ -265,7 +263,9 @@ eq("File \"chn_test.res\", line 89, characters 4-11", convert(" \b\t\n\v\f\r\"'\ } } } - }); + } + } +}); Mt.from_pair_suites("Chn_test", suites.contents); diff --git a/jscomp/test/class_type_ffi_test.js b/jscomp/test/class_type_ffi_test.js index 7a8378e774..8718f0bf7b 100644 --- a/jscomp/test/class_type_ffi_test.js +++ b/jscomp/test/class_type_ffi_test.js @@ -17,38 +17,38 @@ function ff2(fn, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { function off2(o, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { return Curry.app(o.huge_method, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11, + a12 + ]); } function mk_f(param) { return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12) { return Curry.app(a0, [ - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ]); + a1, + a2, + a3, + a4, + a5, + a6, + a7, + a8, + a9, + a10, + a11, + a12 + ]); }; } diff --git a/jscomp/test/coercion_module_alias_test.js b/jscomp/test/coercion_module_alias_test.js index e24071e3e2..39ca005025 100644 --- a/jscomp/test/coercion_module_alias_test.js +++ b/jscomp/test/coercion_module_alias_test.js @@ -29,8 +29,8 @@ var f = List.length; function g(x) { return List.length(List.map((function (prim) { - return prim + 1 | 0; - }), x)); + return prim + 1 | 0; + }), x)); } function F(X) { diff --git a/jscomp/test/complex_if_test.js b/jscomp/test/complex_if_test.js index 9caa9348f2..b9b4150424 100644 --- a/jscomp/test/complex_if_test.js +++ b/jscomp/test/complex_if_test.js @@ -125,12 +125,12 @@ function string_escaped(s) { var suites_0 = [ "complete_escape", (function (param) { - return { - TAG: "Eq", - _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), - _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" - }; - }) + return { + TAG: "Eq", + _0: Bytes.to_string(escaped(Bytes.of_string("\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"))), + _1: "\\000\\001\\002\\003\\004\\005\\006\\007\\b\\t\\n\\011\\012\\r\\014\\015\\016\\017\\018\\019\\020\\021\\022\\023\\024\\025\\026\\027\\028\\029\\030\\031 !\\\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\127\\128\\129\\130\\131\\132\\133\\134\\135\\136\\137\\138\\139\\140\\141\\142\\143\\144\\145\\146\\147\\148\\149\\150\\151\\152\\153\\154\\155\\156\\157\\158\\159\\160\\161\\162\\163\\164\\165\\166\\167\\168\\169\\170\\171\\172\\173\\174\\175\\176\\177\\178\\179\\180\\181\\182\\183\\184\\185\\186\\187\\188\\189\\190\\191\\192\\193\\194\\195\\196\\197\\198\\199\\200\\201\\202\\203\\204\\205\\206\\207\\208\\209\\210\\211\\212\\213\\214\\215\\216\\217\\218\\219\\220\\221\\222\\223\\224\\225\\226\\227\\228\\229\\230\\231\\232\\233\\234\\235\\236\\237\\238\\239\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249\\250\\251\\252\\253\\254\\255" + }; + }) ]; var suites = { diff --git a/jscomp/test/complex_test.js b/jscomp/test/complex_test.js index 241a7ec060..27bd84a692 100644 --- a/jscomp/test/complex_test.js +++ b/jscomp/test/complex_test.js @@ -7,15 +7,15 @@ var Complex = require("../../lib/js/complex.js"); var suites_0 = [ "basic_add", (function (param) { - return { - TAG: "Eq", - _0: { - re: 2, - im: 2 - }, - _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) - }; - }) + return { + TAG: "Eq", + _0: { + re: 2, + im: 2 + }, + _1: Complex.add(Complex.add(Complex.add(Complex.one, Complex.one), Complex.i), Complex.i) + }; + }) ]; var suites = { diff --git a/jscomp/test/complex_while_loop.js b/jscomp/test/complex_while_loop.js index 6c78cb287e..b9da0bebc9 100644 --- a/jscomp/test/complex_while_loop.js +++ b/jscomp/test/complex_while_loop.js @@ -5,15 +5,15 @@ function f(param) { var n = 0; while((function () { - var fib = function (x) { - if (x === 0 || x === 1) { - return 1; - } else { - return fib(x - 1 | 0) + fib(x - 2 | 0) | 0; - } - }; - return fib(n) > 10; - })()) { + var fib = function (x) { + if (x === 0 || x === 1) { + return 1; + } else { + return fib(x - 1 | 0) + fib(x - 2 | 0) | 0; + } + }; + return fib(n) > 10; + })()) { console.log(String(n)); n = n + 1 | 0; }; @@ -21,9 +21,9 @@ function f(param) { function ff(param) { while((function () { - var b = 9; - return (3 + b | 0) > 10; - })()) { + var b = 9; + return (3 + b | 0) > 10; + })()) { }; } diff --git a/jscomp/test/condition_compilation_test.js b/jscomp/test/condition_compilation_test.js index 85303505be..97dbb21326 100644 --- a/jscomp/test/condition_compilation_test.js +++ b/jscomp/test/condition_compilation_test.js @@ -25,12 +25,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/const_block_test.js b/jscomp/test/const_block_test.js index 9d745068f7..0bcd4bdffb 100644 --- a/jscomp/test/const_block_test.js +++ b/jscomp/test/const_block_test.js @@ -58,21 +58,21 @@ var suites_1 = { hd: [ "avoid_mutable_inline_test", (function (param) { - Caml_array.set(c, 0, 3); - Caml_array.set(c, 1, 4); - return { - TAG: "Eq", - _0: [ - 3, - 4, - 2, - 3, - 4, - 5 - ], - _1: c - }; - }) + Caml_array.set(c, 0, 3); + Caml_array.set(c, 1, 4); + return { + TAG: "Eq", + _0: [ + 3, + 4, + 2, + 3, + 4, + 5 + ], + _1: c + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/cps_test.js b/jscomp/test/cps_test.js index 24b2caf6df..c546f32027 100644 --- a/jscomp/test/cps_test.js +++ b/jscomp/test/cps_test.js @@ -28,8 +28,8 @@ function test(param) { }; }; f(10, (function (param) { - - })); + + })); return v.contents; } @@ -38,18 +38,18 @@ function test_closure(param) { contents: 0 }; var arr = Caml_array.make(6, (function (x) { - return x; - })); + return x; + })); for(var i = 0; i <= 5; ++i){ Caml_array.set(arr, i, (function(i){ - return function (param) { - return i; - } - }(i))); + return function (param) { + return i; + } + }(i))); } $$Array.iter((function (i) { - v.contents = v.contents + Curry._1(i, 0) | 0; - }), arr); + v.contents = v.contents + Curry._1(i, 0) | 0; + }), arr); return v.contents; } @@ -58,59 +58,59 @@ function test_closure2(param) { contents: 0 }; var arr = Caml_array.make(6, (function (x) { - return x; - })); + return x; + })); for(var i = 0; i <= 5; ++i){ var j = i + i | 0; Caml_array.set(arr, i, (function(j){ - return function (param) { - return j; - } - }(j))); + return function (param) { + return j; + } + }(j))); } $$Array.iter((function (i) { - v.contents = v.contents + Curry._1(i, 0) | 0; - }), arr); + v.contents = v.contents + Curry._1(i, 0) | 0; + }), arr); return v.contents; } Mt.from_pair_suites("Cps_test", { + hd: [ + "cps_test_sum", + (function (param) { + return { + TAG: "Eq", + _0: 55, + _1: test() + }; + }) + ], + tl: { + hd: [ + "cps_test_closure", + (function (param) { + return { + TAG: "Eq", + _0: 15, + _1: test_closure() + }; + }) + ], + tl: { hd: [ - "cps_test_sum", + "cps_test_closure2", (function (param) { - return { - TAG: "Eq", - _0: 55, - _1: test() - }; - }) + return { + TAG: "Eq", + _0: 30, + _1: test_closure2() + }; + }) ], - tl: { - hd: [ - "cps_test_closure", - (function (param) { - return { - TAG: "Eq", - _0: 15, - _1: test_closure() - }; - }) - ], - tl: { - hd: [ - "cps_test_closure2", - (function (param) { - return { - TAG: "Eq", - _0: 30, - _1: test_closure2() - }; - }) - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); exports.test = test; exports.test_closure = test_closure; diff --git a/jscomp/test/debugger_test.js b/jscomp/test/debugger_test.js index 9aa9f45d9e..50a479929b 100644 --- a/jscomp/test/debugger_test.js +++ b/jscomp/test/debugger_test.js @@ -4,9 +4,9 @@ function f(x, y) { console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } diff --git a/jscomp/test/demo_page.js b/jscomp/test/demo_page.js index c6c41a8732..b1d0047364 100644 --- a/jscomp/test/demo_page.js +++ b/jscomp/test/demo_page.js @@ -42,12 +42,12 @@ function f(param) { } ReactDom.render(React.createClass({ - render: (function (param) { - return React.DOM.div({ - alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); - }) - }), document.getElementById("hi")); + render: (function (param) { + return React.DOM.div({ + alt: "pic" + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!")); + }) +}), document.getElementById("hi")); exports.fib = fib; exports.sum = sum; diff --git a/jscomp/test/demo_pipe.js b/jscomp/test/demo_pipe.js index 17e2e570be..0159fe6a0a 100644 --- a/jscomp/test/demo_pipe.js +++ b/jscomp/test/demo_pipe.js @@ -4,10 +4,10 @@ function register(rl) { return rl.on("line", (function (x) { - console.log(x); - })).on("close", (function (param) { - console.log("finished"); - })); + console.log(x); + })).on("close", (function (param) { + console.log("finished"); + })); } exports.register = register; diff --git a/jscomp/test/digest_test.js b/jscomp/test/digest_test.js index 58ba5c30ba..57ff64e773 100644 --- a/jscomp/test/digest_test.js +++ b/jscomp/test/digest_test.js @@ -146,89 +146,89 @@ var ref = [ ]; Mt.from_pair_suites("Digest_test", Pervasives.$at({ + hd: [ + "File \"digest_test.res\", line 9, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("value")), + _1: "2063c1608d6e0baf80249c42e2be5804" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 11, characters 10-17", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), + _1: "9e107d9d372bb6826bd81d3542a419d6" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 18, characters 10-17", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), + _1: "e4d909c290d0fb1ca068ffaddf22cbd0" + }; + }) + ], + tl: { + hd: [ + "File \"digest_test.res\", line 24, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("")), + _1: "d41d8cd98f00b204e9800998ecf8427e" + }; + }) + ], + tl: { hd: [ - "File \"digest_test.res\", line 9, characters 9-16", + "File \"digest_test.res\", line 26, characters 10-17", (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("value")), - _1: "2063c1608d6e0baf80249c42e2be5804" - }; - }) + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "7065cc36bba1d155fb09f9d02f22e8bf" + }; + }) ], tl: { hd: [ - "File \"digest_test.res\", line 11, characters 10-17", + "File \"digest_test.res\", line 45, characters 10-17", (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog")), - _1: "9e107d9d372bb6826bd81d3542a419d6" - }; - }) + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), + _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" + }; + }) ], - tl: { - hd: [ - "File \"digest_test.res\", line 18, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.")), - _1: "e4d909c290d0fb1ca068ffaddf22cbd0" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 24, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("")), - _1: "d41d8cd98f00b204e9800998ecf8427e" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 26, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "7065cc36bba1d155fb09f9d02f22e8bf" - }; - }) - ], - tl: { - hd: [ - "File \"digest_test.res\", line 45, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.")), - _1: "b9193d1df4b7a8f0a25ffdd1005c5b2b" - }; - }) - ], - tl: /* [] */0 - } - } - } - } + tl: /* [] */0 } - }, $$Array.to_list($$Array.map((function (i) { - return [ - String(i), - (function (param) { - return { - TAG: "Eq", - _0: Digest.to_hex(Digest.string("a".repeat(i))), - _1: Caml_array.get(ref, i) - }; - }) - ]; - }), Ext_array_test.range(0, 129))))); + } + } + } + } +}, $$Array.to_list($$Array.map((function (i) { + return [ + String(i), + (function (param) { + return { + TAG: "Eq", + _0: Digest.to_hex(Digest.string("a".repeat(i))), + _1: Caml_array.get(ref, i) + }; + }) + ]; +}), Ext_array_test.range(0, 129))))); exports.f = f; /* Not a pure module */ diff --git a/jscomp/test/div_by_zero_test.js b/jscomp/test/div_by_zero_test.js index 2db6b2d051..a5b993cf9f 100644 --- a/jscomp/test/div_by_zero_test.js +++ b/jscomp/test/div_by_zero_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -38,82 +38,82 @@ function add(suite) { } add([ - "File \"div_by_zero_test.res\", line 11, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.div(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 11, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.div(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 12, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.mod_(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 12, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.mod_(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 13, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.div(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 13, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.div(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 14, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int32.mod_(3, 0); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 14, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int32.mod_(3, 0); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 15, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int64.div([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 15, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int64.div([ + 0, + 3 + ], Caml_int64.zero); + }) + }; + }) +]); add([ - "File \"div_by_zero_test.res\", line 16, characters 7-14", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Caml_int64.mod_([ - 0, - 3 - ], Caml_int64.zero); - }) - }; - }) - ]); + "File \"div_by_zero_test.res\", line 16, characters 7-14", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Caml_int64.mod_([ + 0, + 3 + ], Caml_int64.zero); + }) + }; + }) +]); function div(x, y) { return Caml_int32.div(x, y) + 3 | 0; diff --git a/jscomp/test/dollar_escape_test.js b/jscomp/test/dollar_escape_test.js index 33b1efe317..04aca38a5a 100644 --- a/jscomp/test/dollar_escape_test.js +++ b/jscomp/test/dollar_escape_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/earger_curry_test.js b/jscomp/test/earger_curry_test.js index 669055d1b0..01806dd556 100644 --- a/jscomp/test/earger_curry_test.js +++ b/jscomp/test/earger_curry_test.js @@ -49,14 +49,14 @@ function fold_left(f, x, a) { function f2(param) { var arr = init(30000000, (function (i) { - return i; - })); + return i; + })); var b = map((function (i) { - return i + i - 1; - }), arr); + return i + i - 1; + }), arr); var v = fold_left((function (prim0, prim1) { - return prim0 + prim1; - }), 0, b); + return prim0 + prim1; + }), 0, b); console.log(Pervasives.string_of_float(v)); } @@ -76,12 +76,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -97,12 +97,12 @@ var all_v = { function add5(a0, a1, a2, a3, a4) { console.log([ - a0, - a1, - a2, - a3, - a4 - ]); + a0, + a1, + a2, + a3, + a4 + ]); all_v.contents = { hd: v.contents, tl: all_v.contents @@ -152,24 +152,24 @@ eq("File \"earger_curry_test.res\", line 140, characters 5-12", c, 10); eq("File \"earger_curry_test.res\", line 141, characters 5-12", d, 11); eq("File \"earger_curry_test.res\", line 142, characters 5-12", all_v.contents, { - hd: 8, + hd: 8, + tl: { + hd: 8, + tl: { + hd: 6, tl: { - hd: 8, + hd: 6, tl: { - hd: 6, + hd: 4, tl: { - hd: 6, - tl: { - hd: 4, - tl: { - hd: 2, - tl: /* [] */0 - } - } + hd: 2, + tl: /* [] */0 } } } - }); + } + } +}); Mt.from_pair_suites("Earger_curry_test", suites.contents); diff --git a/jscomp/test/epsilon_test.js b/jscomp/test/epsilon_test.js index 9ac06227c7..9e710bb2e9 100644 --- a/jscomp/test/epsilon_test.js +++ b/jscomp/test/epsilon_test.js @@ -9,24 +9,24 @@ var v = (Number.EPSILON?Number.EPSILON:2.220446049250313e-16); var suites_0 = [ "epsilon", (function (param) { - return { - TAG: "Eq", - _0: Pervasives.epsilon_float, - _1: v - }; - }) + return { + TAG: "Eq", + _0: Pervasives.epsilon_float, + _1: v + }; + }) ]; var suites_1 = { hd: [ "raw_epsilon", (function (param) { - return { - TAG: "Eq", - _0: 2.220446049250313e-16, - _1: v - }; - }) + return { + TAG: "Eq", + _0: 2.220446049250313e-16, + _1: v + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/equal_exception_test.js b/jscomp/test/equal_exception_test.js index 0d92159eb5..57f9b97fe7 100644 --- a/jscomp/test/equal_exception_test.js +++ b/jscomp/test/equal_exception_test.js @@ -152,8 +152,8 @@ function eq(x) { var Not_found = /* @__PURE__ */Caml_exceptions.create("Equal_exception_test.Not_found"); if (Caml_obj.equal(e, { - RE_EXN_ID: Not_found - }) !== false) { + RE_EXN_ID: Not_found + }) !== false) { throw { RE_EXN_ID: "Assert_failure", _1: [ diff --git a/jscomp/test/es6_module_test.js b/jscomp/test/es6_module_test.js index 22c2803c3a..50c8346001 100644 --- a/jscomp/test/es6_module_test.js +++ b/jscomp/test/es6_module_test.js @@ -9,36 +9,36 @@ function length(param) { } Mt.from_pair_suites("Es6_module_test", { - hd: [ - "list_length", - (function (param) { - return { - TAG: "Eq", - _0: List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), - _1: 2 - }; - }) - ], - tl: { - hd: [ - "length", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "list_length", + (function (param) { + return { + TAG: "Eq", + _0: List.length({ + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }), + _1: 2 + }; + }) + ], + tl: { + hd: [ + "length", + (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: 3 + }; + }) + ], + tl: /* [] */0 + } +}); exports.length = length; /* Not a pure module */ diff --git a/jscomp/test/exception_alias.js b/jscomp/test/exception_alias.js index c83f4f0d39..98cc19f7fe 100644 --- a/jscomp/test/exception_alias.js +++ b/jscomp/test/exception_alias.js @@ -8,12 +8,12 @@ var a0 = { }; var b = List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); var List$1 = { compare_lengths: List.compare_lengths, diff --git a/jscomp/test/exception_raise_test.js b/jscomp/test/exception_raise_test.js index 292bbb351e..96e27358c4 100644 --- a/jscomp/test/exception_raise_test.js +++ b/jscomp/test/exception_raise_test.js @@ -135,44 +135,44 @@ var suites = { hd: [ "File \"exception_raise_test.res\", line 120, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: [ - f, - ff, - fff, - a0 - ], - _1: [ - 2, - 2, - 2, - 2 - ] - }; - }) + return { + TAG: "Eq", + _0: [ + f, + ff, + fff, + a0 + ], + _1: [ + 2, + 2, + 2, + 2 + ] + }; + }) ], tl: { hd: [ "File \"exception_raise_test.res\", line 123, characters 6-13", (function (param) { - if (a1.RE_EXN_ID === Js_exn.$$Error) { - return { - TAG: "Eq", - _0: a1._1, - _1: 2 - }; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "exception_raise_test.res", - 127, - 15 - ], - Error: new Error() + if (a1.RE_EXN_ID === Js_exn.$$Error) { + return { + TAG: "Eq", + _0: a1._1, + _1: 2 }; - }) + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "exception_raise_test.res", + 127, + 15 + ], + Error: new Error() + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/exception_rebound_err_test.js b/jscomp/test/exception_rebound_err_test.js index 17b37ccdd5..0e11e84aaa 100644 --- a/jscomp/test/exception_rebound_err_test.js +++ b/jscomp/test/exception_rebound_err_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/ext_array_test.js b/jscomp/test/ext_array_test.js index 9f29e9b5cd..0e90858fa9 100644 --- a/jscomp/test/ext_array_test.js +++ b/jscomp/test/ext_array_test.js @@ -113,8 +113,8 @@ function range(from, to_) { }; } return $$Array.init((to_ - from | 0) + 1 | 0, (function (i) { - return i + from | 0; - })); + return i + from | 0; + })); } function map2i(f, a, b) { @@ -127,8 +127,8 @@ function map2i(f, a, b) { }; } return $$Array.mapi((function (i, a) { - return Curry._3(f, i, a, b[i]); - }), a); + return Curry._3(f, i, a, b[i]); + }), a); } function tolist_aux(a, f, _i, _res) { diff --git a/jscomp/test/ext_bytes_test.js b/jscomp/test/ext_bytes_test.js index b8cf703304..3a2bd14234 100644 --- a/jscomp/test/ext_bytes_test.js +++ b/jscomp/test/ext_bytes_test.js @@ -172,16 +172,16 @@ var f = Char.chr; var a$2 = Bytes.unsafe_to_string(Bytes.init(100, f)); var b = Bytes.init(100, (function (i) { - return /* '\000' */0; - })); + return /* '\000' */0; +})); Bytes.blit_string(a$2, 10, b, 5, 10); eq("File \"ext_bytes_test.res\", line 141, characters 4-11", b, Bytes.of_string("\x00\x00\x00\x00\x00\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")); var s = Bytes.init(50000, (function (i) { - return Char.chr(i % 137); - })); + return Char.chr(i % 137); +})); var s1 = Bytes.to_string(s); diff --git a/jscomp/test/ext_filename_test.js b/jscomp/test/ext_filename_test.js index 42a2f700c2..6b1d38112a 100644 --- a/jscomp/test/ext_filename_test.js +++ b/jscomp/test/ext_filename_test.js @@ -21,8 +21,8 @@ var node_parent = ".."; var node_current = "."; var cwd = CamlinternalLazy.from_fun(function () { - return Caml_sys.sys_getcwd(); - }); + return Caml_sys.sys_getcwd(); +}); function path_as_directory(x) { if (x === "" || Ext_string_test.ends_with(x, Filename.dir_sep)) { @@ -105,8 +105,8 @@ function relative_path(file_or_dir_1, file_or_dir_2) { continue ; } return Pervasives.$at(List.map((function (param) { - return node_parent; - }), dir2), dir1); + return node_parent; + }), dir2), dir1); }; }; var ys = go(dir1, dir2); @@ -133,18 +133,18 @@ function node_relative_path(node_modules_shorten, file1, dep_file) { var len = file2.length; if (!(node_modules_shorten && v >= 0)) { return relative_path(dep_file.NAME === "File" ? ({ - NAME: "File", - VAL: absolute_path(dep_file.VAL) - }) : ({ - NAME: "Dir", - VAL: absolute_path(dep_file.VAL) - }), file1.NAME === "File" ? ({ - NAME: "File", - VAL: absolute_path(file1.VAL) - }) : ({ - NAME: "Dir", - VAL: absolute_path(file1.VAL) - })) + (node_sep + Curry._1(Filename.basename, file2)); + NAME: "File", + VAL: absolute_path(dep_file.VAL) + }) : ({ + NAME: "Dir", + VAL: absolute_path(dep_file.VAL) + }), file1.NAME === "File" ? ({ + NAME: "File", + VAL: absolute_path(file1.VAL) + }) : ({ + NAME: "Dir", + VAL: absolute_path(file1.VAL) + })) + (node_sep + Curry._1(Filename.basename, file2)); } var skip = function (_i) { while(true) { @@ -193,9 +193,9 @@ function find_package_json_dir(cwd) { } var package_dir = CamlinternalLazy.from_fun(function () { - var cwd$1 = CamlinternalLazy.force(cwd); - return find_root_filename(cwd$1, Test_literals.bsconfig_json); - }); + var cwd$1 = CamlinternalLazy.force(cwd); + return find_root_filename(cwd$1, Test_literals.bsconfig_json); +}); function module_name_of_file(file) { var s = Filename.chop_extension(Curry._1(Filename.basename, file)); @@ -268,8 +268,8 @@ function rel_normalized_absolute_path(from, to_) { var xs = xss.tl; if (!yss) { return List.fold_left((function (acc, param) { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + return Filename.concat(acc, Ext_string_test.parent_dir_lit); + }), Ext_string_test.parent_dir_lit, xs); } if (xss.hd === yss.hd) { _yss = yss.tl; @@ -277,8 +277,8 @@ function rel_normalized_absolute_path(from, to_) { continue ; } var start = List.fold_left((function (acc, param) { - return Filename.concat(acc, Ext_string_test.parent_dir_lit); - }), Ext_string_test.parent_dir_lit, xs); + return Filename.concat(acc, Ext_string_test.parent_dir_lit); + }), Ext_string_test.parent_dir_lit, xs); return List.fold_left(Filename.concat, start, yss); }; } @@ -351,8 +351,8 @@ var simple_convert_node_path_to_os_path; if (Sys.unix) { simple_convert_node_path_to_os_path = (function (x) { - return x; - }); + return x; + }); } else if (Sys.win32 || false) { simple_convert_node_path_to_os_path = Ext_string_test.replace_slash_backward; } else { diff --git a/jscomp/test/ext_list_test.js b/jscomp/test/ext_list_test.js index 52f77f37e7..f4f5606243 100644 --- a/jscomp/test/ext_list_test.js +++ b/jscomp/test/ext_list_test.js @@ -634,8 +634,8 @@ function for_all_opt(p, _x) { function fold(f, l, init) { return List.fold_left((function (acc, i) { - return Curry._2(f, i, init); - }), init, l); + return Curry._2(f, i, init); + }), init, l); } function rev_map_acc(acc, f, l) { @@ -760,8 +760,8 @@ function reduce_from_right(fn, lst) { var match = List.rev(lst); if (match) { return List.fold_left((function (x, y) { - return Curry._2(fn, y, x); - }), match.hd, match.tl); + return Curry._2(fn, y, x); + }), match.hd, match.tl); } throw { RE_EXN_ID: "Invalid_argument", diff --git a/jscomp/test/ext_string_test.js b/jscomp/test/ext_string_test.js index 8e599422eb..9256d655e1 100644 --- a/jscomp/test/ext_string_test.js +++ b/jscomp/test/ext_string_test.js @@ -56,24 +56,24 @@ function trim(s) { var i = 0; var j = s.length; while((function () { - var tmp = false; - if (i < j) { - var u = s.codePointAt(i); - tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; - } - return tmp; - })()) { + var tmp = false; + if (i < j) { + var u = s.codePointAt(i); + tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; + } + return tmp; + })()) { i = i + 1 | 0; }; var k = j - 1 | 0; while((function () { - var tmp = false; - if (k >= i) { - var u = s.codePointAt(k); - tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; - } - return tmp; - })()) { + var tmp = false; + if (k >= i) { + var u = s.codePointAt(k); + tmp = u === /* '\t' */9 || u === /* '\n' */10 || u === /* ' ' */32; + } + return tmp; + })()) { k = k - 1 | 0; }; return $$String.sub(s, i, (k - i | 0) + 1 | 0); @@ -84,19 +84,19 @@ function split(keep_empty, str, on) { return /* [] */0; } else { return split_by(keep_empty, (function (x) { - return x === on; - }), str); + return x === on; + }), str); } } function quick_split_by_ws(str) { return split_by(false, (function (x) { - if (x === /* '\t' */9 || x === /* '\n' */10) { - return true; - } else { - return x === /* ' ' */32; - } - }), str); + if (x === /* '\t' */9 || x === /* '\n' */10) { + return true; + } else { + return x === /* ' ' */32; + } + }), str); } function starts_with(s, beg) { @@ -149,8 +149,8 @@ function ends_with_then_chop(s, beg) { function check_any_suffix_case(s, suffixes) { return List.exists((function (x) { - return ends_with(s, x); - }), suffixes); + return ends_with(s, x); + }), suffixes); } function check_any_suffix_case_then_chop(s, suffixes) { @@ -444,18 +444,18 @@ function is_valid_module_file(s) { return false; } return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { - if (x >= 65) { - if (x > 96 || x < 91) { - return x < 123; - } else { - return x === 95; - } - } else if (x >= 48) { - return x < 58; - } else { - return x === 39; - } - })); + if (x >= 65) { + if (x > 96 || x < 91) { + return x < 123; + } else { + return x === 95; + } + } else if (x >= 48) { + return x < 58; + } else { + return x === 39; + } + })); } function is_valid_npm_package_name(s) { @@ -476,34 +476,34 @@ function is_valid_npm_package_name(s) { return false; } return unsafe_for_all_range(s, 1, len - 1 | 0, (function (x) { - if (x >= 58) { - if (x >= 97) { - return x < 123; - } else { - return x === 95; - } - } else if (x !== 45) { - return x >= 48; - } else { - return true; - } - })); + if (x >= 58) { + if (x >= 97) { + return x < 123; + } else { + return x === 95; + } + } else if (x !== 45) { + return x >= 48; + } else { + return true; + } + })); } function is_valid_source_name(name) { var x = check_any_suffix_case_then_chop(name, { - hd: ".ml", + hd: ".ml", + tl: { + hd: ".res", + tl: { + hd: ".mli", tl: { - hd: ".res", - tl: { - hd: ".mli", - tl: { - hd: ".resi", - tl: /* [] */0 - } - } + hd: ".resi", + tl: /* [] */0 } - }); + } + } + }); if (x !== undefined) { if (is_valid_module_file(x)) { return "Good"; @@ -569,12 +569,12 @@ function replace_slash_backward(x) { return x; } else { return $$String.map((function (x) { - if (x !== 47) { - return x; - } else { - return /* '\\' */92; - } - }), x); + if (x !== 47) { + return x; + } else { + return /* '\\' */92; + } + }), x); } } @@ -584,12 +584,12 @@ function replace_backward_slash(x) { return x; } else { return $$String.map((function (x) { - if (x !== 92) { - return x; - } else { - return /* '/' */47; - } - }), x); + if (x !== 92) { + return x; + } else { + return /* '/' */47; + } + }), x); } } diff --git a/jscomp/test/extensible_variant_test.js b/jscomp/test/extensible_variant_test.js index 578c9f165d..ca2eae284f 100644 --- a/jscomp/test/extensible_variant_test.js +++ b/jscomp/test/extensible_variant_test.js @@ -38,46 +38,46 @@ function to_int(x) { var suites_0 = [ "test_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: to_int({ - RE_EXN_ID: Int, - _1: 3, - _2: 0 - }) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: to_int({ + RE_EXN_ID: Int, + _1: 3, + _2: 0 + }) + }; + }) ]; var suites_1 = { hd: [ "test_int2", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: to_int({ - RE_EXN_ID: Int$1, - _1: 3, - _2: 0 - }) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: to_int({ + RE_EXN_ID: Int$1, + _1: 3, + _2: 0 + }) + }; + }) ], tl: { hd: [ "test_string", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: to_int({ - RE_EXN_ID: Str, - _1: "x" - }) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: to_int({ + RE_EXN_ID: Str, + _1: "x" + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ffi_arity_test.js b/jscomp/test/ffi_arity_test.js index 655c75b977..5250f2f254 100644 --- a/jscomp/test/ffi_arity_test.js +++ b/jscomp/test/ffi_arity_test.js @@ -17,28 +17,28 @@ function f(v) { } var v = [ - 1, - 2, - 3 - ].map(function (a, b) { - return f(a)(b); - }); + 1, + 2, + 3 +].map(function (a, b) { + return f(a)(b); +}); var vv = [ - 1, - 2, - 3 - ].map(function (a, b) { - return a + b | 0; - }); + 1, + 2, + 3 +].map(function (a, b) { + return a + b | 0; +}); var hh = [ - "1", - "2", - "3" - ].map(function (x) { - return parseInt(x); - }); + "1", + "2", + "3" +].map(function (x) { + return parseInt(x); +}); function u() { return 3; @@ -69,54 +69,54 @@ var abc_u = abc; fff(); Mt.from_pair_suites("Ffi_arity_test", { + hd: [ + "File \"ffi_arity_test.res\", line 51, characters 7-14", + (function (param) { + return { + TAG: "Eq", + _0: v, + _1: [ + 0, + 1, + 4 + ] + }; + }) + ], + tl: { + hd: [ + "File \"ffi_arity_test.res\", line 52, characters 7-14", + (function (param) { + return { + TAG: "Eq", + _0: vv, + _1: [ + 1, + 3, + 5 + ] + }; + }) + ], + tl: { hd: [ - "File \"ffi_arity_test.res\", line 51, characters 7-14", + "File \"ffi_arity_test.res\", line 53, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 1, - 4 - ] - }; - }) + return { + TAG: "Eq", + _0: hh, + _1: [ + 1, + 2, + 3 + ] + }; + }) ], - tl: { - hd: [ - "File \"ffi_arity_test.res\", line 52, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: vv, - _1: [ - 1, - 3, - 5 - ] - }; - }) - ], - tl: { - hd: [ - "File \"ffi_arity_test.res\", line 53, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: hh, - _1: [ - 1, - 2, - 3 - ] - }; - }) - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function bar(fn) { return Curry._1(fn, undefined); diff --git a/jscomp/test/ffi_array_test.js b/jscomp/test/ffi_array_test.js index 4bf2e61a96..d906908811 100644 --- a/jscomp/test/ffi_array_test.js +++ b/jscomp/test/ffi_array_test.js @@ -17,30 +17,30 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"ffi_array_test.res\", line 11, characters 12-19", [ - 1, - 2, - 3, - 4 - ].map(function (x) { - return x + 1 | 0; - }), [ - 2, - 3, - 4, - 5 - ]); + 1, + 2, + 3, + 4 +].map(function (x) { + return x + 1 | 0; +}), [ + 2, + 3, + 4, + 5 +]); Mt.from_pair_suites("Ffi_array_test", suites.contents); diff --git a/jscomp/test/ffi_js_test.js b/jscomp/test/ffi_js_test.js index b25a212821..e787eda018 100644 --- a/jscomp/test/ffi_js_test.js +++ b/jscomp/test/ffi_js_test.js @@ -28,12 +28,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -50,9 +50,9 @@ var string_config = { }; eq("File \"ffi_js_test.res\", line 30, characters 12-19", [ - 6, - $$higher_order(1)(2, 3) - ]); + 6, + $$higher_order(1)(2, 3) +]); var same_type_0 = { hd: int_config, @@ -82,28 +82,28 @@ var same_type = [ ]; eq("File \"ffi_js_test.res\", line 38, characters 5-12", [ - Object.keys(int_config).length, - 2 - ]); + Object.keys(int_config).length, + 2 +]); eq("File \"ffi_js_test.res\", line 39, characters 5-12", [ - Object.keys(string_config).length, - 2 - ]); + Object.keys(string_config).length, + 2 +]); var u = { contents: 3 }; var side_effect_config = (u.contents = u.contents + 1 | 0, "Int", { - hi: 3, - low: 32 - }); + hi: 3, + low: 32 +}); eq("File \"ffi_js_test.res\", line 53, characters 12-19", [ - u.contents, - 4 - ]); + u.contents, + 4 +]); function vv(z) { return z.hh(); @@ -141,9 +141,9 @@ function ffff(x) { ]; var match = x[3]; console.log([ - match[0], - match[1] - ]); + match[0], + match[1] + ]); console.log(x.getGADT); var match$1 = x.getGADT2; console.log(match$1[0], match$1[1]); diff --git a/jscomp/test/ffi_splice_test.js b/jscomp/test/ffi_splice_test.js index c82b48c80b..27500b5281 100644 --- a/jscomp/test/ffi_splice_test.js +++ b/jscomp/test/ffi_splice_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/flexible_array_test.js b/jscomp/test/flexible_array_test.js index 7f5b80995c..9f750278c3 100644 --- a/jscomp/test/flexible_array_test.js +++ b/jscomp/test/flexible_array_test.js @@ -262,11 +262,11 @@ function sort(s) { } var head = get(s, 0); var larger = sort(filter_from(1, (function (x) { - return Caml_obj.greaterthan(x, head); - }), s)); + return Caml_obj.greaterthan(x, head); + }), s)); var smaller = sort(filter_from(1, (function (x) { - return Caml_obj.lessequal(x, head); - }), s)); + return Caml_obj.lessequal(x, head); + }), s)); return append(smaller, push_front(larger, head)); } @@ -299,24 +299,24 @@ function $eq$tilde(x, y) { } var u = of_array([ - 1, - 2, - 2, - 5, - 3, - 6 - ]); + 1, + 2, + 2, + 5, + 3, + 6 +]); var x = sort(u); if (!Caml_obj.equal(x, of_array([ - 1, - 2, - 2, - 3, - 5, - 6 - ]))) { + 1, + 2, + 2, + 3, + 5, + 6 + ]))) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -329,12 +329,12 @@ if (!Caml_obj.equal(x, of_array([ } var v = $$Array.init(500, (function (i) { - return 500 - i | 0; - })); + return 500 - i | 0; +})); var y = $$Array.init(500, (function (i) { - return i + 1 | 0; - })); + return i + 1 | 0; +})); var x$1 = sort(of_array(v)); diff --git a/jscomp/test/float_of_bits_test.js b/jscomp/test/float_of_bits_test.js index ff1db3580c..8a87ef8bdc 100644 --- a/jscomp/test/float_of_bits_test.js +++ b/jscomp/test/float_of_bits_test.js @@ -26,61 +26,61 @@ var int32_pairs = [ function from_pairs(pair) { return List.concat($$Array.to_list($$Array.mapi((function (i, param) { - var f = param[1]; - var i32 = param[0]; - return { - hd: [ - "int32_float_of_bits " + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_float.int_float_of_bits(i32), - _1: f - }; - }) - ], - tl: { - hd: [ - "int32_bits_of_float " + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_float.int_bits_of_float(f), - _1: i32 - }; - }) - ], - tl: /* [] */0 - } - }; - }), int32_pairs))); -} - -var suites = Pervasives.$at({ + var f = param[1]; + var i32 = param[0]; + return { hd: [ - "one", + "int32_float_of_bits " + i, (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.bits_of_float(1.0), - _1: one_float - }; - }) + return { + TAG: "Eq", + _0: Caml_float.int_float_of_bits(i32), + _1: f + }; + }) ], tl: { hd: [ - "two", + "int32_bits_of_float " + i, (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.float_of_bits(one_float), - _1: 1.0 - }; - }) + return { + TAG: "Eq", + _0: Caml_float.int_bits_of_float(f), + _1: i32 + }; + }) ], tl: /* [] */0 } - }, from_pairs(int32_pairs)); + }; + }), int32_pairs))); +} + +var suites = Pervasives.$at({ + hd: [ + "one", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.bits_of_float(1.0), + _1: one_float + }; + }) + ], + tl: { + hd: [ + "two", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.float_of_bits(one_float), + _1: 1.0 + }; + }) + ], + tl: /* [] */0 + } +}, from_pairs(int32_pairs)); Mt.from_pair_suites("Float_of_bits_test", suites); diff --git a/jscomp/test/float_test.js b/jscomp/test/float_test.js index f8af860f88..b842335ae0 100644 --- a/jscomp/test/float_test.js +++ b/jscomp/test/float_test.js @@ -31,9 +31,9 @@ function approx(loc) { } var epsilon_float = Caml_int64.float_of_bits([ - 1018167296, - 0 - ]); + 1018167296, + 0 +]); var match = Caml_float.frexp_float(12.0); @@ -42,100 +42,100 @@ var match$1 = Caml_float.frexp_float(0); var match$2 = Caml_float.frexp_float(-12.0); var results = $$Array.append([ - [ - Math.log10(2), - 0.301029995663981198 - ], - [ - Caml_float.ldexp_float(1, 6), - 64 - ], - [ - Caml_float.ldexp_float(1, 5), - 32 - ], - [ - Caml_float.ldexp_float(1.e-5, 1024), - 1.79769313486231605e+303 - ], - [ - Caml_float.ldexp_float(1, -1024), - 5.56268464626800346e-309 - ], - [ - Caml_float.hypot_float(3, 4), - 5 - ], - [ - Caml_float.hypot_float(4, 3), - 5 - ], - [ - Caml_float.hypot_float(5, 12), - 13 - ], - [ - Caml_float.hypot_float(12, 5), - 13 - ], - [ - Caml_float.copysign_float(22.3, -1), - -22.3 - ], - [ - Caml_float.copysign_float(22.3, 1), - 22.3 - ], - [ - Caml_float.expm1_float(1e-15), - 1.00000000000000067e-15 - ], - [ - Math.log1p(1e-10), - 9.9999999995000007e-11 - ] - ], [ - [ - match$1[0], - 0 - ], - [ - match$1[1], - 0 - ], - [ - match[0], - 0.75 - ], - [ - match[1], - 4 - ], - [ - match$2[0], - -0.75 - ], - [ - match$2[1], - 4 - ] - ]); + [ + Math.log10(2), + 0.301029995663981198 + ], + [ + Caml_float.ldexp_float(1, 6), + 64 + ], + [ + Caml_float.ldexp_float(1, 5), + 32 + ], + [ + Caml_float.ldexp_float(1.e-5, 1024), + 1.79769313486231605e+303 + ], + [ + Caml_float.ldexp_float(1, -1024), + 5.56268464626800346e-309 + ], + [ + Caml_float.hypot_float(3, 4), + 5 + ], + [ + Caml_float.hypot_float(4, 3), + 5 + ], + [ + Caml_float.hypot_float(5, 12), + 13 + ], + [ + Caml_float.hypot_float(12, 5), + 13 + ], + [ + Caml_float.copysign_float(22.3, -1), + -22.3 + ], + [ + Caml_float.copysign_float(22.3, 1), + 22.3 + ], + [ + Caml_float.expm1_float(1e-15), + 1.00000000000000067e-15 + ], + [ + Math.log1p(1e-10), + 9.9999999995000007e-11 + ] +], [ + [ + match$1[0], + 0 + ], + [ + match$1[1], + 0 + ], + [ + match[0], + 0.75 + ], + [ + match[1], + 4 + ], + [ + match$2[0], + -0.75 + ], + [ + match$2[1], + 4 + ] +]); function from_pairs(ps) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[1]; - var a = param[0]; - return [ - "pair " + i, - (function (param) { - return { - TAG: "Approx", - _0: a, - _1: b - }; - }) - ]; - }), ps)); + var b = param[1]; + var a = param[0]; + return [ + "pair " + i, + (function (param) { + return { + TAG: "Approx", + _0: a, + _1: b + }; + }) + ]; + }), ps)); } var float_compare = Caml.float_compare; @@ -181,48 +181,48 @@ var generic_greaterequal = Caml_obj.greaterequal; Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 59, characters 5-12", Pervasives.classify_float(3), "FP_normal"); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 60, characters 5-12", Caml_float.modf_float(-3.125), [ - -0.125, - -3 - ]); + -0.125, + -3 +]); var match$3 = Caml_float.modf_float(Number.NaN); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 62, characters 4-11", [ - Number.isNaN(match$3[0]), - Number.isNaN(match$3[1]) - ], [ - true, - true - ]); + Number.isNaN(match$3[0]), + Number.isNaN(match$3[1]) +], [ + true, + true +]); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 71, characters 4-11", $$Array.map((function (x) { - if (x > 0) { - return 1; - } else if (x < 0) { - return -1; - } else { - return 0; - } - }), $$Array.map((function (param) { - return Caml.float_compare(param[0], param[1]); - }), [ - [ - 1, - 3 - ], - [ - 2, - 1 - ], - [ - 3, - 2 - ] - ])), [ - -1, - 1, - 1 - ]); + if (x > 0) { + return 1; + } else if (x < 0) { + return -1; + } else { + return 0; + } +}), $$Array.map((function (param) { + return Caml.float_compare(param[0], param[1]); +}), [ + [ + 1, + 3 + ], + [ + 2, + 1 + ], + [ + 3, + 2 + ] +])), [ + -1, + 1, + 1 +]); Mt_global.collect_eq(test_id, suites, "File \"float_test.res\", line 83, characters 5-12", Caml_float.copysign_float(-3, 0), 3); @@ -327,54 +327,54 @@ var b = match$4[1]; var a = match$4[0]; Mt.from_pair_suites("Float_test", Pervasives.$at({ - hd: [ - "mod_float", - (function (param) { - return { - TAG: "Approx", - _0: 3.2 % 0.5, - _1: 0.200000000000000178 - }; - }) - ], - tl: { - hd: [ - "modf_float1", - (function (param) { - return { - TAG: "Approx", - _0: a, - _1: 0.299999999999997158 - }; - }) - ], - tl: { - hd: [ - "modf_float2", - (function (param) { - return { - TAG: "Approx", - _0: b, - _1: 32 - }; - }) - ], - tl: { - hd: [ - "int_of_float", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - } - } - }, Pervasives.$at(from_pairs(results), suites.contents))); + hd: [ + "mod_float", + (function (param) { + return { + TAG: "Approx", + _0: 3.2 % 0.5, + _1: 0.200000000000000178 + }; + }) + ], + tl: { + hd: [ + "modf_float1", + (function (param) { + return { + TAG: "Approx", + _0: a, + _1: 0.299999999999997158 + }; + }) + ], + tl: { + hd: [ + "modf_float2", + (function (param) { + return { + TAG: "Approx", + _0: b, + _1: 32 + }; + }) + ], + tl: { + hd: [ + "int_of_float", + (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: 3 + }; + }) + ], + tl: /* [] */0 + } + } + } +}, Pervasives.$at(from_pairs(results), suites.contents))); exports.test_id = test_id; exports.suites = suites; diff --git a/jscomp/test/floatarray_test.js b/jscomp/test/floatarray_test.js index c8d86e139f..465e00be66 100644 --- a/jscomp/test/floatarray_test.js +++ b/jscomp/test/floatarray_test.js @@ -25,14 +25,14 @@ for(var i = 0; i <= 4; ++i){ Caml_array.set(v, 2, 15.5); eq("File \"floatarray_test.res\", line 15, characters 5-12", [ - v.length, - v[2], - Caml_array.get(v, 1) - ], [ - 5, - 15.5, - 0 - ]); + v.length, + v[2], + Caml_array.get(v, 1) +], [ + 5, + 15.5, + 0 +]); Mt.from_pair_suites("Floatarray_test", suites.contents); diff --git a/jscomp/test/for_loop_test.js b/jscomp/test/for_loop_test.js index 83ba006927..acfee78076 100644 --- a/jscomp/test/for_loop_test.js +++ b/jscomp/test/for_loop_test.js @@ -11,19 +11,19 @@ function for_3(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var j = (i << 1); Caml_array.set(arr, i, (function(j){ - return function (param) { - v.contents = v.contents + j | 0; - } - }(j))); + return function (param) { + v.contents = v.contents + j | 0; + } + }(j))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -32,20 +32,20 @@ function for_4(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var j = (i << 1); var k = (j << 1); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -54,19 +54,19 @@ function for_5(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i < i_finish; ++i){ var k = Math.imul((u << 1), u); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -75,8 +75,8 @@ function for_6(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); var v4 = { contents: 0 }; @@ -96,17 +96,17 @@ function for_6(x, u) { var h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; Caml_array.set(arr, i, (function(k,h){ - return function (param) { - v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; - } - }(k,h))); + return function (param) { + v.contents = (((((v.contents + k | 0) + v2.contents | 0) + v4.contents | 0) + v5.contents | 0) + h | 0) + u | 0; + } + }(k,h))); } }(v2)); inspect_3 = v2.contents; } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return [ v.contents, v4.contents, @@ -120,22 +120,22 @@ function for_7(param) { contents: 0 }; var arr = Caml_array.make(21, (function (param) { - - })); + + })); for(var i = 0; i <= 6; ++i){ (function(i){ for(var j = 0; j <= 2; ++j){ Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function(j){ - return function (param) { - v.contents = (v.contents + i | 0) + j | 0; - } - }(j))); + return function (param) { + v.contents = (v.contents + i | 0) + j | 0; + } + }(j))); } }(i)); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); return v.contents; } @@ -144,24 +144,24 @@ function for_8(param) { contents: 0 }; var arr = Caml_array.make(21, (function (param) { - - })); + + })); for(var i = 0; i <= 6; ++i){ var k = (i << 1); (function(i,k){ for(var j = 0; j <= 2; ++j){ var h = i + j | 0; Caml_array.set(arr, Math.imul(i, 3) + j | 0, (function(j,h){ - return function (param) { - v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; - } - }(j,h))); + return function (param) { + v.contents = (((v.contents + i | 0) + j | 0) + h | 0) + k | 0; + } + }(j,h))); } }(i,k)); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); return v.contents; } @@ -182,11 +182,11 @@ function for_9(param) { contents: 0 }; var arr = Caml_array.make(4, (function (param) { - - })); + + })); var arr2 = Caml_array.make(2, (function (param) { - - })); + + })); for(var i = 0; i <= 1; ++i){ var v$1 = { contents: 0 @@ -197,22 +197,22 @@ function for_9(param) { v$1.contents = v$1.contents + 1 | 0; collect(v$1.contents); Caml_array.set(arr, (i << 1) + j | 0, (function (param) { - vv.contents = vv.contents + v$1.contents | 0; - })); + vv.contents = vv.contents + v$1.contents | 0; + })); } }(v$1)); Caml_array.set(arr2, i, (function(v$1){ - return function (param) { - vv2.contents = vv2.contents + v$1.contents | 0; - } - }(v$1))); + return function (param) { + vv2.contents = vv2.contents + v$1.contents | 0; + } + }(v$1))); } $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr); + Curry._1(f, undefined); + }), arr); $$Array.iter((function (f) { - Curry._1(f, undefined); - }), arr2); + Curry._1(f, undefined); + }), arr2); return [[ vv.contents, $$Array.of_list(List.rev(v.contents)), @@ -223,93 +223,93 @@ function for_9(param) { var suites_0 = [ "for_loop_test_3", (function (param) { - return { - TAG: "Eq", - _0: 90, - _1: for_3(Caml_array.make(10, 2)) - }; - }) + return { + TAG: "Eq", + _0: 90, + _1: for_3(Caml_array.make(10, 2)) + }; + }) ]; var suites_1 = { hd: [ "for_loop_test_4", (function (param) { - return { - TAG: "Eq", - _0: 180, - _1: for_4(Caml_array.make(10, 2)) - }; - }) + return { + TAG: "Eq", + _0: 180, + _1: for_4(Caml_array.make(10, 2)) + }; + }) ], tl: { hd: [ "for_loop_test_5", (function (param) { - return { - TAG: "Eq", - _0: 2420, - _1: for_5(Caml_array.make(10, 2), 11) - }; - }) + return { + TAG: "Eq", + _0: 2420, + _1: for_5(Caml_array.make(10, 2), 11) + }; + }) ], tl: { hd: [ "for_loop_test_6", (function (param) { - return { - TAG: "Eq", - _0: [ - 30, - 1, - 2, - 3 - ], - _1: for_6(Caml_array.make(3, 0), 0) - }; - }) + return { + TAG: "Eq", + _0: [ + 30, + 1, + 2, + 3 + ], + _1: for_6(Caml_array.make(3, 0), 0) + }; + }) ], tl: { hd: [ "for_loop_test_7", (function (param) { - return { - TAG: "Eq", - _0: 84, - _1: for_7() - }; - }) + return { + TAG: "Eq", + _0: 84, + _1: for_7() + }; + }) ], tl: { hd: [ "for_loop_test_8", (function (param) { - return { - TAG: "Eq", - _0: 294, - _1: for_8() - }; - }) + return { + TAG: "Eq", + _0: 294, + _1: for_8() + }; + }) ], tl: { hd: [ "for_loop_test_9", (function (param) { - return { - TAG: "Eq", - _0: [[ - 10, - [ - 1, - 2, - 2, - 3 - ], - 5 - ]], - _1: for_9() - }; - }) + return { + TAG: "Eq", + _0: [[ + 10, + [ + 1, + 2, + 2, + 3 + ], + 5 + ]], + _1: for_9() + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/for_side_effect_test.js b/jscomp/test/for_side_effect_test.js index 8e0ed3cb60..821bd79b79 100644 --- a/jscomp/test/for_side_effect_test.js +++ b/jscomp/test/for_side_effect_test.js @@ -22,12 +22,12 @@ function test2(param) { var suites_0 = [ "for_order", (function (param) { - return { - TAG: "Eq", - _0: 10, - _1: test2() - }; - }) + return { + TAG: "Eq", + _0: 10, + _1: test2() + }; + }) ]; var suites = { diff --git a/jscomp/test/format_test.js b/jscomp/test/format_test.js index e3602f80fe..041603ffc7 100644 --- a/jscomp/test/format_test.js +++ b/jscomp/test/format_test.js @@ -21,12 +21,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -78,29 +78,29 @@ eq("File \"format_test.res\", line 46, characters 5-12", (1 + 65535 / 65536) * 8 function f(loc, ls) { List.iter((function (param) { - eq(loc, Caml_format.float_of_string(param[0]), param[1]); - }), ls); + eq(loc, Caml_format.float_of_string(param[0]), param[1]); + }), ls); } f("File \"format_test.res\", line 53, characters 11-18", { + hd: [ + "0x3.fp+1", + 7.875 + ], + tl: { + hd: [ + " 0x3.fp2", + 15.75 + ], + tl: { hd: [ - "0x3.fp+1", - 7.875 + " 0x4.fp2", + 19.75 ], - tl: { - hd: [ - " 0x3.fp2", - 15.75 - ], - tl: { - hd: [ - " 0x4.fp2", - 19.75 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function sl(f) { return Caml_format.hexstring_of_float(f, -1, /* '-' */45); @@ -108,8 +108,8 @@ function sl(f) { function aux_list(loc, ls) { List.iter((function (param) { - eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); - }), ls); + eq(loc, Caml_format.hexstring_of_float(param[0], -1, /* '-' */45), param[1]); + }), ls); } var literals_0 = [ @@ -187,8 +187,8 @@ scan_float("File \"format_test.res\", line 80, characters 13-20", "0x3f.p1", 126 scan_float("File \"format_test.res\", line 81, characters 13-20", "0x1.3333333333333p-2", 0.3); List.iter((function (param) { - scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); - }), literals); + scan_float("File \"format_test.res\", line 82, characters 35-42", param[1], param[0]); +}), literals); var f1 = - -9.9; diff --git a/jscomp/test/fun_pattern_match.js b/jscomp/test/fun_pattern_match.js index 2b143273d3..dd57ac1a15 100644 --- a/jscomp/test/fun_pattern_match.js +++ b/jscomp/test/fun_pattern_match.js @@ -85,9 +85,9 @@ function handle_tuple(x, y) { return 2; } console.log([ - x, - y - ]); + x, + y + ]); return x + y | 0; } diff --git a/jscomp/test/functor_app_test.js b/jscomp/test/functor_app_test.js index 2de9a59f61..6305fc7ab7 100644 --- a/jscomp/test/functor_app_test.js +++ b/jscomp/test/functor_app_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/functors.js b/jscomp/test/functors.js index f1487cdd44..cd42b3af76 100644 --- a/jscomp/test/functors.js +++ b/jscomp/test/functors.js @@ -49,13 +49,13 @@ function F2(X, Y) { var M = { F: (function (funarg, funarg$1) { - var sheep = function (x) { - return 1 + Curry._1(funarg$1.foo, Curry._1(funarg.foo, x)) | 0; - }; - return { - sheep: sheep - }; - }) + var sheep = function (x) { + return 1 + Curry._1(funarg$1.foo, Curry._1(funarg.foo, x)) | 0; + }; + return { + sheep: sheep + }; + }) }; exports.O = O; diff --git a/jscomp/test/genlex_test.js b/jscomp/test/genlex_test.js index 6c043ca4ce..3fcefd3b65 100644 --- a/jscomp/test/genlex_test.js +++ b/jscomp/test/genlex_test.js @@ -8,30 +8,30 @@ var Stream = require("../../lib/js/stream.js"); var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); var lexer = Genlex.make_lexer({ - hd: "+", + hd: "+", + tl: { + hd: "-", + tl: { + hd: "*", tl: { - hd: "-", + hd: "/", tl: { - hd: "*", + hd: "let", tl: { - hd: "/", + hd: "=", tl: { - hd: "let", + hd: "(", tl: { - hd: "=", - tl: { - hd: "(", - tl: { - hd: ")", - tl: /* [] */0 - } - } + hd: ")", + tl: /* [] */0 } } } } } - }); + } + } +}); function to_list(s) { var _acc = /* [] */0; @@ -59,54 +59,54 @@ function to_list(s) { var suites_0 = [ "lexer_stream_genlex", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: { + TAG: "Int", + _0: 3 + }, + tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "(" }, tl: { hd: { - TAG: "Kwd", - _0: "(" + TAG: "Int", + _0: 3 }, tl: { hd: { - TAG: "Int", - _0: 3 + TAG: "Kwd", + _0: "+" }, tl: { hd: { - TAG: "Kwd", - _0: "+" + TAG: "Int", + _0: 2 }, tl: { hd: { TAG: "Int", - _0: 2 + _0: -1 }, tl: { hd: { - TAG: "Int", - _0: -1 + TAG: "Kwd", + _0: ")" }, - tl: { - hd: { - TAG: "Kwd", - _0: ")" - }, - tl: /* [] */0 - } + tl: /* [] */0 } } } } } - }, - _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) - }; - }) + } + }, + _1: to_list(lexer(Stream.of_string("3(3 + 2 -1)"))) + }; + }) ]; var suites = { diff --git a/jscomp/test/global_exception_regression_test.js b/jscomp/test/global_exception_regression_test.js index efabf98f12..22b914151a 100644 --- a/jscomp/test/global_exception_regression_test.js +++ b/jscomp/test/global_exception_regression_test.js @@ -18,24 +18,24 @@ var s = { var suites_0 = [ "not_found_equal", (function (param) { - return { - TAG: "Eq", - _0: u, - _1: v - }; - }) + return { + TAG: "Eq", + _0: u, + _1: v + }; + }) ]; var suites_1 = { hd: [ "not_found_not_equal_end_of_file", (function (param) { - return { - TAG: "Neq", - _0: u, - _1: s - }; - }) + return { + TAG: "Neq", + _0: u, + _1: s + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/global_module_alias_test.js b/jscomp/test/global_module_alias_test.js index 31d17ca13a..34ecd12089 100644 --- a/jscomp/test/global_module_alias_test.js +++ b/jscomp/test/global_module_alias_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -52,12 +52,12 @@ function f(param) { } eq("File \"global_module_alias_test.res\", line 48, characters 12-19", List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); v.contents = v.contents + 1 | 0; @@ -89,18 +89,18 @@ eq("File \"global_module_alias_test.res\", line 52, characters 12-19", v.content function g(param) { return List.length({ - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - }); + } + } + }); } function xx(param) { @@ -115,27 +115,27 @@ eq("File \"global_module_alias_test.res\", line 80, characters 12-19", g(), 4); var V = xx(); eq("File \"global_module_alias_test.res\", line 84, characters 5-12", Curry._1(V.length, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }), 3); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}), 3); eq("File \"global_module_alias_test.res\", line 85, characters 5-12", v.contents, 15); var H$1 = f(); eq("File \"global_module_alias_test.res\", line 87, characters 5-12", Curry._1(H$1.length, { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }), 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}), 2); eq("File \"global_module_alias_test.res\", line 88, characters 5-12", v.contents, 21); diff --git a/jscomp/test/google_closure_test.js b/jscomp/test/google_closure_test.js index 0083eab47a..254ae291cb 100644 --- a/jscomp/test/google_closure_test.js +++ b/jscomp/test/google_closure_test.js @@ -5,28 +5,28 @@ var Mt = require("./mt.js"); var Test_google_closure = require("./test_google_closure.js"); Mt.from_pair_suites("Closure", { - hd: [ - "partial", - (function (param) { - return { - TAG: "Eq", - _0: [ - Test_google_closure.a, - Test_google_closure.b, - Test_google_closure.c - ], - _1: [ - "3", - 101, - [ - 1, - 2 - ] - ] - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "partial", + (function (param) { + return { + TAG: "Eq", + _0: [ + Test_google_closure.a, + Test_google_closure.b, + Test_google_closure.c + ], + _1: [ + "3", + 101, + [ + 1, + 2 + ] + ] + }; + }) + ], + tl: /* [] */0 +}); /* Not a pure module */ diff --git a/jscomp/test/gpr496_test.js b/jscomp/test/gpr496_test.js index 6fd8217bc7..afc9f6e9d3 100644 --- a/jscomp/test/gpr496_test.js +++ b/jscomp/test/gpr496_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1154_test.js b/jscomp/test/gpr_1154_test.js index 7ccf80d051..87e2a46b10 100644 --- a/jscomp/test/gpr_1154_test.js +++ b/jscomp/test/gpr_1154_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1409_test.js b/jscomp/test/gpr_1409_test.js index 51a334deb7..5c1c015870 100644 --- a/jscomp/test/gpr_1409_test.js +++ b/jscomp/test/gpr_1409_test.js @@ -21,12 +21,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -47,8 +47,8 @@ function map(f, x) { function make(foo) { var partial_arg = map((function (prim) { - return String(prim); - }), foo); + return String(prim); + }), foo); return function (param) { var tmp = {}; if (partial_arg !== undefined) { @@ -139,28 +139,28 @@ function keys(xs, ys) { } eq("File \"gpr_1409_test.res\", line 69, characters 3-10", keys({ - hd: "hi", - tl: /* [] */0 - }, Object.keys(test3(undefined, undefined))), true); + hd: "hi", + tl: /* [] */0 +}, Object.keys(test3(undefined, undefined))), true); eq("File \"gpr_1409_test.res\", line 71, characters 3-10", keys({ - hd: "hi", - tl: { - hd: "_open", - tl: /* [] */0 - } - }, Object.keys(test3(2, undefined))), true); + hd: "hi", + tl: { + hd: "_open", + tl: /* [] */0 + } +}, Object.keys(test3(2, undefined))), true); eq("File \"gpr_1409_test.res\", line 73, characters 3-10", keys({ - hd: "hi", - tl: { - hd: "_open", - tl: { - hd: "xx__hi", - tl: /* [] */0 - } - } - }, Object.keys(test3(2, 2))), true); + hd: "hi", + tl: { + hd: "_open", + tl: { + hd: "xx__hi", + tl: /* [] */0 + } + } +}, Object.keys(test3(2, 2))), true); Mt.from_pair_suites("Gpr_1409_test", suites.contents); diff --git a/jscomp/test/gpr_1423_app_test.js b/jscomp/test/gpr_1423_app_test.js index f4af92b57b..4cfc400ade 100644 --- a/jscomp/test/gpr_1423_app_test.js +++ b/jscomp/test/gpr_1423_app_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -35,10 +35,10 @@ function foo(f) { } foo(function (param) { - return function (param$1) { - return Gpr_1423_nav.busted(param, "a2", param$1); - }; - }); + return function (param$1) { + return Gpr_1423_nav.busted(param, "a2", param$1); + }; +}); function foo2(f) { return Curry._2(f, "a1", undefined); diff --git a/jscomp/test/gpr_1503_test.js b/jscomp/test/gpr_1503_test.js index 20a78ce5b9..4700978982 100644 --- a/jscomp/test/gpr_1503_test.js +++ b/jscomp/test/gpr_1503_test.js @@ -20,12 +20,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1539_test.js b/jscomp/test/gpr_1539_test.js index a0d64fd637..e1a1e4e264 100644 --- a/jscomp/test/gpr_1539_test.js +++ b/jscomp/test/gpr_1539_test.js @@ -4,28 +4,28 @@ var Caml_module = require("../../lib/js/caml_module.js"); var Point = Caml_module.init_mod([ - "gpr_1539_test.res", - 11, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "add" - ]] - }); + "gpr_1539_test.res", + 11, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "add" + ]] +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "add" - ]] - }, Point, { - add: (function (prim0, prim1) { - return prim0.add(prim1); - }) - }); + TAG: "Module", + _0: [[ + "Function", + "add" + ]] +}, Point, { + add: (function (prim0, prim1) { + return prim0.add(prim1); + }) +}); var CRS; diff --git a/jscomp/test/gpr_1658_test.js b/jscomp/test/gpr_1658_test.js index 9617511d97..8e88ca028e 100644 --- a/jscomp/test/gpr_1658_test.js +++ b/jscomp/test/gpr_1658_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1667_test.js b/jscomp/test/gpr_1667_test.js index 53f9750c9b..45e135779c 100644 --- a/jscomp/test/gpr_1667_test.js +++ b/jscomp/test/gpr_1667_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1698_test.js b/jscomp/test/gpr_1698_test.js index 4c0e82d63e..df96e7f21a 100644 --- a/jscomp/test/gpr_1698_test.js +++ b/jscomp/test/gpr_1698_test.js @@ -216,7 +216,7 @@ var b = { }; console.log(compare("InSum", { - complex: true - }, a, b)); + complex: true +}, a, b)); /* Not a pure module */ diff --git a/jscomp/test/gpr_1701_test.js b/jscomp/test/gpr_1701_test.js index 28680f6b51..7a3cec5153 100644 --- a/jscomp/test/gpr_1701_test.js +++ b/jscomp/test/gpr_1701_test.js @@ -83,9 +83,9 @@ function read_lines3(inc) { try { var l = input_line(inc); return loop({ - hd: l, - tl: acc - }); + hd: l, + tl: acc + }); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); diff --git a/jscomp/test/gpr_1716_test.js b/jscomp/test/gpr_1716_test.js index 6609115ee4..89a927beb1 100644 --- a/jscomp/test/gpr_1716_test.js +++ b/jscomp/test/gpr_1716_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -34,12 +34,12 @@ var a = {}; var b = {}; Caml_obj.update_dummy(a, { - b: b - }); + b: b +}); Caml_obj.update_dummy(b, { - a: a - }); + a: a +}); function is_inifite(x) { return x.b.a === x; diff --git a/jscomp/test/gpr_1728_test.js b/jscomp/test/gpr_1728_test.js index 9e74e97606..8beb12eb96 100644 --- a/jscomp/test/gpr_1728_test.js +++ b/jscomp/test/gpr_1728_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,8 +39,8 @@ function badInlining(obj) { } eq("File \"gpr_1728_test.res\", line 16, characters 3-10", badInlining({ - field: "3" - }), undefined); + field: "3" +}), undefined); eq("File \"gpr_1728_test.res\", line 18, characters 3-10", Caml_format.int_of_string("-13"), -13); diff --git a/jscomp/test/gpr_1749_test.js b/jscomp/test/gpr_1749_test.js index 7339ca80af..2ef3e7f6fd 100644 --- a/jscomp/test/gpr_1749_test.js +++ b/jscomp/test/gpr_1749_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1760_test.js b/jscomp/test/gpr_1760_test.js index f71a0f5a5d..552398ce6c 100644 --- a/jscomp/test/gpr_1760_test.js +++ b/jscomp/test/gpr_1760_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -91,20 +91,20 @@ catch (exn$5){ } eq("File \"gpr_1760_test.res\", line 57, characters 3-10", [ - a0, - a1, - a4, - a5, - a6, - a7 - ], [ - 1, - 1, - 1, - 1, - 1, - 1 - ]); + a0, + a1, + a4, + a5, + a6, + a7 +], [ + 1, + 1, + 1, + 1, + 1, + 1 +]); Mt.from_pair_suites("Gpr_1760_test", suites.contents); diff --git a/jscomp/test/gpr_1762_test.js b/jscomp/test/gpr_1762_test.js index ee69f71d1d..06965afd85 100644 --- a/jscomp/test/gpr_1762_test.js +++ b/jscomp/test/gpr_1762_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1817_test.js b/jscomp/test/gpr_1817_test.js index 7631b46e00..587c30c787 100644 --- a/jscomp/test/gpr_1817_test.js +++ b/jscomp/test/gpr_1817_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1822_test.js b/jscomp/test/gpr_1822_test.js index 358cf5ef37..73e2c7fada 100644 --- a/jscomp/test/gpr_1822_test.js +++ b/jscomp/test/gpr_1822_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_1943_test.js b/jscomp/test/gpr_1943_test.js index 39925d9b25..5e84fee2fd 100644 --- a/jscomp/test/gpr_1943_test.js +++ b/jscomp/test/gpr_1943_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -41,24 +41,24 @@ function f(x) { } var v = f({ - _003: 0, - _50: 1, - _50x: 2, - __50: 3, - __50x: 4, - "_50x'": 5, - "x'": 6 - }); + _003: 0, + _50: 1, + _50x: 2, + __50: 3, + __50x: 4, + "_50x'": 5, + "x'": 6 +}); eq("File \"gpr_1943_test.res\", line 23, characters 3-10", [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], v); + 0, + 1, + 2, + 3, + 4, + 5, + 6 +], v); Mt.from_pair_suites("Gpr_1943_test", suites.contents); diff --git a/jscomp/test/gpr_1946_test.js b/jscomp/test/gpr_1946_test.js index 04b2be9dc7..50553a00ce 100644 --- a/jscomp/test/gpr_1946_test.js +++ b/jscomp/test/gpr_1946_test.js @@ -37,20 +37,20 @@ function f(id) { } eq("File \"gpr_1946_test.res\", line 24, characters 3-10", ({ - _5: 3 - })._5, 3); + _5: 3 +})._5, 3); eq("File \"gpr_1946_test.res\", line 25, characters 3-10", [ - 2, - 3 - ], [ - f(h)["0123"], - f(h)["123_456"] - ]); + 2, + 3 +], [ + f(h)["0123"], + f(h)["123_456"] +]); console.log(({ - _5: 3 - }).TAG); + _5: 3 + }).TAG); Mt.from_pair_suites("File \"gpr_1946_test.res\", line 28, characters 20-27", suites.contents); diff --git a/jscomp/test/gpr_2316_test.js b/jscomp/test/gpr_2316_test.js index c24b83d40f..54e85ae658 100644 --- a/jscomp/test/gpr_2316_test.js +++ b/jscomp/test/gpr_2316_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/gpr_2487.js b/jscomp/test/gpr_2487.js index 6bf5991877..ed12c34597 100644 --- a/jscomp/test/gpr_2487.js +++ b/jscomp/test/gpr_2487.js @@ -4,16 +4,16 @@ var Belt_Array = require("../../lib/js/belt_Array.js"); var b = Belt_Array.eq([ - 1, - 2, - 3 - ], [ - 1, - 2, - 3 - ], (function (prim0, prim1) { - return prim0 === prim1; - })); + 1, + 2, + 3 +], [ + 1, + 2, + 3 +], (function (prim0, prim1) { + return prim0 === prim1; +})); var A; diff --git a/jscomp/test/gpr_2503_test.js b/jscomp/test/gpr_2503_test.js index 8b2be590ce..423b6b4fb0 100644 --- a/jscomp/test/gpr_2503_test.js +++ b/jscomp/test/gpr_2503_test.js @@ -30,8 +30,8 @@ function makeWrapper(foo, param) { function makeWrapper2(foo, param) { console.log({ - foo: foo - }); + foo: foo + }); } makeWrapper2("a", undefined); diff --git a/jscomp/test/gpr_2608_test.js b/jscomp/test/gpr_2608_test.js index 4a67676901..e52f8e6c4f 100644 --- a/jscomp/test/gpr_2608_test.js +++ b/jscomp/test/gpr_2608_test.js @@ -25,8 +25,8 @@ var huntGrootCondition = false; if (List.length(/* [] */0) > 0) { var x = List.filter(function (h) { - return List.hd(/* [] */0) <= 1000; - })(oppHeroes); + return List.hd(/* [] */0) <= 1000; + })(oppHeroes); huntGrootCondition = List.length(x) === 0; } @@ -34,8 +34,8 @@ var huntGrootCondition2 = true; if (List.length(/* [] */0) < 0) { var x$1 = List.filter(function (h) { - return List.hd(/* [] */0) <= 1000; - })(oppHeroes); + return List.hd(/* [] */0) <= 1000; + })(oppHeroes); huntGrootCondition2 = List.length(x$1) === 0; } diff --git a/jscomp/test/gpr_2682_test.js b/jscomp/test/gpr_2682_test.js index c66058c9e5..437d296fba 100644 --- a/jscomp/test/gpr_2682_test.js +++ b/jscomp/test/gpr_2682_test.js @@ -29,17 +29,17 @@ var N = { }; forIn({ - x: 3 - }, (function (x) { - console.log(x); - })); + x: 3 +}, (function (x) { + console.log(x); +})); forIn({ - x: 3, - y: 3 - }, (function (x) { - console.log(x); - })); + x: 3, + y: 3 +}, (function (x) { + console.log(x); +})); var f3 = (()=>true); diff --git a/jscomp/test/gpr_3536_test.js b/jscomp/test/gpr_3536_test.js index 15958cab58..7f8f93ca2e 100644 --- a/jscomp/test/gpr_3536_test.js +++ b/jscomp/test/gpr_3536_test.js @@ -25,12 +25,12 @@ function xx(obj, a0, a1, a2, a3, a4, a5) { eq("File \"gpr_3536_test.res\", line 18, characters 12-19", 5, 5); eq("File \"gpr_3536_test.res\", line 20, characters 12-19", xx(3, (function (prim0, prim1) { - return prim0 - prim1 | 0; - }), 2, (function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 4, (function (prim0, prim1) { - return Math.imul(prim0, prim1); - }), 3), 11); + return prim0 - prim1 | 0; +}), 2, (function (prim0, prim1) { + return prim0 + prim1 | 0; +}), 4, (function (prim0, prim1) { + return Math.imul(prim0, prim1); +}), 3), 11); Mt.from_pair_suites("Gpr_3536_test", suites.contents); diff --git a/jscomp/test/gpr_3549_test.js b/jscomp/test/gpr_3549_test.js index 264e5121a3..5146f21fa6 100644 --- a/jscomp/test/gpr_3549_test.js +++ b/jscomp/test/gpr_3549_test.js @@ -32,12 +32,12 @@ eq("File \"gpr_3549_test.res\", line 15, characters 5-12", 0.2, 0.2); eq("File \"gpr_3549_test.res\", line 16, characters 5-12", 32, 32); eq("File \"gpr_3549_test.res\", line 17, characters 5-12", others, [ - 0.0, - 0.0, - 1.0, - 1.0, - 2e3 - ]); + 0.0, + 0.0, + 1.0, + 1.0, + 2e3 +]); Mt.from_pair_suites("Gpr_3549_test", suites.contents); diff --git a/jscomp/test/gpr_3566_test.js b/jscomp/test/gpr_3566_test.js index 893d611bc0..d2a609678f 100644 --- a/jscomp/test/gpr_3566_test.js +++ b/jscomp/test/gpr_3566_test.js @@ -21,9 +21,9 @@ function Test($star) { }; var Block = {}; var b = eq_A({ - TAG: "A", - _0: 3 - }, u); + TAG: "A", + _0: 3 + }, u); return { u: u, Block: Block, @@ -36,12 +36,12 @@ function Test2($star) { console.log("no inline"); var Block = {}; var b = eq_A({ - TAG: "A", - _0: 3 - }, { - TAG: "A", - _0: 3 - }); + TAG: "A", + _0: 3 + }, { + TAG: "A", + _0: 3 + }); return { Block: Block, y: 32, diff --git a/jscomp/test/gpr_3697_test.js b/jscomp/test/gpr_3697_test.js index 80df5b8b79..96a55ee1aa 100644 --- a/jscomp/test/gpr_3697_test.js +++ b/jscomp/test/gpr_3697_test.js @@ -7,8 +7,8 @@ function fix(param) { return { TAG: "Fix", _0: CamlinternalLazy.from_fun(function () { - return fix(); - }) + return fix(); + }) }; } diff --git a/jscomp/test/gpr_3875_test.js b/jscomp/test/gpr_3875_test.js index 17bd77d4ec..3c3c1115d5 100644 --- a/jscomp/test/gpr_3875_test.js +++ b/jscomp/test/gpr_3875_test.js @@ -60,8 +60,8 @@ function eq(loc, x, y) { } compilerBug("x", undefined, true, (function (param) { - return true; - })); + return true; +})); eq("File \"gpr_3875_test.res\", line 35, characters 5-12", result.contents, "Some x, f returns true"); diff --git a/jscomp/test/gpr_3931_test.js b/jscomp/test/gpr_3931_test.js index 627a566ff3..c3c6a9eaf5 100644 --- a/jscomp/test/gpr_3931_test.js +++ b/jscomp/test/gpr_3931_test.js @@ -6,61 +6,61 @@ var Curry = require("../../lib/js/curry.js"); var Caml_module = require("../../lib/js/caml_module.js"); var PA = Caml_module.init_mod([ - "gpr_3931_test.res", - 3, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }); + "gpr_3931_test.res", + 3, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}); var P = Caml_module.init_mod([ - "gpr_3931_test.res", - 12, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }); + "gpr_3931_test.res", + 12, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}); function print(a) { $$Array.iter(P.print, a); } Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }, PA, { - print: print - }); + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}, PA, { + print: print +}); function print$1(i) { console.log(String(i)); } Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "print" - ]] - }, P, { - print: print$1 - }); + TAG: "Module", + _0: [[ + "Function", + "print" + ]] +}, P, { + print: print$1 +}); Curry._1(PA.print, [ - 1, - 2 - ]); + 1, + 2 +]); exports.PA = PA; exports.P = P; diff --git a/jscomp/test/gpr_405_test.js b/jscomp/test/gpr_405_test.js index 2ddc99bb95..c6f7507dd5 100644 --- a/jscomp/test/gpr_405_test.js +++ b/jscomp/test/gpr_405_test.js @@ -9,9 +9,9 @@ var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function Make(funarg) { var $$let = funarg.V; var H = Hashtbl.Make({ - equal: $$let.equal, - hash: $$let.hash - }); + equal: $$let.equal, + hash: $$let.hash + }); var find_default = function (htbl, x) { try { return Curry._2(H.find, htbl, x); @@ -74,12 +74,12 @@ function Make(funarg) { var successor = successors.hd; if (!find_default(already_processed, successor)) { return step2(successor, { - hd: [ - top$1, - successors - ], - tl: rest_of_stack$1 - }); + hd: [ + top$1, + successors + ], + tl: rest_of_stack$1 + }); } var x = find_default(on_the_stack, successor) ? Curry._2(H.find, n_labels, successor) : Curry._2(H.find, l_labels, successor); Curry._3(H.add, l_labels, top$1, Caml.int_max(Curry._2(H.find, l_labels, top$1), x)); diff --git a/jscomp/test/gpr_4274_test.js b/jscomp/test/gpr_4274_test.js index 55ce7a2640..9bb8f04c80 100644 --- a/jscomp/test/gpr_4274_test.js +++ b/jscomp/test/gpr_4274_test.js @@ -8,20 +8,20 @@ var N = {}; function f(X, xs) { X.forEach(xs, { - i: (function (x) { - console.log(x.x); - }) - }); + i: (function (x) { + console.log(x.x); + }) + }); } Belt_List.forEachU({ - hd: { - x: 3 - }, - tl: /* [] */0 - }, (function (x) { - console.log(x.x); - })); + hd: { + x: 3 + }, + tl: /* [] */0 +}, (function (x) { + console.log(x.x); +})); var Foo = {}; @@ -30,8 +30,8 @@ var bar = [{ }]; Belt_Array.mapU(bar, (function (b) { - return b.foo; - })); + return b.foo; +})); exports.N = N; exports.f = f; diff --git a/jscomp/test/gpr_4280_test.js b/jscomp/test/gpr_4280_test.js index 2feceec005..2e509a63cd 100644 --- a/jscomp/test/gpr_4280_test.js +++ b/jscomp/test/gpr_4280_test.js @@ -45,9 +45,9 @@ function fn(authState, route) { if (exit === 2) { console.log(authState.VAL); div({ - hd: string("VerifyEmail"), - tl: /* [] */0 - }, undefined); + hd: string("VerifyEmail"), + tl: /* [] */0 + }, undefined); return 2; } @@ -62,41 +62,41 @@ function fn(authState, route) { } else { if (route === "SignUp" || route === "SignIn" || route === "Invite" || route === "PasswordReset") { div({ - hd: string("LoggedOut"), - tl: /* [] */0 - }, undefined); + hd: string("LoggedOut"), + tl: /* [] */0 + }, undefined); return 1; } exit$1 = 2; } if (exit$1 === 2) { div({ - hd: string("Redirect"), - tl: /* [] */0 - }, undefined); + hd: string("Redirect"), + tl: /* [] */0 + }, undefined); return 3; } } console.log(onboardingRoute); div({ - hd: string("Onboarding"), - tl: /* [] */0 - }, undefined); + hd: string("Onboarding"), + tl: /* [] */0 + }, undefined); return 0; } eq("File \"gpr_4280_test.res\", line 42, characters 3-10", fn("Unauthenticated", "Invite"), 1); eq("File \"gpr_4280_test.res\", line 43, characters 3-10", fn("Unauthenticated", { - NAME: "Onboarding", - VAL: 0 - }), 0); + NAME: "Onboarding", + VAL: 0 +}), 0); eq("File \"gpr_4280_test.res\", line 44, characters 3-10", fn({ - NAME: "Unverified", - VAL: 0 - }, "Invite"), 2); + NAME: "Unverified", + VAL: 0 +}, "Invite"), 2); eq("File \"gpr_4280_test.res\", line 45, characters 3-10", fn("Unauthenticated", "xx"), 3); diff --git a/jscomp/test/gpr_459_test.js b/jscomp/test/gpr_459_test.js index 4cd54521cb..357ab5328b 100644 --- a/jscomp/test/gpr_459_test.js +++ b/jscomp/test/gpr_459_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -43,14 +43,14 @@ var hh = uu["_'x"]; eq("File \"gpr_459_test.res\", line 23, characters 12-19", hh, 3); eq("File \"gpr_459_test.res\", line 25, characters 12-19", [ - 1, - 2, - 3 - ], [ - uu2._then, - uu2.catch, - uu2["_'x"] - ]); + 1, + 2, + 3 +], [ + uu2._then, + uu2.catch, + uu2["_'x"] +]); Mt.from_pair_suites("Gpr_459_test", suites.contents); diff --git a/jscomp/test/gpr_5218_test.js b/jscomp/test/gpr_5218_test.js index 156aa4b675..878c084c66 100644 --- a/jscomp/test/gpr_5218_test.js +++ b/jscomp/test/gpr_5218_test.js @@ -26,20 +26,20 @@ function test(x) { } Mt.eq_suites(test_id, suites, "File \"gpr_5218_test.res\", line 11, characters 27-34", test({ - NAME: 1, - VAL: 3 - }), { - NAME: 1, - VAL: 3 - }); + NAME: 1, + VAL: 3 +}), { + NAME: 1, + VAL: 3 +}); Mt.eq_suites(test_id, suites, "File \"gpr_5218_test.res\", line 13, characters 27-34", test({ - NAME: 2, - VAL: 3 - }), { - NAME: 2, - VAL: 3 - }); + NAME: 2, + VAL: 3 +}), { + NAME: 2, + VAL: 3 +}); Mt.from_pair_suites("gpr_5218_test.res", suites.contents); diff --git a/jscomp/test/gpr_858_unit2_test.js b/jscomp/test/gpr_858_unit2_test.js index 6b00912b8a..fe549c6e9d 100644 --- a/jscomp/test/gpr_858_unit2_test.js +++ b/jscomp/test/gpr_858_unit2_test.js @@ -5,8 +5,8 @@ var Curry = require("../../lib/js/curry.js"); var delayed = { contents: (function (param) { - - }) + + }) }; for(var i = 1; i <= 2; ++i){ @@ -15,9 +15,9 @@ for(var i = 1; i <= 2; ++i){ if (x !== 0) { var prev = delayed.contents; delayed.contents = (function (param) { - Curry._1(prev, undefined); - f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); - }); + Curry._1(prev, undefined); + f(((n + 1 | 0) + i | 0) - i | 0, x - 1 | 0); + }); return; } if (i === n) { diff --git a/jscomp/test/gpr_904_test.js b/jscomp/test/gpr_904_test.js index 04b25559b3..90a8fda0e8 100644 --- a/jscomp/test/gpr_904_test.js +++ b/jscomp/test/gpr_904_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -49,15 +49,15 @@ function f(check) { } eq("File \"gpr_904_test.res\", line 16, characters 12-19", f({ - x: true, - y: false - }), false); + x: true, + y: false +}), false); eq("File \"gpr_904_test.res\", line 18, characters 12-19", check_healty({ - a: false, - b: false, - c: true - }), false); + a: false, + b: false, + c: true +}), false); Mt.from_pair_suites("Gpr_904_test", suites.contents); diff --git a/jscomp/test/gpr_977_test.js b/jscomp/test/gpr_977_test.js index 2760f2f24f..76b608dd58 100644 --- a/jscomp/test/gpr_977_test.js +++ b/jscomp/test/gpr_977_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/hash_collision_test.js b/jscomp/test/hash_collision_test.js index 5a6d61003d..edc1a77dec 100644 --- a/jscomp/test/hash_collision_test.js +++ b/jscomp/test/hash_collision_test.js @@ -41,14 +41,14 @@ eq("File \"hash_collision_test.res\", line 20, characters 3-10", 0, 0); eq("File \"hash_collision_test.res\", line 21, characters 3-10", 1, 1); eq("File \"hash_collision_test.res\", line 23, characters 3-10", f1({ - NAME: "Eric_Cooper", - VAL: -1 - }), 0); + NAME: "Eric_Cooper", + VAL: -1 +}), 0); eq("File \"hash_collision_test.res\", line 25, characters 3-10", f1({ - NAME: "azdwbie", - VAL: -2 - }), 0); + NAME: "azdwbie", + VAL: -2 +}), 0); Mt.from_pair_suites("hash_collision_test.res", suites.contents); diff --git a/jscomp/test/hash_test.js b/jscomp/test/hash_test.js index 3695788d90..1abe8a9d8f 100644 --- a/jscomp/test/hash_test.js +++ b/jscomp/test/hash_test.js @@ -23,8 +23,8 @@ function eq(f) { } var test_strings = $$Array.init(32, (function (i) { - return Caml_string.make(i, Char.chr(i)); - })); + return Caml_string.make(i, Char.chr(i)); +})); var test_strings_hash_results = [ 0, diff --git a/jscomp/test/hashtbl_test.js b/jscomp/test/hashtbl_test.js index 9827ded0cb..52861b3083 100644 --- a/jscomp/test/hashtbl_test.js +++ b/jscomp/test/hashtbl_test.js @@ -10,14 +10,14 @@ var MoreLabels = require("../../lib/js/moreLabels.js"); function to_list(tbl) { return Hashtbl.fold((function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0); } function f(param) { @@ -25,8 +25,8 @@ function f(param) { Hashtbl.add(tbl, 1, /* '1' */49); Hashtbl.add(tbl, 2, /* '2' */50); return List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), to_list(tbl)); + return Caml.int_compare(param[0], param$1[0]); + }), to_list(tbl)); } function g(count) { @@ -39,61 +39,61 @@ function g(count) { } var v = to_list(tbl); return $$Array.of_list(List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + return Caml.int_compare(param[0], param$1[0]); + }), v)); } var suites_0 = [ "simple", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f() - }; - }) + tl: /* [] */0 + } + }, + _1: f() + }; + }) ]; var suites_1 = { hd: [ "more_iterations", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(1001, (function (i) { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(1000) - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(1001, (function (i) { + return [ + (i << 1), + String(i) + ]; + })), + _1: g(1000) + }; + }) ], tl: { hd: [ "More_labels_regressionfix_374", (function (param) { - var tbl = MoreLabels.Hashtbl.create(undefined, 30); - Hashtbl.add(tbl, 3, 3); - return { - TAG: "Eq", - _0: tbl.size, - _1: 1 - }; - }) + var tbl = MoreLabels.Hashtbl.create(undefined, 30); + Hashtbl.add(tbl, 3, 3); + return { + TAG: "Eq", + _0: tbl.size, + _1: 1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/hello_res.js b/jscomp/test/hello_res.js index 7c6cdc157b..8853737348 100644 --- a/jscomp/test/hello_res.js +++ b/jscomp/test/hello_res.js @@ -4,37 +4,37 @@ var List = require("../../lib/js/list.js"); var b = List.length({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); var a = b - 1 | 0; console.log("hello, res"); List.length({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); console.log(3); console.log([ - 3, - 1 - ]); + 3, + 1 +]); var to = 3; diff --git a/jscomp/test/ignore_test.js b/jscomp/test/ignore_test.js index 602839e99f..99acff62b6 100644 --- a/jscomp/test/ignore_test.js +++ b/jscomp/test/ignore_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/imm_map_bench.js b/jscomp/test/imm_map_bench.js index 68033d1241..48c66a4133 100644 --- a/jscomp/test/imm_map_bench.js +++ b/jscomp/test/imm_map_bench.js @@ -24,11 +24,11 @@ function should(b) { } var shuffledDataAdd = Belt_Array.makeByAndShuffle(1000001, (function (i) { - return [ - i, - i - ]; - })); + return [ + i, + i + ]; +})); function test(param) { var v = fromArray(shuffledDataAdd); diff --git a/jscomp/test/import2.js b/jscomp/test/import2.js index 00deaef5c0..b39e596551 100644 --- a/jscomp/test/import2.js +++ b/jscomp/test/import2.js @@ -4,8 +4,8 @@ var A = require("a").default; var a = import("a").then(function (m) { - return m.default; - }); + return m.default; +}); var b = A; diff --git a/jscomp/test/import_external.js b/jscomp/test/import_external.js index 595a8b2358..4b84a859e5 100644 --- a/jscomp/test/import_external.js +++ b/jscomp/test/import_external.js @@ -3,8 +3,8 @@ var f8 = import("a").then(function (m) { - return m.default; - }); + return m.default; +}); exports.f8 = f8; /* f8 Not a pure module */ diff --git a/jscomp/test/import_side_effect.js b/jscomp/test/import_side_effect.js index afe5c54c18..83fbd9d487 100644 --- a/jscomp/test/import_side_effect.js +++ b/jscomp/test/import_side_effect.js @@ -3,8 +3,8 @@ var a = import("./side_effect2.js").then(function (m) { - return m.a; - }); + return m.a; +}); var M = await import("./side_effect.js"); diff --git a/jscomp/test/import_side_effect_free.js b/jscomp/test/import_side_effect_free.js index ba50c9d21f..c99fa4ba9a 100644 --- a/jscomp/test/import_side_effect_free.js +++ b/jscomp/test/import_side_effect_free.js @@ -3,8 +3,8 @@ var a = await import("./side_effect_free.js").then(function (m) { - return m.a; - }); + return m.a; +}); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/inline_const.js b/jscomp/test/inline_const.js index 46d7e7c213..e4fa75bc1b 100644 --- a/jscomp/test/inline_const.js +++ b/jscomp/test/inline_const.js @@ -7,9 +7,9 @@ var N = {}; var hh = "hellohello"; console.log([ - 3e-6, - 3e-6 - ]); + 3e-6, + 3e-6 +]); var x = true; diff --git a/jscomp/test/inline_const_test.js b/jscomp/test/inline_const_test.js index 46d0bed3ef..71cf1e79ff 100644 --- a/jscomp/test/inline_const_test.js +++ b/jscomp/test/inline_const_test.js @@ -47,9 +47,9 @@ eq("File \"inline_const_test.res\", line 19, characters 5-12", 1, 1); eq("File \"inline_const_test.res\", line 20, characters 5-12", 3e-6, 0.000003); var h = Caml_int64.add(Caml_int64.add([ - 0, - 100 - ], Int64.one), Caml_int64.one); + 0, + 100 +], Int64.one), Caml_int64.one); Mt.from_pair_suites("File \"inline_const_test.res\", line 28, characters 29-36", suites.contents); diff --git a/jscomp/test/inline_map2_test.js b/jscomp/test/inline_map2_test.js index 5de9b8e1c0..59aa5650a5 100644 --- a/jscomp/test/inline_map2_test.js +++ b/jscomp/test/inline_map2_test.js @@ -1289,32 +1289,32 @@ var IntMap = { }; var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); function height$1(x) { if (typeof x !== "object") { @@ -1973,58 +1973,58 @@ var SMap = { }; var s = List.fold_left((function (acc, param) { - return add$1(param[0], param[1], acc); - }), "Empty", { + return add$1(param[0], param[1], acc); +}), "Empty", { + hd: [ + "10", + /* 'a' */97 + ], + tl: { + hd: [ + "3", + /* 'b' */98 + ], + tl: { hd: [ - "10", - /* 'a' */97 + "7", + /* 'c' */99 ], tl: { hd: [ - "3", - /* 'b' */98 + "20", + /* 'd' */100 ], - tl: { - hd: [ - "7", - /* 'c' */99 - ], - tl: { - hd: [ - "20", - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); Mt.from_pair_suites("Inline_map2_test", { - hd: [ - "assertion1", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: { - hd: [ - "assertion2", - (function (param) { - return { - TAG: "Eq", - _0: find$1("10", s), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "assertion1", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: { + hd: [ + "assertion2", + (function (param) { + return { + TAG: "Eq", + _0: find$1("10", s), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 + } +}); var empty = "Empty"; diff --git a/jscomp/test/inline_map_demo.js b/jscomp/test/inline_map_demo.js index f200cd312b..2867708415 100644 --- a/jscomp/test/inline_map_demo.js +++ b/jscomp/test/inline_map_demo.js @@ -138,32 +138,32 @@ function add(x, data, tree) { } var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); function find(px, _x) { while(true) { @@ -184,17 +184,17 @@ function find(px, _x) { } Mt.from_pair_suites("Inline_map_demo", { - hd: [ - "find", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "find", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 +}); /* m Not a pure module */ diff --git a/jscomp/test/inline_map_test.js b/jscomp/test/inline_map_test.js index 7b204b82c3..159f3e0450 100644 --- a/jscomp/test/inline_map_test.js +++ b/jscomp/test/inline_map_test.js @@ -140,45 +140,45 @@ function find(x, _x_) { } var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); Mt.from_pair_suites("Inline_map_test", { - hd: [ - "find", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "find", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 +}); /* m Not a pure module */ diff --git a/jscomp/test/inline_record_test.js b/jscomp/test/inline_record_test.js index ddf7f36777..4c31eb856d 100644 --- a/jscomp/test/inline_record_test.js +++ b/jscomp/test/inline_record_test.js @@ -37,12 +37,12 @@ var v1 = { function f(x) { if (x.TAG === "A0") { return List.fold_left((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), x.lbl, x.more); + return prim0 + prim1 | 0; + }), x.lbl, x.more); } else { return List.fold_left((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 0, x.more); + return prim0 + prim1 | 0; + }), 0, x.more); } } diff --git a/jscomp/test/inline_regression_test.js b/jscomp/test/inline_regression_test.js index 27d9359da8..0e4621fab2 100644 --- a/jscomp/test/inline_regression_test.js +++ b/jscomp/test/inline_regression_test.js @@ -40,19 +40,19 @@ function generic_basename(is_dir_sep, current_dir_name, name) { function basename(param) { return generic_basename((function (s, i) { - return Caml_string.get(s, i) === /* '/' */47; - }), Filename.current_dir_name, param); + return Caml_string.get(s, i) === /* '/' */47; + }), Filename.current_dir_name, param); } var suites_0 = [ "basename", (function (param) { - return { - TAG: "Eq", - _0: basename("b/c/a.b"), - _1: "a.b" - }; - }) + return { + TAG: "Eq", + _0: basename("b/c/a.b"), + _1: "a.b" + }; + }) ]; var suites = { diff --git a/jscomp/test/inline_string_test.js b/jscomp/test/inline_string_test.js index fa4faecbf0..c81d1e60ac 100644 --- a/jscomp/test/inline_string_test.js +++ b/jscomp/test/inline_string_test.js @@ -15,14 +15,14 @@ function f(x) { } console.log([ - f(3), - "None", - "Some" - ]); + f(3), + "None", + "Some" +]); console.log([ - "A", - "A" - ]); + "A", + "A" +]); /* Not a pure module */ diff --git a/jscomp/test/installation_test.js b/jscomp/test/installation_test.js index 758cd600de..234a716c02 100644 --- a/jscomp/test/installation_test.js +++ b/jscomp/test/installation_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/int32_test.js b/jscomp/test/int32_test.js index c59783fb9c..ae6277dbf7 100644 --- a/jscomp/test/int32_test.js +++ b/jscomp/test/int32_test.js @@ -17,8 +17,8 @@ function f(x) { } var shift_right_logical_tests_0 = $$Array.map((function (x) { - return (-1 >>> x) | 0; - }), Ext_array_test.range(0, 31)); + return (-1 >>> x) | 0; +}), Ext_array_test.range(0, 31)); var shift_right_logical_tests_1 = [ -1, @@ -61,8 +61,8 @@ var shift_right_logical_tests = [ ]; var shift_right_tests_0 = $$Array.map((function (x) { - return (Int32.min_int >> x); - }), Ext_array_test.range(0, 31)); + return (Int32.min_int >> x); +}), Ext_array_test.range(0, 31)); var shift_right_tests_1 = [ -2147483648, @@ -105,8 +105,8 @@ var shift_right_tests = [ ]; var shift_left_tests_0 = $$Array.map((function (x) { - return (1 << x); - }), Ext_array_test.range(0, 31)); + return (1 << x); +}), Ext_array_test.range(0, 31)); var shift_left_tests_1 = [ 1, @@ -154,63 +154,63 @@ function $star$tilde(prim0, prim1) { var suites = { contents: Pervasives.$at({ - hd: [ - "File \"int32_test.res\", line 131, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: 1 - }; - }) - ], - tl: { - hd: [ - "File \"int32_test.res\", line 132, characters 9-16", - (function (param) { - return { - TAG: "Eq", - _0: -2147483647, - _1: -2147483647 - }; - }) - ], - tl: /* [] */0 - } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_logical_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_left_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_left_tests_0, shift_left_tests_1))))) + hd: [ + "File \"int32_test.res\", line 131, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: 1, + _1: 1 + }; + }) + ], + tl: { + hd: [ + "File \"int32_test.res\", line 132, characters 9-16", + (function (param) { + return { + TAG: "Eq", + _0: -2147483647, + _1: -2147483647 + }; + }) + ], + tl: /* [] */0 + } + }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_logical_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_right_logical_tests_0, shift_right_logical_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_left_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; + }), shift_left_tests_0, shift_left_tests_1))))) }; var test_id = { diff --git a/jscomp/test/int64_mul_div_test.js b/jscomp/test/int64_mul_div_test.js index 749720b846..cc0828cd66 100644 --- a/jscomp/test/int64_mul_div_test.js +++ b/jscomp/test/int64_mul_div_test.js @@ -307,16 +307,16 @@ var pairs = [ function from_pairs(prefix, pairs) { return $$Array.to_list($$Array.mapi((function (i, param) { - var b = param[2]; - var a = param[1]; - var result = param[0]; - return [ - prefix + "_" + i, - (function (param) { - return commutative_mul(result, a, b); - }) - ]; - }), pairs)); + var b = param[2]; + var a = param[1]; + var result = param[0]; + return [ + prefix + "_" + i, + (function (param) { + return commutative_mul(result, a, b); + }) + ]; + }), pairs)); } var small_pairs = [ @@ -1510,27 +1510,27 @@ var simple_divs = [ function from(xs) { return List.mapi((function (i, param) { - var d = param[3]; - var c = param[2]; - var b = param[1]; - var a = param[0]; - return [ - "small_divs " + i, - (function (param) { - return { - TAG: "Eq", - _0: [ - c, - d - ], - _1: [ - Caml_int64.div(a, b), - Caml_int64.mod_(a, b) - ] - }; - }) - ]; - }), $$Array.to_list(xs)); + var d = param[3]; + var c = param[2]; + var b = param[1]; + var a = param[0]; + return [ + "small_divs " + i, + (function (param) { + return { + TAG: "Eq", + _0: [ + c, + d + ], + _1: [ + Caml_int64.div(a, b), + Caml_int64.mod_(a, b) + ] + }; + }) + ]; + }), $$Array.to_list(xs)); } var to_string = [[ @@ -1567,116 +1567,116 @@ var int64_compare_tests = [ function from_compare(xs) { return List.mapi((function (i, param) { - var c = param[2]; - var b = param[1]; - var a = param[0]; - return [ - "int64_compare " + i, - (function (param) { - return { - TAG: "Eq", - _0: c, - _1: Caml_int64.compare(a, b) - }; - }) - ]; - }), $$Array.to_list(xs)); + var c = param[2]; + var b = param[1]; + var a = param[0]; + return [ + "int64_compare " + i, + (function (param) { + return { + TAG: "Eq", + _0: c, + _1: Caml_int64.compare(a, b) + }; + }) + ]; + }), $$Array.to_list(xs)); } function from_to_string(xs) { return List.mapi((function (i, param) { - var str_a = param[1]; - var a = param[0]; - return [ - "to_string " + i, - (function (param) { - return { - TAG: "Eq", - _0: str_a, - _1: Caml_int64.to_string(a) - }; - }) - ]; - }), $$Array.to_list(xs)); + var str_a = param[1]; + var a = param[0]; + return [ + "to_string " + i, + (function (param) { + return { + TAG: "Eq", + _0: str_a, + _1: Caml_int64.to_string(a) + }; + }) + ]; + }), $$Array.to_list(xs)); } Mt.from_pair_suites("Int64_mul_div_test", Pervasives.$at(from_pairs("random", pairs), Pervasives.$at(from_pairs("small", small_pairs), Pervasives.$at(List.mapi((function (i, param) { - var f = param[1]; - var i64 = param[0]; - return [ - "to_float_" + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_float(i64), - _1: f - }; - }) - ]; - }), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((function (i, param) { - var i64 = param[1]; - var f = param[0]; - return [ - "of_float_" + i, - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.of_float(f), - _1: i64 - }; - }) - ]; - }), $$Array.to_list(of_float_pairs)), Pervasives.$at({ - hd: [ - "compare_check_complete", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (param) { - return true; - }), check_complete_compare), - _1: check_complete_compare - }; - }) - ], - tl: /* [] */0 - }, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { - hd: [ - "div_rem_0", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) - ], - tl: { - hd: [ - "div_rem_1", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) - ], - tl: { - hd: [ - "File \"int64_mul_div_test.res\", line 263, characters 19-26", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_float(Int64.max_int), - _1: 9.22337203685477581e+18 - }; - }) - ], - tl: /* [] */0 - } - } - })))))))); + var f = param[1]; + var i64 = param[0]; + return [ + "to_float_" + i, + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.to_float(i64), + _1: f + }; + }) + ]; +}), $$Array.to_list(to_floats)), Pervasives.$at(List.mapi((function (i, param) { + var i64 = param[1]; + var f = param[0]; + return [ + "of_float_" + i, + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.of_float(f), + _1: i64 + }; + }) + ]; +}), $$Array.to_list(of_float_pairs)), Pervasives.$at({ + hd: [ + "compare_check_complete", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (param) { + return true; + }), check_complete_compare), + _1: check_complete_compare + }; + }) + ], + tl: /* [] */0 +}, Pervasives.$at(from(simple_divs), Pervasives.$at(from_compare(int64_compare_tests), { + hd: [ + "div_rem_0", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + }; + }) + ], + tl: { + hd: [ + "div_rem_1", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + }; + }) + ], + tl: { + hd: [ + "File \"int64_mul_div_test.res\", line 263, characters 19-26", + (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.to_float(Int64.max_int), + _1: 9.22337203685477581e+18 + }; + }) + ], + tl: /* [] */0 + } + } +})))))))); exports.commutative_mul = commutative_mul; exports.pairs = pairs; diff --git a/jscomp/test/int64_string_bench.js b/jscomp/test/int64_string_bench.js index 614bdc7f4e..eedad7bf4f 100644 --- a/jscomp/test/int64_string_bench.js +++ b/jscomp/test/int64_string_bench.js @@ -7,9 +7,9 @@ var Caml_int64 = require("../../lib/js/caml_int64.js"); console.time("Int64.to_string"); var u = Caml_int64.sub(Int64.max_int, [ - 0, - 200000 - ]); + 0, + 200000 +]); for(var i = 0; i <= 100000; ++i){ Caml_int64.to_string(u); @@ -37,9 +37,9 @@ console.log(Caml_int64.to_string(u$1)); console.time("Int64.to_string"); var u$2 = Caml_int64.add(Int64.min_int, [ - 0, - 100 - ]); + 0, + 100 +]); for(var 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 24ef99e7a8..d4539d3143 100644 --- a/jscomp/test/int64_string_test.js +++ b/jscomp/test/int64_string_test.js @@ -27,33 +27,33 @@ function f(a, b) { } var hh = Caml_int64.add(Int64.min_int, [ - 0, - 100 - ]); + 0, + 100 +]); eq("File \"int64_string_test.res\", line 14, characters 3-10", hh, [ - -2147483648, - 100 - ]); + -2147483648, + 100 +]); f([ - -1, - 4294967263 - ], "-33"); + -1, + 4294967263 +], "-33"); f([ - 0, - 33 - ], "33"); + 0, + 33 +], "33"); f(Int64.min_int, "-9223372036854775808"); f(hh, "-9223372036854775708"); f([ - 232830, - 2764472320 - ], "1000000000000000"); + 232830, + 2764472320 +], "1000000000000000"); for(var 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)); @@ -86,19 +86,19 @@ for(var i$4 = 0; i$4 <= 9; ++i$4){ } eq("File \"int64_string_test.res\", line 73, characters 3-10", Caml_int64.to_string([ - 2097151, - 4294967295 - ]), "9007199254740991"); + 2097151, + 4294967295 +]), "9007199254740991"); eq("File \"int64_string_test.res\", line 74, characters 3-10", Caml_int64.to_string([ - -2097152, - 1 - ]), "-9007199254740991"); + -2097152, + 1 +]), "-9007199254740991"); eq("File \"int64_string_test.res\", line 75, characters 3-10", Caml_int64.to_string([ - -1, - 4294967063 - ]), "-233"); + -1, + 4294967063 +]), "-233"); eq("File \"int64_string_test.res\", line 77, characters 2-9", Caml_int64.to_string(Caml_int64.max_int), "9223372036854775807"); @@ -1305,41 +1305,41 @@ var random_data = { }; Belt_List.forEach(random_data, (function (u) { - if (u) { - if (u.tl) { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "int64_string_test.res", - 191, - 9 - ], - Error: new Error() - }; - } - var match = u.hd; - return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "int64_string_test.res", - 191, - 9 - ], - Error: new Error() - }; - })); + if (u) { + if (u.tl) { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "int64_string_test.res", + 191, + 9 + ], + Error: new Error() + }; + } + var match = u.hd; + return eq("File \"int64_string_test.res\", line 190, characters 25-32", Caml_int64.to_string(match[0]), match[1]); + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "int64_string_test.res", + 191, + 9 + ], + Error: new Error() + }; +})); eq("File \"int64_string_test.res\", line 195, characters 3-10", Caml_int64.to_string([ - -2097152, - 1 - ]), "-9007199254740991"); + -2097152, + 1 +]), "-9007199254740991"); eq("File \"int64_string_test.res\", line 196, characters 3-10", Caml_int64.to_string([ - -2097152, - 0 - ]), "-9007199254740992"); + -2097152, + 0 +]), "-9007199254740992"); Mt.from_pair_suites("File \"int64_string_test.res\", line 197, characters 20-27", suites.contents); diff --git a/jscomp/test/int64_test.js b/jscomp/test/int64_test.js index 2681b07784..1c3ced7939 100644 --- a/jscomp/test/int64_test.js +++ b/jscomp/test/int64_test.js @@ -36,8 +36,8 @@ function commutative_add(result, a, b) { var generic_compare = Caml_obj.compare; var shift_left_tests_0 = $$Array.map((function (i) { - return Caml_int64.lsl_(Caml_int64.one, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.lsl_(Caml_int64.one, i); +}), Ext_array_test.range(0, 63)); var shift_left_tests_1 = [ Caml_int64.one, @@ -298,8 +298,8 @@ var shift_left_tests = [ ]; var shift_right_tests_0 = $$Array.map((function (i) { - return Caml_int64.asr_(Caml_int64.min_int, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.asr_(Caml_int64.min_int, i); +}), Ext_array_test.range(0, 63)); var shift_right_tests_1 = [ Caml_int64.min_int, @@ -560,8 +560,8 @@ var shift_right_tests = [ ]; var shift_right_logical_suites_0 = $$Array.map((function (i) { - return Caml_int64.lsr_(Caml_int64.min_int, i); - }), Ext_array_test.range(0, 63)); + return Caml_int64.lsr_(Caml_int64.min_int, i); +}), Ext_array_test.range(0, 63)); var shift_right_logical_suites_1 = [ Caml_int64.min_int, @@ -850,1215 +850,1213 @@ function fac(_n, _acc) { } var suites = Pervasives.$at({ + hd: [ + "add_one", + (function (param) { + return { + TAG: "Eq", + _0: v, + _1: [ + 0, + 2147483648 + ] + }; + }) + ], + tl: { + hd: [ + "add_2", + (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967294 + ], + _1: Caml_int64.add(a, a) + }; + }) + ], + tl: { hd: [ - "add_one", + "add_3", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: [ - 0, - 2147483648 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.zero, + _1: Caml_int64.zero + }; + }) ], tl: { hd: [ - "add_2", + "add_4", (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 4294967294 - ], - _1: Caml_int64.add(a, a) - }; - }) + return commutative_add([ + -1, + 4294967294 + ], [ + -1, + 4294967293 + ], Caml_int64.one); + }) ], tl: { hd: [ - "add_3", + "add_5", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.zero, - _1: Caml_int64.zero - }; - }) + return commutative_add([ + -1, + 4294967293 + ], [ + -1, + 4294967293 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_4", + "add_6", (function (param) { - return commutative_add([ - -1, - 4294967294 - ], [ - -1, - 4294967293 - ], Caml_int64.one); - }) + return commutative_add([ + 0, + 4 + ], [ + -1, + 4294967293 + ], [ + 0, + 7 + ]); + }) ], tl: { hd: [ - "add_5", + "add_7", (function (param) { - return commutative_add([ - -1, - 4294967293 - ], [ - -1, - 4294967293 - ], Caml_int64.zero); - }) + return commutative_add([ + 1, + 0 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ]); + }) ], tl: { hd: [ - "add_6", + "add_8", (function (param) { - return commutative_add([ - 0, - 4 - ], [ - -1, - 4294967293 - ], [ - 0, - 7 - ]); - }) + return commutative_add([ + 1, + 0 + ], [ + 0, + 4294967295 + ], Caml_int64.one); + }) ], tl: { hd: [ - "add_7", + "add_9", (function (param) { - return commutative_add([ - 1, - 0 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ]); - }) + return commutative_add([ + 0, + 4294967295 + ], [ + 0, + 2147483648 + ], [ + 0, + 2147483647 + ]); + }) ], tl: { hd: [ - "add_8", + "add_10", (function (param) { - return commutative_add([ - 1, - 0 - ], [ - 0, - 4294967295 - ], Caml_int64.one); - }) + return commutative_add([ + 0, + 2147483648 + ], [ + 0, + 2147483648 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_9", + "add_11", (function (param) { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 2147483648 - ], [ - 0, - 2147483647 - ]); - }) + return commutative_add([ + 0, + 4294967295 + ], [ + 0, + 4294967295 + ], Caml_int64.zero); + }) ], tl: { hd: [ - "add_10", + "to_int32", (function (param) { - return commutative_add([ - 0, - 2147483648 - ], [ - 0, - 2147483648 - ], Caml_int64.zero); - }) + return { + TAG: "Eq", + _0: 3, + _1: Caml_int64.to_int32([ + 0, + 3 + ]) + }; + }) ], tl: { hd: [ - "add_11", + "to_int", (function (param) { - return commutative_add([ - 0, - 4294967295 - ], [ - 0, - 4294967295 - ], Caml_int64.zero); - }) + return { + TAG: "Eq", + _0: 3, + _1: Caml_int64.to_int32([ + 0, + 3 + ]) + }; + }) ], tl: { hd: [ - "to_int32", + "of_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_int64.to_int32([ - 0, - 3 - ]) - }; - }) + return { + TAG: "Eq", + _0: [ + 0, + 3 + ], + _1: [ + 0, + 3 + ] + }; + }) ], tl: { hd: [ - "to_int", + "lognot", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_int64.to_int32([ - 0, - 3 - ]) - }; - }) + return { + TAG: "Eq", + _0: [ + -1, + 4294967293 + ], + _1: [ + -1, + 4294967293 + ] + }; + }) ], tl: { hd: [ - "of_int", + "neg", (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 3 - ], - _1: [ - 0, - 3 - ] - }; - }) + return { + TAG: "Eq", + _0: [ + -1, + 4294967294 + ], + _1: [ + -1, + 4294967294 + ] + }; + }) ], tl: { hd: [ - "lognot", + "File \"int64_test.res\", line 277, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: [ - -1, - 4294967293 - ], - _1: [ - -1, - 4294967293 - ] - }; - }) + return { + TAG: "Eq", + _0: Int64.min_int, + _1: Caml_int64.neg(Int64.min_int) + }; + }) ], tl: { hd: [ - "neg", + "File \"int64_test.res\", line 279, characters 8-15", (function (param) { + return { + TAG: "Eq", + _0: Int64.max_int, + _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) + }; + }) + ], + tl: { + hd: [ + "sub1", + (function (param) { return { TAG: "Eq", _0: [ - -1, - 4294967294 + 0, + 2 ], _1: [ - -1, - 4294967294 + 0, + 2 ] }; }) - ], - tl: { - hd: [ - "File \"int64_test.res\", line 277, characters 7-14", - (function (param) { - return { - TAG: "Eq", - _0: Int64.min_int, - _1: Caml_int64.neg(Int64.min_int) - }; - }) ], tl: { hd: [ - "File \"int64_test.res\", line 279, characters 8-15", + "xor1", (function (param) { - return { - TAG: "Eq", - _0: Int64.max_int, - _1: Caml_int64.neg(Caml_int64.add(Int64.min_int, Caml_int64.one)) - }; - }) + return { + TAG: "Eq", + _0: [ + [ + 0, + 286331153 + ], + Caml_int64.xor(a, [ + 0, + 4009750271 + ]) + ], + _1: [ + [ + 0, + 286331153 + ], + [ + 0, + 2432700672 + ] + ] + }; + }) ], tl: { hd: [ - "sub1", + "or", (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967295 + ], + _1: [ + 0, + 4294967295 + ] + }; + }) + ], + tl: { + hd: [ + "and", + (function (param) { return { TAG: "Eq", _0: [ 0, - 2 + 4008636142 ], _1: [ 0, - 2 + 4008636142 ] }; }) - ], - tl: { - hd: [ - "xor1", - (function (param) { + ], + tl: { + hd: [ + "lsl", + (function (param) { return { TAG: "Eq", - _0: [ + _0: $$Array.map((function (x) { + return Caml_int64.lsl_(Caml_int64.one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.one, [ 0, - 286331153 + 2 ], - Caml_int64.xor(a, [ - 0, - 4009750271 - ]) - ], - _1: [ [ 0, - 286331153 + 4 ], [ 0, - 2432700672 - ] - ] - }; - }) - ], - tl: { - hd: [ - "or", - (function (param) { - return { - TAG: "Eq", - _0: [ + 8 + ], + [ 0, - 4294967295 + 16 ], - _1: [ + [ 0, - 4294967295 - ] - }; - }) - ], - tl: { - hd: [ - "and", - (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 4008636142 - ], - _1: [ - 0, - 4008636142 - ] - }; - }) - ], - tl: { - hd: [ - "lsl", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.lsl_(Caml_int64.one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), - _1: [ - Caml_int64.one, - [ - 0, - 2 - ], - [ - 0, - 4 - ], - [ - 0, - 8 - ], - [ - 0, - 16 - ], - [ - 0, - 32 - ], - [ - 0, - 64 - ], - [ - 0, - 128 - ], - [ - 0, - 256 - ], - [ - 0, - 512 - ], - [ - 0, - 1024 - ], - [ - 0, - 2048 - ], - [ - 0, - 4096 - ], - [ - 0, - 8192 - ], - [ - 0, - 16384 - ], - [ - 0, - 32768 - ], - [ - 0, - 65536 - ], - [ - 0, - 131072 - ], - [ - 0, - 262144 - ], - [ - 0, - 524288 - ], - [ - 0, - 1048576 - ], - [ - 0, - 2097152 - ], - [ - 0, - 4194304 - ], - [ - 0, - 8388608 - ], - [ - 0, - 16777216 - ], - [ - 0, - 33554432 - ], - [ - 0, - 67108864 - ], - [ - 0, - 134217728 - ], - [ - 0, - 268435456 - ], - [ - 0, - 536870912 - ], - [ - 0, - 1073741824 - ], - [ - 0, - 2147483648 - ], - [ - 1, - 0 - ], - [ - 2, - 0 - ], - [ - 4, - 0 - ], - [ - 8, - 0 - ], - [ - 16, - 0 - ], - [ - 32, - 0 - ], - [ - 64, - 0 - ], - [ - 128, - 0 - ], - [ - 256, - 0 - ], - [ - 512, - 0 - ], - [ - 1024, - 0 - ], - [ - 2048, - 0 - ], - [ - 4096, - 0 - ], - [ - 8192, - 0 - ], - [ - 16384, - 0 - ], - [ - 32768, - 0 - ], - [ - 65536, - 0 - ], - [ - 131072, - 0 - ], - [ - 262144, - 0 - ], - [ - 524288, - 0 - ], - [ - 1048576, - 0 - ], - [ - 2097152, - 0 - ], - [ - 4194304, - 0 - ], - [ - 8388608, - 0 - ], - [ - 16777216, - 0 - ], - [ - 33554432, - 0 - ], - [ - 67108864, - 0 - ], - [ - 134217728, - 0 - ], - [ - 268435456, - 0 - ], - [ - 536870912, - 0 - ], - [ - 1073741824, - 0 - ], - Caml_int64.min_int - ] - }; - }) - ], - tl: { - hd: [ - "lsr", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.lsr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), - _1: [ - Caml_int64.neg_one, - Caml_int64.max_int, - [ - 1073741823, - 4294967295 - ], - [ - 536870911, - 4294967295 - ], - [ - 268435455, - 4294967295 - ], - [ - 134217727, - 4294967295 - ], - [ - 67108863, - 4294967295 - ], - [ - 33554431, - 4294967295 - ], - [ - 16777215, - 4294967295 - ], - [ - 8388607, - 4294967295 - ], - [ - 4194303, - 4294967295 - ], - [ - 2097151, - 4294967295 - ], - [ - 1048575, - 4294967295 - ], - [ - 524287, - 4294967295 - ], - [ - 262143, - 4294967295 - ], - [ - 131071, - 4294967295 - ], - [ - 65535, - 4294967295 - ], - [ - 32767, - 4294967295 - ], - [ - 16383, - 4294967295 - ], - [ - 8191, - 4294967295 - ], - [ - 4095, - 4294967295 - ], - [ - 2047, - 4294967295 - ], - [ - 1023, - 4294967295 - ], - [ - 511, - 4294967295 - ], - [ - 255, - 4294967295 - ], - [ - 127, - 4294967295 - ], - [ - 63, - 4294967295 - ], - [ - 31, - 4294967295 - ], - [ - 15, - 4294967295 - ], - [ - 7, - 4294967295 - ], - [ - 3, - 4294967295 - ], - [ - 1, - 4294967295 - ], - [ - 0, - 4294967295 - ], - [ - 0, - 2147483647 - ], - [ - 0, - 1073741823 - ], - [ - 0, - 536870911 - ], - [ - 0, - 268435455 - ], - [ - 0, - 134217727 - ], - [ - 0, - 67108863 - ], - [ - 0, - 33554431 - ], - [ - 0, - 16777215 - ], - [ - 0, - 8388607 - ], - [ - 0, - 4194303 - ], - [ - 0, - 2097151 - ], - [ - 0, - 1048575 - ], - [ - 0, - 524287 - ], - [ - 0, - 262143 - ], - [ - 0, - 131071 - ], - [ - 0, - 65535 - ], - [ - 0, - 32767 - ], - [ - 0, - 16383 - ], - [ - 0, - 8191 - ], - [ - 0, - 4095 - ], - [ - 0, - 2047 - ], - [ - 0, - 1023 - ], - [ - 0, - 511 - ], - [ - 0, - 255 - ], - [ - 0, - 127 - ], - [ - 0, - 63 - ], - [ - 0, - 31 - ], - [ - 0, - 15 - ], - [ - 0, - 7 - ], - [ - 0, - 3 - ], - Caml_int64.one - ] - }; - }) + 32 + ], + [ + 0, + 64 + ], + [ + 0, + 128 + ], + [ + 0, + 256 + ], + [ + 0, + 512 + ], + [ + 0, + 1024 + ], + [ + 0, + 2048 + ], + [ + 0, + 4096 + ], + [ + 0, + 8192 + ], + [ + 0, + 16384 + ], + [ + 0, + 32768 + ], + [ + 0, + 65536 + ], + [ + 0, + 131072 + ], + [ + 0, + 262144 + ], + [ + 0, + 524288 + ], + [ + 0, + 1048576 + ], + [ + 0, + 2097152 + ], + [ + 0, + 4194304 + ], + [ + 0, + 8388608 + ], + [ + 0, + 16777216 + ], + [ + 0, + 33554432 + ], + [ + 0, + 67108864 + ], + [ + 0, + 134217728 + ], + [ + 0, + 268435456 + ], + [ + 0, + 536870912 + ], + [ + 0, + 1073741824 + ], + [ + 0, + 2147483648 + ], + [ + 1, + 0 + ], + [ + 2, + 0 + ], + [ + 4, + 0 + ], + [ + 8, + 0 + ], + [ + 16, + 0 + ], + [ + 32, + 0 + ], + [ + 64, + 0 + ], + [ + 128, + 0 + ], + [ + 256, + 0 + ], + [ + 512, + 0 + ], + [ + 1024, + 0 + ], + [ + 2048, + 0 + ], + [ + 4096, + 0 + ], + [ + 8192, + 0 + ], + [ + 16384, + 0 + ], + [ + 32768, + 0 + ], + [ + 65536, + 0 + ], + [ + 131072, + 0 + ], + [ + 262144, + 0 + ], + [ + 524288, + 0 + ], + [ + 1048576, + 0 + ], + [ + 2097152, + 0 + ], + [ + 4194304, + 0 + ], + [ + 8388608, + 0 + ], + [ + 16777216, + 0 + ], + [ + 33554432, + 0 + ], + [ + 67108864, + 0 + ], + [ + 134217728, + 0 + ], + [ + 268435456, + 0 + ], + [ + 536870912, + 0 + ], + [ + 1073741824, + 0 + ], + Caml_int64.min_int + ] + }; + }) + ], + tl: { + hd: [ + "lsr", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (x) { + return Caml_int64.lsr_(Caml_int64.neg_one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.neg_one, + Caml_int64.max_int, + [ + 1073741823, + 4294967295 + ], + [ + 536870911, + 4294967295 + ], + [ + 268435455, + 4294967295 + ], + [ + 134217727, + 4294967295 + ], + [ + 67108863, + 4294967295 + ], + [ + 33554431, + 4294967295 + ], + [ + 16777215, + 4294967295 + ], + [ + 8388607, + 4294967295 + ], + [ + 4194303, + 4294967295 + ], + [ + 2097151, + 4294967295 + ], + [ + 1048575, + 4294967295 + ], + [ + 524287, + 4294967295 + ], + [ + 262143, + 4294967295 + ], + [ + 131071, + 4294967295 + ], + [ + 65535, + 4294967295 + ], + [ + 32767, + 4294967295 + ], + [ + 16383, + 4294967295 + ], + [ + 8191, + 4294967295 + ], + [ + 4095, + 4294967295 + ], + [ + 2047, + 4294967295 + ], + [ + 1023, + 4294967295 + ], + [ + 511, + 4294967295 + ], + [ + 255, + 4294967295 + ], + [ + 127, + 4294967295 + ], + [ + 63, + 4294967295 + ], + [ + 31, + 4294967295 + ], + [ + 15, + 4294967295 + ], + [ + 7, + 4294967295 + ], + [ + 3, + 4294967295 + ], + [ + 1, + 4294967295 + ], + [ + 0, + 4294967295 + ], + [ + 0, + 2147483647 + ], + [ + 0, + 1073741823 + ], + [ + 0, + 536870911 + ], + [ + 0, + 268435455 + ], + [ + 0, + 134217727 + ], + [ + 0, + 67108863 + ], + [ + 0, + 33554431 + ], + [ + 0, + 16777215 + ], + [ + 0, + 8388607 + ], + [ + 0, + 4194303 + ], + [ + 0, + 2097151 + ], + [ + 0, + 1048575 + ], + [ + 0, + 524287 + ], + [ + 0, + 262143 + ], + [ + 0, + 131071 + ], + [ + 0, + 65535 + ], + [ + 0, + 32767 + ], + [ + 0, + 16383 + ], + [ + 0, + 8191 + ], + [ + 0, + 4095 + ], + [ + 0, + 2047 + ], + [ + 0, + 1023 + ], + [ + 0, + 511 + ], + [ + 0, + 255 + ], + [ + 0, + 127 + ], + [ + 0, + 63 + ], + [ + 0, + 31 + ], + [ + 0, + 15 + ], + [ + 0, + 7 + ], + [ + 0, + 3 + ], + Caml_int64.one + ] + }; + }) + ], + tl: { + hd: [ + "asr", + (function (param) { + return { + TAG: "Eq", + _0: $$Array.map((function (x) { + return Caml_int64.asr_(Caml_int64.neg_one, x); + }), $$Array.init(64, (function (i) { + return i; + }))), + _1: [ + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one, + Caml_int64.neg_one + ] + }; + }) + ], + tl: { + hd: [ + "mul simple", + (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 6 + ], + _1: [ + 0, + 6 + ] + }; + }) ], tl: { hd: [ - "asr", + "of_int32", (function (param) { + return { + TAG: "Eq", + _0: $$Array.map(Caml_int64.of_int32, [ + 0, + -2147483648 + ]), + _1: [ + Caml_int64.zero, + [ + -1, + 2147483648 + ] + ] + }; + }) + ], + tl: { + hd: [ + "of_int32_singleton", + (function (param) { return { TAG: "Eq", - _0: $$Array.map((function (x) { - return Caml_int64.asr_(Caml_int64.neg_one, x); - }), $$Array.init(64, (function (i) { - return i; - }))), + _0: [ + -1, + 4294967293 + ], _1: [ - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one, - Caml_int64.neg_one + -1, + 4294967293 ] }; }) - ], - tl: { - hd: [ - "mul simple", - (function (param) { + ], + tl: { + hd: [ + "File \"int64_test.res\", line 526, characters 7-14", + (function (param) { return { TAG: "Eq", _0: [ 0, - 6 + 3 ], _1: [ 0, - 6 + 3 ] }; }) - ], - tl: { - hd: [ - "of_int32", - (function (param) { + ], + tl: { + hd: [ + "to_int32", + (function (param) { return { TAG: "Eq", - _0: $$Array.map(Caml_int64.of_int32, [ - 0, - -2147483648 - ]), - _1: [ + _0: $$Array.map(Caml_int64.to_int32, [ Caml_int64.zero, [ - -1, + 0, 2147483648 ] + ]), + _1: [ + 0, + -2147483648 ] }; }) - ], - tl: { - hd: [ - "of_int32_singleton", - (function (param) { - return { - TAG: "Eq", - _0: [ - -1, - 4294967293 - ], - _1: [ - -1, - 4294967293 - ] - }; - }) ], tl: { hd: [ - "File \"int64_test.res\", line 526, characters 7-14", + "discard_sign", (function (param) { + return { + TAG: "Eq", + _0: Caml_int64.discard_sign(Caml_int64.neg_one), + _1: Caml_int64.max_int + }; + }) + ], + tl: { + hd: [ + "div_mod", + (function (param) { return { TAG: "Eq", - _0: [ + _0: Caml_int64.div_mod([ 0, - 3 - ], - _1: [ + 7 + ], [ 0, 3 + ]), + _1: [ + [ + 0, + 2 + ], + Caml_int64.one ] }; }) - ], - tl: { - hd: [ - "to_int32", - (function (param) { - return { - TAG: "Eq", - _0: $$Array.map(Caml_int64.to_int32, [ - Caml_int64.zero, - [ - 0, - 2147483648 - ] - ]), - _1: [ - 0, - -2147483648 - ] - }; - }) ], tl: { hd: [ - "discard_sign", + "to_hex", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.discard_sign(Caml_int64.neg_one), - _1: Caml_int64.max_int - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.to_hex(Caml_int64.neg_one), + _1: "ffffffffffffffff" + }; + }) ], tl: { hd: [ - "div_mod", + "generic_compare", (function (param) { + return { + TAG: "Eq", + _0: Caml_obj.compare([ + 1, + 0 + ], Caml_int64.one) > 0, + _1: true + }; + }) + ], + tl: { + hd: [ + "test_compier_literal", + (function (param) { return { TAG: "Eq", - _0: Caml_int64.div_mod([ - 0, - 7 - ], [ - 0, - 3 - ]), + _0: [ + 0, + 4294967295 + ], _1: [ - [ - 0, - 2 - ], - Caml_int64.one + 0, + 4294967295 ] }; }) - ], - tl: { - hd: [ - "to_hex", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.to_hex(Caml_int64.neg_one), - _1: "ffffffffffffffff" - }; - }) ], tl: { hd: [ - "generic_compare", + "generic_compare2", (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 1, - 0 - ], Caml_int64.one) > 0, - _1: true - }; - }) + return { + TAG: "Eq", + _0: Caml_obj.compare([ + 0, + 2147483648 + ], Caml_int64.one) > 0, + _1: true + }; + }) ], tl: { hd: [ - "test_compier_literal", + "shift_left", (function (param) { + return { + TAG: "Eq", + _0: [ + 0, + 4294967040 + ], + _1: [ + 0, + 4294967040 + ] + }; + }) + ], + tl: { + hd: [ + "fib_int64", + (function (param) { return { TAG: "Eq", - _0: [ + _0: fib(1000, Caml_int64.one, [ 0, - 4294967295 - ], + 2 + ]), _1: [ - 0, - 4294967295 + -1990564327, + 2874523960 ] }; }) - ], - tl: { - hd: [ - "generic_compare2", - (function (param) { - return { - TAG: "Eq", - _0: Caml_obj.compare([ - 0, - 2147483648 - ], Caml_int64.one) > 0, - _1: true - }; - }) ], tl: { hd: [ - "shift_left", + "fac_int64", (function (param) { + return { + TAG: "Eq", + _0: fac(30, Caml_int64.one), + _1: [ + -2040662563, + 1409286144 + ] + }; + }) + ], + tl: { + hd: [ + "File \"int64_test.res\", line 553, characters 8-15", + (function (param) { return { TAG: "Eq", - _0: [ - 0, - 4294967040 - ], + _0: Caml_int64.add(Int64.max_int, Int64.max_int), _1: [ - 0, - 4294967040 + -1, + 4294967294 ] }; }) - ], - tl: { - hd: [ - "fib_int64", - (function (param) { - return { - TAG: "Eq", - _0: fib(1000, Caml_int64.one, [ - 0, - 2 - ]), - _1: [ - -1990564327, - 2874523960 - ] - }; - }) ], tl: { hd: [ - "fac_int64", + "File \"int64_test.res\", line 563, characters 8-15", (function (param) { - return { - TAG: "Eq", - _0: fac(30, Caml_int64.one), - _1: [ - -2040662563, - 1409286144 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.add(Int64.min_int, Int64.min_int), + _1: Caml_int64.zero + }; + }) ], tl: { hd: [ - "File \"int64_test.res\", line 553, characters 8-15", + "File \"int64_test.res\", line 573, characters 8-15", (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.max_int, Int64.max_int), - _1: [ - -1, - 4294967294 - ] - }; - }) + return { + TAG: "Eq", + _0: Caml_int64.neg_one, + _1: Caml_int64.neg_one + }; + }) ], - tl: { - hd: [ - "File \"int64_test.res\", line 563, characters 8-15", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.add(Int64.min_int, Int64.min_int), - _1: Caml_int64.zero - }; - }) - ], - tl: { - hd: [ - "File \"int64_test.res\", line 573, characters 8-15", - (function (param) { - return { - TAG: "Eq", - _0: Caml_int64.neg_one, - _1: Caml_int64.neg_one - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } } @@ -2098,40 +2096,42 @@ var suites = Pervasives.$at({ } } } - }, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_left_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { - return [ - "shift_right_logical_cases " + i, - (function (param) { - return { - TAG: "Eq", - _0: a, - _1: b - }; - }) - ]; - }), shift_right_logical_suites_0, shift_right_logical_suites_1))))); + } + } +}, Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_left_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_left_tests_0, shift_left_tests_1)), Pervasives.$at($$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_right_tests_0, shift_right_tests_1)), $$Array.to_list(Ext_array_test.map2i((function (i, a, b) { + return [ + "shift_right_logical_cases " + i, + (function (param) { + return { + TAG: "Eq", + _0: a, + _1: b + }; + }) + ]; +}), shift_right_logical_suites_0, shift_right_logical_suites_1))))); var suites$1 = { contents: suites @@ -2156,84 +2156,84 @@ function id(loc, x) { } eq("File \"int64_test.res\", line 629, characters 5-12", Caml_int64.bits_of_float(0.3), [ - 1070805811, - 858993459 - ]); + 1070805811, + 858993459 +]); eq("File \"int64_test.res\", line 630, characters 5-12", Caml_int64.float_of_bits([ - 1070805811, - 858993459 - ]), 0.3); + 1070805811, + 858993459 +]), 0.3); id("File \"int64_test.res\", line 631, characters 5-12", Caml_int64.neg_one); id("File \"int64_test.res\", line 632, characters 5-12", [ - -1, - 4294967196 - ]); + -1, + 4294967196 +]); id("File \"int64_test.res\", line 633, characters 5-12", [ - 0, - 4294967295 - ]); + 0, + 4294967295 +]); id("File \"int64_test.res\", line 634, characters 5-12", [ - 0, - 536870911 - ]); + 0, + 536870911 +]); id("File \"int64_test.res\", line 635, characters 5-12", [ - 0, - 536870655 - ]); + 0, + 536870655 +]); eq("File \"int64_test.res\", line 637, characters 4-11", Caml_int64.div(Int64.min_int, [ - 0, - 10 - ]), [ - -214748365, - 858993460 - ]); + 0, + 10 +]), [ + -214748365, + 858993460 +]); eq("File \"int64_test.res\", line 645, characters 4-11", Caml_int64.to_string(Caml_int64.div(Int64.min_int, [ - 0, - 10 - ])), "-922337203685477580"); + 0, + 10 +])), "-922337203685477580"); eq("File \"int64_test.res\", line 653, characters 4-11", Caml_int64.mul(Int64.min_int, [ - 0, - 10 - ]), Caml_int64.zero); + 0, + 10 +]), Caml_int64.zero); eq("File \"int64_test.res\", line 661, characters 4-11", Caml_int64.mul([ - 0, - 10 - ], Int64.min_int), Caml_int64.zero); + 0, + 10 +], Int64.min_int), Caml_int64.zero); eq("File \"int64_test.res\", line 669, characters 4-11", Caml_int64.mul(Caml_int64.one, Int64.min_int), Int64.min_int); eq("File \"int64_test.res\", line 677, characters 4-11", Caml_int64.mul(Int64.max_int, [ - 0, - 10 - ]), [ - -1, - 4294967286 - ]); + 0, + 10 +]), [ + -1, + 4294967286 +]); eq("File \"int64_test.res\", line 685, characters 4-11", Caml_int64.succ(Int64.max_int), Int64.min_int); eq("File \"int64_test.res\", line 693, characters 4-11", Caml_int64.succ(Int64.min_int), [ - -2147483648, - 1 - ]); + -2147483648, + 1 +]); eq("File \"int64_test.res\", line 700, characters 5-12", Caml_int64.succ([ - 0, - 4294967295 - ]), [ - 1, - 0 - ]); + 0, + 4294967295 +]), [ + 1, + 0 +]); Mt.from_pair_suites("Int64_test", suites$1.contents); diff --git a/jscomp/test/int_hashtbl_test.js b/jscomp/test/int_hashtbl_test.js index aa4d2dd1cf..db5a30f52c 100644 --- a/jscomp/test/int_hashtbl_test.js +++ b/jscomp/test/int_hashtbl_test.js @@ -13,16 +13,16 @@ function f(H) { Curry._3(H.add, tbl, 1, /* '1' */49); Curry._3(H.add, tbl, 2, /* '2' */50); return List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), Curry._3(H.fold, (function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0)); + return Caml.int_compare(param[0], param$1[0]); + }), Curry._3(H.fold, (function (k, v, acc) { + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0)); } function g(H, count) { @@ -34,17 +34,17 @@ function g(H, count) { Curry._3(H.replace, tbl, (i$1 << 1), String(i$1)); } var v = Curry._3(H.fold, (function (k, v, acc) { - return { - hd: [ - k, - v - ], - tl: acc - }; - }), tbl, /* [] */0); + return { + hd: [ + k, + v + ], + tl: acc + }; + }), tbl, /* [] */0); return $$Array.of_list(List.sort((function (param, param$1) { - return Caml.int_compare(param[0], param$1[0]); - }), v)); + return Caml.int_compare(param[0], param$1[0]); + }), v)); } var hash = Hashtbl.hash; @@ -54,48 +54,48 @@ function equal(x, y) { } var Int_hash = Hashtbl.Make({ - equal: equal, - hash: hash - }); + equal: equal, + hash: hash +}); var suites_0 = [ "simple", (function (param) { - return { - TAG: "Eq", - _0: { + return { + TAG: "Eq", + _0: { + hd: [ + 1, + /* '1' */49 + ], + tl: { hd: [ - 1, - /* '1' */49 + 2, + /* '2' */50 ], - tl: { - hd: [ - 2, - /* '2' */50 - ], - tl: /* [] */0 - } - }, - _1: f(Int_hash) - }; - }) + tl: /* [] */0 + } + }, + _1: f(Int_hash) + }; + }) ]; var suites_1 = { hd: [ "more_iterations", (function (param) { - return { - TAG: "Eq", - _0: $$Array.init(1001, (function (i) { - return [ - (i << 1), - String(i) - ]; - })), - _1: g(Int_hash, 1000) - }; - }) + return { + TAG: "Eq", + _0: $$Array.init(1001, (function (i) { + return [ + (i << 1), + String(i) + ]; + })), + _1: g(Int_hash, 1000) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/int_overflow_test.js b/jscomp/test/int_overflow_test.js index be0b0dc37d..458cd8f32f 100644 --- a/jscomp/test/int_overflow_test.js +++ b/jscomp/test/int_overflow_test.js @@ -39,162 +39,160 @@ function fib(x) { } Mt.from_pair_suites("Int_overflow_test", { + hd: [ + "plus_overflow", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: (Int32.max_int + 1 | 0) === Int32.min_int + }; + }) + ], + tl: { + hd: [ + "minus_overflow", + (function (param) { + return { + TAG: "Eq", + _0: true, + _1: (Int32.min_int - Int32.one | 0) === Int32.max_int + }; + }) + ], + tl: { hd: [ - "plus_overflow", + "flow_again", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: (Int32.max_int + 1 | 0) === Int32.min_int - }; - }) + return { + TAG: "Eq", + _0: 2147483646, + _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 + }; + }) ], tl: { hd: [ - "minus_overflow", + "flow_again", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: (Int32.min_int - Int32.one | 0) === Int32.max_int - }; - }) + return { + TAG: "Eq", + _0: -2, + _1: Int32.max_int + Int32.max_int | 0 + }; + }) ], tl: { hd: [ - "flow_again", + "hash_test", (function (param) { - return { - TAG: "Eq", - _0: 2147483646, - _1: (Int32.max_int + Int32.max_int | 0) + Int32.min_int | 0 - }; - }) + return { + TAG: "Eq", + _0: hash_variant("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + }; + }) ], tl: { hd: [ - "flow_again", + "hash_test2", (function (param) { - return { - TAG: "Eq", - _0: -2, - _1: Int32.max_int + Int32.max_int | 0 - }; - }) + return { + TAG: "Eq", + _0: hash_variant("xxyyzxzzyy"), + _1: -449896130 + }; + }) ], tl: { hd: [ - "hash_test", + "File \"int_overflow_test.res\", line 88, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: hash_variant("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + return { + TAG: "Eq", + _0: hash_variant2("xxyyzzuuxxzzyy00112233"), + _1: 544087776 + }; + }) ], tl: { hd: [ - "hash_test2", + "File \"int_overflow_test.res\", line 89, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: hash_variant("xxyyzxzzyy"), - _1: -449896130 - }; - }) + return { + TAG: "Eq", + _0: hash_variant2("xxyyzxzzyy"), + _1: -449896130 + }; + }) ], tl: { hd: [ - "File \"int_overflow_test.res\", line 88, characters 5-12", + "int_literal_flow", (function (param) { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzzuuxxzzyy00112233"), - _1: 544087776 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "File \"int_overflow_test.res\", line 89, characters 5-12", + "int_literal_flow2", (function (param) { - return { - TAG: "Eq", - _0: hash_variant2("xxyyzxzzyy"), - _1: -449896130 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "int_literal_flow", + "int_literal_flow3", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: -1 + }; + }) ], tl: { hd: [ - "int_literal_flow2", + "int32_mul", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: -33554431, + _1: -33554431 + }; + }) ], tl: { hd: [ - "int_literal_flow3", + "File \"int_overflow_test.res\", line 94, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: -1 - }; - }) + return { + TAG: "Eq", + _0: Number("3") | 0, + _1: 3 + }; + }) ], tl: { hd: [ - "int32_mul", + "File \"int_overflow_test.res\", line 96, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: -33554431, - _1: -33554431 - }; - }) + return { + TAG: "Eq", + _0: Number("3.2") | 0, + _1: 3 + }; + }) ], - tl: { - hd: [ - "File \"int_overflow_test.res\", line 94, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: Number("3") | 0, - _1: 3 - }; - }) - ], - tl: { - hd: [ - "File \"int_overflow_test.res\", line 96, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: Number("3.2") | 0, - _1: 3 - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } } @@ -206,7 +204,9 @@ Mt.from_pair_suites("Int_overflow_test", { } } } - }); + } + } +}); exports.hash_variant = hash_variant; exports.hash_variant2 = hash_variant2; diff --git a/jscomp/test/int_poly_var.js b/jscomp/test/int_poly_var.js index 80818b0842..9ddc994b3f 100644 --- a/jscomp/test/int_poly_var.js +++ b/jscomp/test/int_poly_var.js @@ -71,55 +71,55 @@ var hihi = f3(3, 0); var hh10 = "3" === 3; var tuple_0 = nest({ - TAG: "A", - _0: 0 - }); + TAG: "A", + _0: 0 +}); var tuple_1 = nest({ - TAG: "A", - _0: 1 - }); + TAG: "A", + _0: 1 +}); var tuple_2 = nest({ - TAG: "A", - _0: 2 - }); + TAG: "A", + _0: 2 +}); var tuple_3 = nest({ - TAG: "B", - _0: 1, - _1: 0 - }); + TAG: "B", + _0: 1, + _1: 0 +}); var tuple_4 = nest({ - TAG: "B", - _0: 1, - _1: 1 - }); + TAG: "B", + _0: 1, + _1: 1 +}); var tuple_5 = nest({ - TAG: "B", - _0: 2, - _1: 1 - }); + TAG: "B", + _0: 2, + _1: 1 +}); var tuple_6 = nest({ - TAG: "B", - _0: 2, - _1: 2 - }); + TAG: "B", + _0: 2, + _1: 2 +}); var tuple_7 = nest({ - TAG: "B", - _0: 0, - _1: 0 - }); + TAG: "B", + _0: 0, + _1: 0 +}); var tuple_8 = nest({ - TAG: "B", - _0: 0, - _1: 1 - }); + TAG: "B", + _0: 0, + _1: 1 +}); var tuple = [ tuple_0, @@ -138,18 +138,18 @@ var tuple = [ Mt.eq_suites(test_id, suites, "File \"int_poly_var.res\", line 79, characters 29-36", hihi, 3); Mt.eq_suites(test_id, suites, "File \"int_poly_var.res\", line 80, characters 29-36", tuple, [ - 0, - 1, - 2, - 3, - 4, - 5, - 5, - 3, - 6, - true, - false - ]); + 0, + 1, + 2, + 3, + 4, + 5, + 5, + 3, + 6, + true, + false +]); function hh0(x) { return x; diff --git a/jscomp/test/int_switch_test.js b/jscomp/test/int_switch_test.js index a2b1c73545..1294df8ad9 100644 --- a/jscomp/test/int_switch_test.js +++ b/jscomp/test/int_switch_test.js @@ -64,24 +64,24 @@ function f33(x) { } eq("File \"int_switch_test.res\", line 32, characters 3-10", f(function (param) { - return 1; - }), /* 'a' */97); + return 1; +}), /* 'a' */97); eq("File \"int_switch_test.res\", line 33, characters 3-10", f(function (param) { - return 2; - }), /* 'b' */98); + return 2; +}), /* 'b' */98); eq("File \"int_switch_test.res\", line 34, characters 3-10", f(function (param) { - return 3; - }), /* 'c' */99); + return 3; +}), /* 'c' */99); eq("File \"int_switch_test.res\", line 35, characters 3-10", f(function (param) { - return 0; - }), /* 'x' */120); + return 0; +}), /* 'x' */120); eq("File \"int_switch_test.res\", line 36, characters 3-10", f(function (param) { - return -1; - }), /* 'x' */120); + return -1; +}), /* 'x' */120); Mt.from_pair_suites("Int_switch_test", suites.contents); diff --git a/jscomp/test/js_array_test.js b/jscomp/test/js_array_test.js index 3ae7c9b99c..eeb489b293 100644 --- a/jscomp/test/js_array_test.js +++ b/jscomp/test/js_array_test.js @@ -8,6 +8,30 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "File \"js_array_test.res\", line 5, characters 6-13", (function (param) { + var x = [ + 1, + 2, + 3, + 4, + 5 + ]; + return { + TAG: "Eq", + _0: [ + 2, + 4 + ], + _1: (Js_vector.filterInPlace((function (x) { + return x % 2 === 0; + }), x), x) + }; + }) +]; + +var suites_1 = { + hd: [ + "File \"js_array_test.res\", line 16, characters 6-13", + (function (param) { var x = [ 1, 2, @@ -17,363 +41,369 @@ var suites_0 = [ ]; return { TAG: "Eq", - _0: [ - 2, - 4 - ], + _0: true, _1: (Js_vector.filterInPlace((function (x) { - return x % 2 === 0; - }), x), x) + return x > 10; + }), x), x.length === 0) }; }) -]; - -var suites_1 = { - hd: [ - "File \"js_array_test.res\", line 16, characters 6-13", - (function (param) { - var x = [ - 1, - 2, - 3, - 4, - 5 - ]; - return { - TAG: "Eq", - _0: true, - _1: (Js_vector.filterInPlace((function (x) { - return x > 10; - }), x), x.length === 0) - }; - }) ], tl: { hd: [ "isArray_array", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Array.isArray([]) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Array.isArray([]) + }; + }) ], tl: { hd: [ "isArray_int", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Array.isArray(34) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Array.isArray(34) + }; + }) ], tl: { hd: [ "length", (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3 + ].length + }; + }) + ], + tl: { + hd: [ + "copyWithin", + (function (param) { return { TAG: "Eq", - _0: 3, + _0: [ + 1, + 2, + 3, + 1, + 2 + ], _1: [ 1, 2, - 3 - ].length + 3, + 4, + 5 + ].copyWithin(-2) }; }) - ], - tl: { - hd: [ - "copyWithin", - (function (param) { + ], + tl: { + hd: [ + "copyWithinFrom", + (function (param) { return { TAG: "Eq", _0: [ - 1, - 2, + 4, + 5, 3, - 1, - 2 + 4, + 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(-2) + 1, + 2, + 3, + 4, + 5 + ].copyWithin(0, 3) }; }) - ], - tl: { - hd: [ - "copyWithinFrom", - (function (param) { + ], + tl: { + hd: [ + "copyWithinFromRange", + (function (param) { return { TAG: "Eq", _0: [ 4, - 5, + 2, 3, 4, 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3) + 1, + 2, + 3, + 4, + 5 + ].copyWithin(0, 3, 4) }; }) - ], - tl: { - hd: [ - "copyWithinFromRange", - (function (param) { + ], + tl: { + hd: [ + "fillInPlace", + (function (param) { return { TAG: "Eq", _0: [ 4, - 2, - 3, 4, - 5 + 4 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].copyWithin(0, 3, 4) + 1, + 2, + 3 + ].fill(4) }; }) - ], - tl: { - hd: [ - "fillInPlace", - (function (param) { + ], + tl: { + hd: [ + "fillFromInPlace", + (function (param) { return { TAG: "Eq", _0: [ - 4, + 1, 4, 4 ], _1: [ - 1, - 2, - 3 - ].fill(4) + 1, + 2, + 3 + ].fill(4, 1) }; }) - ], - tl: { - hd: [ - "fillFromInPlace", - (function (param) { + ], + tl: { + hd: [ + "fillRangeInPlace", + (function (param) { return { TAG: "Eq", _0: [ 1, 4, - 4 + 3 ], _1: [ - 1, - 2, - 3 - ].fill(4, 1) + 1, + 2, + 3 + ].fill(4, 1, 2) }; }) - ], - tl: { - hd: [ - "fillRangeInPlace", - (function (param) { + ], + tl: { + hd: [ + "pop", + (function (param) { return { TAG: "Eq", - _0: [ + _0: 3, + _1: Caml_option.undefined_to_opt([ 1, - 4, + 2, 3 - ], - _1: [ - 1, - 2, - 3 - ].fill(4, 1, 2) + ].pop()) }; }) - ], - tl: { - hd: [ - "pop", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].pop()) - }; - }) ], tl: { hd: [ "pop - empty array", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].pop()) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].pop()) + }; + }) ], tl: { hd: [ "push", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].push(4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].push(4) + }; + }) ], tl: { hd: [ "pushMany", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].push(4, 5) - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: [ + 1, + 2, + 3 + ].push(4, 5) + }; + }) ], tl: { hd: [ "reverseInPlace", (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 1, - 2, - 3 - ].reverse() - }; - }) + return { + TAG: "Eq", + _0: [ + 3, + 2, + 1 + ], + _1: [ + 1, + 2, + 3 + ].reverse() + }; + }) ], tl: { hd: [ "shift", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3 - ].shift()) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3 + ].shift()) + }; + }) ], tl: { hd: [ "shift - empty array", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([].shift()) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([].shift()) + }; + }) ], tl: { hd: [ "sortInPlace", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3 + ], + _1: [ + 3, + 1, + 2 + ].sort() + }; + }) + ], + tl: { + hd: [ + "sortInPlaceWith", + (function (param) { return { TAG: "Eq", _0: [ - 1, + 3, 2, - 3 + 1 ], _1: [ - 3, - 1, - 2 - ].sort() + 3, + 1, + 2 + ].sort(function (a, b) { + return b - a | 0; + }) }; }) - ], - tl: { - hd: [ - "sortInPlaceWith", - (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 2, - 1 - ], - _1: [ - 3, - 1, - 2 - ].sort(function (a, b) { - return b - a | 0; - }) - }; - }) ], tl: { hd: [ "spliceInPlace", (function (param) { + var arr = [ + 1, + 2, + 3, + 4 + ]; + var removed = arr.splice(2, 0, 5); + return { + TAG: "Eq", + _0: [ + [ + 1, + 2, + 5, + 3, + 4 + ], + [] + ], + _1: [ + arr, + removed + ] + }; + }) + ], + tl: { + hd: [ + "removeFromInPlace", + (function (param) { var arr = [ 1, 2, 3, 4 ]; - var removed = arr.splice(2, 0, 5); + var removed = arr.splice(2); return { TAG: "Eq", _0: [ [ 1, - 2, - 5, + 2 + ], + [ 3, 4 - ], - [] + ] ], _1: [ arr, @@ -381,29 +411,27 @@ var suites_1 = { ] }; }) - ], - tl: { - hd: [ - "removeFromInPlace", - (function (param) { + ], + tl: { + hd: [ + "removeCountInPlace", + (function (param) { var arr = [ 1, 2, 3, 4 ]; - var removed = arr.splice(2); + var removed = arr.splice(2, 1); return { TAG: "Eq", _0: [ [ 1, - 2 - ], - [ - 3, + 2, 4 - ] + ], + [3] ], _1: [ arr, @@ -411,89 +439,85 @@ var suites_1 = { ] }; }) - ], - tl: { - hd: [ - "removeCountInPlace", - (function (param) { - var arr = [ - 1, - 2, - 3, - 4 - ]; - var removed = arr.splice(2, 1); - return { - TAG: "Eq", - _0: [ - [ - 1, - 2, - 4 - ], - [3] - ], - _1: [ - arr, - removed - ] - }; - }) ], tl: { hd: [ "unshift", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: [ - 1, - 2, - 3 - ].unshift(4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: [ + 1, + 2, + 3 + ].unshift(4) + }; + }) ], tl: { hd: [ "unshiftMany", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: [ - 1, - 2, - 3 - ].unshift(4, 5) - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: [ + 1, + 2, + 3 + ].unshift(4, 5) + }; + }) ], tl: { hd: [ "append", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3, + 4 + ], + _1: [ + 1, + 2, + 3 + ].concat([4]) + }; + }) + ], + tl: { + hd: [ + "concat", + (function (param) { return { TAG: "Eq", _0: [ 1, 2, 3, - 4 + 4, + 5 ], _1: [ - 1, - 2, - 3 - ].concat([4]) + 1, + 2, + 3 + ].concat([ + 4, + 5 + ]) }; }) - ], - tl: { - hd: [ - "concat", - (function (param) { + ], + tl: { + hd: [ + "concatMany", + (function (param) { return { TAG: "Eq", _0: [ @@ -501,628 +525,604 @@ var suites_1 = { 2, 3, 4, - 5 + 5, + 6, + 7 ], _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ]) + 1, + 2, + 3 + ].concat([ + 4, + 5 + ], [ + 6, + 7 + ]) }; }) - ], - tl: { - hd: [ - "concatMany", - (function (param) { + ], + tl: { + hd: [ + "includes", + (function (param) { return { TAG: "Eq", - _0: [ + _0: true, + _1: [ 1, 2, - 3, - 4, - 5, - 6, - 7 - ], - _1: [ - 1, - 2, - 3 - ].concat([ - 4, - 5 - ], [ - 6, - 7 - ]) + 3 + ].includes(3) }; }) - ], - tl: { - hd: [ - "includes", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].includes(3) - }; - }) ], tl: { hd: [ "indexOf", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3 - ].indexOf(2) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3 + ].indexOf(2) + }; + }) ], tl: { hd: [ "indexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: [ - 1, - 2, - 3, - 2 - ].indexOf(2, 2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: [ + 1, + 2, + 3, + 2 + ].indexOf(2, 2) + }; + }) ], tl: { hd: [ "join", (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].join() - }; - }) + return { + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].join() + }; + }) ], tl: { hd: [ "joinWith", (function (param) { - return { - TAG: "Eq", - _0: "1;2;3", - _1: [ - 1, - 2, - 3 - ].join(";") - }; - }) + return { + TAG: "Eq", + _0: "1;2;3", + _1: [ + 1, + 2, + 3 + ].join(";") + }; + }) ], tl: { hd: [ "lastIndexOf", (function (param) { + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3 + ].lastIndexOf(2) + }; + }) + ], + tl: { + hd: [ + "lastIndexOfFrom", + (function (param) { return { TAG: "Eq", _0: 1, _1: [ - 1, - 2, - 3 - ].lastIndexOf(2) + 1, + 2, + 3, + 2 + ].lastIndexOf(2, 2) }; }) - ], - tl: { - hd: [ - "lastIndexOfFrom", - (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 2 - ].lastIndexOf(2, 2) - }; - }) ], tl: { hd: [ "slice", (function (param) { - return { - TAG: "Eq", - _0: [ - 2, - 3 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(1, 3) - }; - }) + return { + TAG: "Eq", + _0: [ + 2, + 3 + ], + _1: [ + 1, + 2, + 3, + 4, + 5 + ].slice(1, 3) + }; + }) ], tl: { hd: [ "copy", (function (param) { + return { + TAG: "Eq", + _0: [ + 1, + 2, + 3, + 4, + 5 + ], + _1: [ + 1, + 2, + 3, + 4, + 5 + ].slice() + }; + }) + ], + tl: { + hd: [ + "sliceFrom", + (function (param) { return { TAG: "Eq", _0: [ - 1, - 2, 3, 4, 5 ], _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice() + 1, + 2, + 3, + 4, + 5 + ].slice(2) }; }) - ], - tl: { - hd: [ - "sliceFrom", - (function (param) { - return { - TAG: "Eq", - _0: [ - 3, - 4, - 5 - ], - _1: [ - 1, - 2, - 3, - 4, - 5 - ].slice(2) - }; - }) ], tl: { hd: [ "toString", (function (param) { + return { + TAG: "Eq", + _0: "1,2,3", + _1: [ + 1, + 2, + 3 + ].toString() + }; + }) + ], + tl: { + hd: [ + "toLocaleString", + (function (param) { return { TAG: "Eq", _0: "1,2,3", _1: [ - 1, - 2, - 3 - ].toString() + 1, + 2, + 3 + ].toLocaleString() }; }) - ], - tl: { - hd: [ - "toLocaleString", - (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: [ - 1, - 2, - 3 - ].toLocaleString() - }; - }) ], tl: { hd: [ "every", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3 - ].every(function (n) { - return n > 0; - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: [ + 1, + 2, + 3 + ].every(function (n) { + return n > 0; + }) + }; + }) ], tl: { hd: [ "everyi", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3 - ].every(function (param, i) { - return i > 0; - }) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: [ + 1, + 2, + 3 + ].every(function (param, i) { + return i > 0; + }) + }; + }) ], tl: { hd: [ "filter", (function (param) { + return { + TAG: "Eq", + _0: [ + 2, + 4 + ], + _1: [ + 1, + 2, + 3, + 4 + ].filter(function (n) { + return n % 2 === 0; + }) + }; + }) + ], + tl: { + hd: [ + "filteri", + (function (param) { return { TAG: "Eq", _0: [ - 2, - 4 + 1, + 3 ], _1: [ - 1, - 2, - 3, - 4 - ].filter(function (n) { - return n % 2 === 0; - }) + 1, + 2, + 3, + 4 + ].filter(function (param, i) { + return i % 2 === 0; + }) }; }) - ], - tl: { - hd: [ - "filteri", - (function (param) { - return { - TAG: "Eq", - _0: [ - 1, - 3 - ], - _1: [ - 1, - 2, - 3, - 4 - ].filter(function (param, i) { - return i % 2 === 0; - }) - }; - }) ], tl: { hd: [ "find", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (n) { - return n % 2 === 0; - })) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (n) { + return n % 2 === 0; + })) + }; + }) ], tl: { hd: [ "find - no match", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (n) { - return n % 2 === 5; - })) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (n) { + return n % 2 === 5; + })) + }; + }) ], tl: { hd: [ "findi", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (param, i) { - return i % 2 === 0; - })) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (param, i) { + return i % 2 === 0; + })) + }; + }) ], tl: { hd: [ "findi - no match", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.undefined_to_opt([ - 1, - 2, - 3, - 4 - ].find(function (param, i) { - return i % 2 === 5; - })) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.undefined_to_opt([ + 1, + 2, + 3, + 4 + ].find(function (param, i) { + return i % 2 === 5; + })) + }; + }) ], tl: { hd: [ "findIndex", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex(function (n) { - return n % 2 === 0; - }) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: [ + 1, + 2, + 3, + 4 + ].findIndex(function (n) { + return n % 2 === 0; + }) + }; + }) ], tl: { hd: [ "findIndexi", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: [ - 1, - 2, - 3, - 4 - ].findIndex(function (param, i) { - return i % 2 === 0; - }) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: [ + 1, + 2, + 3, + 4 + ].findIndex(function (param, i) { + return i % 2 === 0; + }) + }; + }) ], tl: { hd: [ "forEach", (function (param) { + var sum = { + contents: 0 + }; + [ + 1, + 2, + 3 + ].forEach(function (n) { + sum.contents = sum.contents + n | 0; + }); + return { + TAG: "Eq", + _0: 6, + _1: sum.contents + }; + }) + ], + tl: { + hd: [ + "forEachi", + (function (param) { var sum = { contents: 0 }; [ - 1, - 2, - 3 - ].forEach(function (n) { - sum.contents = sum.contents + n | 0; - }); + 1, + 2, + 3 + ].forEach(function (param, i) { + sum.contents = sum.contents + i | 0; + }); return { TAG: "Eq", - _0: 6, + _0: 3, _1: sum.contents }; }) - ], - tl: { - hd: [ - "forEachi", - (function (param) { - var sum = { - contents: 0 - }; - [ - 1, - 2, - 3 - ].forEach(function (param, i) { - sum.contents = sum.contents + i | 0; - }); - return { - TAG: "Eq", - _0: 3, - _1: sum.contents - }; - }) ], tl: { hd: [ "map", (function (param) { + return { + TAG: "Eq", + _0: [ + 2, + 4, + 6, + 8 + ], + _1: [ + 1, + 2, + 3, + 4 + ].map(function (n) { + return (n << 1); + }) + }; + }) + ], + tl: { + hd: [ + "map", + (function (param) { return { TAG: "Eq", _0: [ + 0, 2, 4, - 6, - 8 + 6 ], _1: [ - 1, - 2, - 3, - 4 - ].map(function (n) { - return (n << 1); - }) + 1, + 2, + 3, + 4 + ].map(function (param, i) { + return (i << 1); + }) }; }) - ], - tl: { - hd: [ - "map", - (function (param) { - return { - TAG: "Eq", - _0: [ - 0, - 2, - 4, - 6 - ], - _1: [ - 1, - 2, - 3, - 4 - ].map(function (param, i) { - return (i << 1); - }) - }; - }) ], tl: { hd: [ "reduce", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((function (acc, n) { - return acc - n | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: [ + 1, + 2, + 3, + 4 + ].reduce((function (acc, n) { + return acc - n | 0; + }), 0) + }; + }) ], tl: { hd: [ "reducei", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduce((function (acc, param, i) { - return acc - i | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: [ + 1, + 2, + 3, + 4 + ].reduce((function (acc, param, i) { + return acc - i | 0; + }), 0) + }; + }) ], tl: { hd: [ "reduceRight", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((function (acc, n) { - return acc - n | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: [ + 1, + 2, + 3, + 4 + ].reduceRight((function (acc, n) { + return acc - n | 0; + }), 0) + }; + }) ], tl: { hd: [ "reduceRighti", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: [ - 1, - 2, - 3, - 4 - ].reduceRight((function (acc, param, i) { - return acc - i | 0; - }), 0) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: [ + 1, + 2, + 3, + 4 + ].reduceRight((function (acc, param, i) { + return acc - i | 0; + }), 0) + }; + }) ], tl: { hd: [ "some", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: [ - 1, - 2, - 3, - 4 - ].some(function (n) { - return n <= 0; - }) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: [ + 1, + 2, + 3, + 4 + ].some(function (n) { + return n <= 0; + }) + }; + }) ], tl: { hd: [ "somei", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: [ - 1, - 2, - 3, - 4 - ].some(function (param, i) { - return i <= 0; - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: [ + 1, + 2, + 3, + 4 + ].some(function (param, i) { + return i <= 0; + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_bool_test.js b/jscomp/test/js_bool_test.js index 5afc6af95a..cde1d0b4e4 100644 --- a/jscomp/test/js_bool_test.js +++ b/jscomp/test/js_bool_test.js @@ -34,35 +34,35 @@ var v = true; var suites_0 = [ "?bool_eq_caml_bool", (function (param) { - return { - TAG: "Eq", - _0: u, - _1: true - }; - }) + return { + TAG: "Eq", + _0: u, + _1: true + }; + }) ]; var suites_1 = { hd: [ "js_bool_eq_js_bool", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: true - }; - }) + return { + TAG: "Eq", + _0: v, + _1: true + }; + }) ], tl: { hd: [ "js_bool_neq_acml_bool", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true === true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true === true + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_cast_test.js b/jscomp/test/js_cast_test.js index 0381b7f2a3..fd989e1ecd 100644 --- a/jscomp/test/js_cast_test.js +++ b/jscomp/test/js_cast_test.js @@ -25,12 +25,12 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } eq("File \"js_cast_test.res\", line 14, characters 12-19", true, 1); diff --git a/jscomp/test/js_date_test.js b/jscomp/test/js_date_test.js index c706003c87..d64282c5cb 100644 --- a/jscomp/test/js_date_test.js +++ b/jscomp/test/js_date_test.js @@ -11,142 +11,166 @@ function date(param) { var suites_0 = [ "valueOf", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").valueOf() + }; + }) ]; var suites_1 = { hd: [ "make", (function (param) { - return { - TAG: "Ok", - _0: new Date().getTime() > 1487223505382 - }; - }) + return { + TAG: "Ok", + _0: new Date().getTime() > 1487223505382 + }; + }) ], tl: { hd: [ "parseAsFloat", (function (param) { - return { - TAG: "Eq", - _0: Date.parse("1976-03-08T12:34:56.789+01:23"), - _1: 195131516789 - }; - }) + return { + TAG: "Eq", + _0: Date.parse("1976-03-08T12:34:56.789+01:23"), + _1: 195131516789 + }; + }) ], tl: { hd: [ "parseAsFloat_invalid", (function (param) { - return { - TAG: "Ok", - _0: Number.isNaN(Date.parse("gibberish")) - }; - }) + return { + TAG: "Ok", + _0: Number.isNaN(Date.parse("gibberish")) + }; + }) ], tl: { hd: [ "fromFloat", (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date(195131516789).toISOString() - }; - }) + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date(195131516789).toISOString() + }; + }) ], tl: { hd: [ "fromString_valid", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + }; + }) ], tl: { hd: [ "fromString_invalid", (function (param) { - return { - TAG: "Ok", - _0: Number.isNaN(new Date("gibberish").getTime()) - }; - }) + return { + TAG: "Ok", + _0: Number.isNaN(new Date("gibberish").getTime()) + }; + }) ], tl: { hd: [ "makeWithYM", (function (param) { - var d = new Date(1984, 4); + var d = new Date(1984, 4); + return { + TAG: "Eq", + _0: [ + 1984, + 4 + ], + _1: [ + d.getFullYear(), + d.getMonth() + ] + }; + }) + ], + tl: { + hd: [ + "makeWithYMD", + (function (param) { + var d = new Date(1984, 4, 6); return { TAG: "Eq", _0: [ 1984, - 4 + 4, + 6 ], _1: [ d.getFullYear(), - d.getMonth() + d.getMonth(), + d.getDate() ] }; }) - ], - tl: { - hd: [ - "makeWithYMD", - (function (param) { - var d = new Date(1984, 4, 6); + ], + tl: { + hd: [ + "makeWithYMDH", + (function (param) { + var d = new Date(1984, 4, 6, 3); return { TAG: "Eq", _0: [ 1984, 4, - 6 + 6, + 3 ], _1: [ d.getFullYear(), d.getMonth(), - d.getDate() + d.getDate(), + d.getHours() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDH", - (function (param) { - var d = new Date(1984, 4, 6, 3); + ], + tl: { + hd: [ + "makeWithYMDHM", + (function (param) { + var d = new Date(1984, 4, 6, 3, 59); return { TAG: "Eq", _0: [ 1984, 4, 6, - 3 + 3, + 59 ], _1: [ d.getFullYear(), d.getMonth(), d.getDate(), - d.getHours() + d.getHours(), + d.getMinutes() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDHM", - (function (param) { - var d = new Date(1984, 4, 6, 3, 59); + ], + tl: { + hd: [ + "makeWithYMDHMS", + (function (param) { + var d = new Date(1984, 4, 6, 3, 59, 27); return { TAG: "Eq", _0: [ @@ -154,89 +178,88 @@ var suites_1 = { 4, 6, 3, - 59 + 59, + 27 ], _1: [ d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), - d.getMinutes() + d.getMinutes(), + d.getSeconds() ] }; }) - ], - tl: { - hd: [ - "makeWithYMDHMS", - (function (param) { - var d = new Date(1984, 4, 6, 3, 59, 27); + ], + tl: { + hd: [ + "utcWithYM", + (function (param) { + var d = Date.UTC(1984, 4); + var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, - 4, - 6, - 3, - 59, - 27 + 4 ], _1: [ - d.getFullYear(), - d.getMonth(), - d.getDate(), - d.getHours(), - d.getMinutes(), - d.getSeconds() + d$1.getUTCFullYear(), + d$1.getUTCMonth() ] }; }) - ], - tl: { - hd: [ - "utcWithYM", - (function (param) { - var d = Date.UTC(1984, 4); + ], + tl: { + hd: [ + "utcWithYMD", + (function (param) { + var d = Date.UTC(1984, 4, 6); var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, - 4 + 4, + 6 ], _1: [ d$1.getUTCFullYear(), - d$1.getUTCMonth() + d$1.getUTCMonth(), + d$1.getUTCDate() ] }; }) - ], - tl: { - hd: [ - "utcWithYMD", - (function (param) { - var d = Date.UTC(1984, 4, 6); + ], + tl: { + hd: [ + "utcWithYMDH", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3); var d$1 = new Date(d); return { TAG: "Eq", _0: [ 1984, 4, - 6 + 6, + 3 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), - d$1.getUTCDate() + d$1.getUTCDate(), + d$1.getUTCHours() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDH", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3); + ], + tl: { + hd: [ + "utcWithYMDHM", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3, 59); var d$1 = new Date(d); return { TAG: "Eq", @@ -244,22 +267,24 @@ var suites_1 = { 1984, 4, 6, - 3 + 3, + 59 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), d$1.getUTCDate(), - d$1.getUTCHours() + d$1.getUTCHours(), + d$1.getUTCMinutes() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDHM", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3, 59); + ], + tl: { + hd: [ + "utcWithYMDHMS", + (function (param) { + var d = Date.UTC(1984, 4, 6, 3, 59, 27); var d$1 = new Date(d); return { TAG: "Eq", @@ -268,764 +293,739 @@ var suites_1 = { 4, 6, 3, - 59 + 59, + 27 ], _1: [ d$1.getUTCFullYear(), d$1.getUTCMonth(), d$1.getUTCDate(), d$1.getUTCHours(), - d$1.getUTCMinutes() + d$1.getUTCMinutes(), + d$1.getUTCSeconds() ] }; }) - ], - tl: { - hd: [ - "utcWithYMDHMS", - (function (param) { - var d = Date.UTC(1984, 4, 6, 3, 59, 27); - var d$1 = new Date(d); - return { - TAG: "Eq", - _0: [ - 1984, - 4, - 6, - 3, - 59, - 27 - ], - _1: [ - d$1.getUTCFullYear(), - d$1.getUTCMonth(), - d$1.getUTCDate(), - d$1.getUTCHours(), - d$1.getUTCMinutes(), - d$1.getUTCSeconds() - ] - }; - }) ], tl: { hd: [ "getFullYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + }; + }) ], tl: { hd: [ "getMilliseconds", (function (param) { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() - }; - }) + return { + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getMilliseconds() + }; + }) ], tl: { hd: [ "getSeconds", (function (param) { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() - }; - }) + return { + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getSeconds() + }; + }) ], tl: { hd: [ "getTime", (function (param) { - return { - TAG: "Eq", - _0: 195131516789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() - }; - }) + return { + TAG: "Eq", + _0: 195131516789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getTime() + }; + }) ], tl: { hd: [ "getUTCDate", (function (param) { - return { - TAG: "Eq", - _0: 8, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() - }; - }) + return { + TAG: "Eq", + _0: 8, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDate() + }; + }) ], tl: { hd: [ "getUTCDay", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCDay() + }; + }) ], tl: { hd: [ "getUTCFUllYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCFullYear() + }; + }) ], tl: { hd: [ "getUTCHours", (function (param) { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() - }; - }) + return { + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCHours() + }; + }) ], tl: { hd: [ "getUTCMilliseconds", (function (param) { - return { - TAG: "Eq", - _0: 789, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() - }; - }) + return { + TAG: "Eq", + _0: 789, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMilliseconds() + }; + }) ], tl: { hd: [ "getUTCMinutes", (function (param) { - return { - TAG: "Eq", - _0: 11, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() - }; - }) + return { + TAG: "Eq", + _0: 11, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMinutes() + }; + }) ], tl: { hd: [ "getUTCMonth", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCMonth() + }; + }) ], tl: { hd: [ "getUTCSeconds", (function (param) { - return { - TAG: "Eq", - _0: 56, - _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() - }; - }) + return { + TAG: "Eq", + _0: 56, + _1: new Date("1976-03-08T12:34:56.789+01:23").getUTCSeconds() + }; + }) ], tl: { hd: [ "getYear", (function (param) { - return { - TAG: "Eq", - _0: 1976, - _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() - }; - }) + return { + TAG: "Eq", + _0: 1976, + _1: new Date("1976-03-08T12:34:56.789+01:23").getFullYear() + }; + }) ], tl: { hd: [ "setDate", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setDate(12); - return { - TAG: "Eq", - _0: 12, - _1: d.getDate() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setDate(12); + return { + TAG: "Eq", + _0: 12, + _1: d.getDate() + }; + }) ], tl: { hd: [ "setFullYear", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986); - return { - TAG: "Eq", - _0: 1986, - _1: d.getFullYear() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setFullYear(1986); + return { + TAG: "Eq", + _0: 1986, + _1: d.getFullYear() + }; + }) ], tl: { hd: [ "setFullYearM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setFullYear(1986, 7); + return { + TAG: "Eq", + _0: [ + 1986, + 7 + ], + _1: [ + d.getFullYear(), + d.getMonth() + ] + }; + }) + ], + tl: { + hd: [ + "setFullYearMD", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986, 7); + d.setFullYear(1986, 7, 23); return { TAG: "Eq", _0: [ 1986, - 7 + 7, + 23 ], _1: [ d.getFullYear(), - d.getMonth() + d.getMonth(), + d.getDate() ] }; }) - ], - tl: { - hd: [ - "setFullYearMD", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setFullYear(1986, 7, 23); - return { - TAG: "Eq", - _0: [ - 1986, - 7, - 23 - ], - _1: [ - d.getFullYear(), - d.getMonth(), - d.getDate() - ] - }; - }) ], tl: { hd: [ "setHours", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22); - return { - TAG: "Eq", - _0: 22, - _1: d.getHours() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setHours(22); + return { + TAG: "Eq", + _0: 22, + _1: d.getHours() + }; + }) ], tl: { hd: [ "setHoursM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setHours(22, 48); + return { + TAG: "Eq", + _0: [ + 22, + 48 + ], + _1: [ + d.getHours(), + d.getMinutes() + ] + }; + }) + ], + tl: { + hd: [ + "setHoursMS", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22, 48); + d.setHours(22, 48, 54); return { TAG: "Eq", _0: [ 22, - 48 + 48, + 54 ], _1: [ d.getHours(), - d.getMinutes() + d.getMinutes(), + d.getSeconds() ] }; }) - ], - tl: { - hd: [ - "setHoursMS", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setHours(22, 48, 54); - return { - TAG: "Eq", - _0: [ - 22, - 48, - 54 - ], - _1: [ - d.getHours(), - d.getMinutes(), - d.getSeconds() - ] - }; - }) ], tl: { hd: [ "setMilliseconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMilliseconds(543); - return { - TAG: "Eq", - _0: 543, - _1: d.getMilliseconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMilliseconds(543); + return { + TAG: "Eq", + _0: 543, + _1: d.getMilliseconds() + }; + }) ], tl: { hd: [ "setMinutes", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18); - return { - TAG: "Eq", - _0: 18, - _1: d.getMinutes() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMinutes(18); + return { + TAG: "Eq", + _0: 18, + _1: d.getMinutes() + }; + }) ], tl: { hd: [ "setMinutesS", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMinutes(18, 42); + return { + TAG: "Eq", + _0: [ + 18, + 42 + ], + _1: [ + d.getMinutes(), + d.getSeconds() + ] + }; + }) + ], + tl: { + hd: [ + "setMinutesSMs", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18, 42); + d.setMinutes(18, 42, 311); return { TAG: "Eq", _0: [ 18, - 42 + 42, + 311 ], _1: [ d.getMinutes(), - d.getSeconds() + d.getSeconds(), + d.getMilliseconds() ] }; }) - ], - tl: { - hd: [ - "setMinutesSMs", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMinutes(18, 42, 311); - return { - TAG: "Eq", - _0: [ - 18, - 42, - 311 - ], - _1: [ - d.getMinutes(), - d.getSeconds(), - d.getMilliseconds() - ] - }; - }) ], tl: { hd: [ "setMonth", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMonth(10); - return { - TAG: "Eq", - _0: 10, - _1: d.getMonth() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMonth(10); + return { + TAG: "Eq", + _0: 10, + _1: d.getMonth() + }; + }) ], tl: { hd: [ "setMonthD", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setMonth(10, 14); - return { - TAG: "Eq", - _0: [ - 10, - 14 - ], - _1: [ - d.getMonth(), - d.getDate() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setMonth(10, 14); + return { + TAG: "Eq", + _0: [ + 10, + 14 + ], + _1: [ + d.getMonth(), + d.getDate() + ] + }; + }) ], tl: { hd: [ "setSeconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setSeconds(36); - return { - TAG: "Eq", - _0: 36, - _1: d.getSeconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setSeconds(36); + return { + TAG: "Eq", + _0: 36, + _1: d.getSeconds() + }; + }) ], tl: { hd: [ "setSecondsMs", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setSeconds(36, 420); - return { - TAG: "Eq", - _0: [ - 36, - 420 - ], - _1: [ - d.getSeconds(), - d.getMilliseconds() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setSeconds(36, 420); + return { + TAG: "Eq", + _0: [ + 36, + 420 + ], + _1: [ + d.getSeconds(), + d.getMilliseconds() + ] + }; + }) ], tl: { hd: [ "setUTCDate", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCDate(12); - return { - TAG: "Eq", - _0: 12, - _1: d.getUTCDate() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCDate(12); + return { + TAG: "Eq", + _0: 12, + _1: d.getUTCDate() + }; + }) ], tl: { hd: [ "setUTCFullYear", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986); - return { - TAG: "Eq", - _0: 1986, - _1: d.getUTCFullYear() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCFullYear(1986); + return { + TAG: "Eq", + _0: 1986, + _1: d.getUTCFullYear() + }; + }) ], tl: { hd: [ "setUTCFullYearM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCFullYear(1986, 7); + return { + TAG: "Eq", + _0: [ + 1986, + 7 + ], + _1: [ + d.getUTCFullYear(), + d.getUTCMonth() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCFullYearMD", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986, 7); + d.setUTCFullYear(1986, 7, 23); return { TAG: "Eq", _0: [ 1986, - 7 + 7, + 23 ], _1: [ d.getUTCFullYear(), - d.getUTCMonth() + d.getUTCMonth(), + d.getUTCDate() ] }; }) - ], - tl: { - hd: [ - "setUTCFullYearMD", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCFullYear(1986, 7, 23); - return { - TAG: "Eq", - _0: [ - 1986, - 7, - 23 - ], - _1: [ - d.getUTCFullYear(), - d.getUTCMonth(), - d.getUTCDate() - ] - }; - }) ], tl: { hd: [ "setUTCHours", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22); - return { - TAG: "Eq", - _0: 22, - _1: d.getUTCHours() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCHours(22); + return { + TAG: "Eq", + _0: 22, + _1: d.getUTCHours() + }; + }) ], tl: { hd: [ "setUTCHoursM", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCHours(22, 48); + return { + TAG: "Eq", + _0: [ + 22, + 48 + ], + _1: [ + d.getUTCHours(), + d.getUTCMinutes() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCHoursMS", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22, 48); + d.setUTCHours(22, 48, 54); return { TAG: "Eq", _0: [ 22, - 48 + 48, + 54 ], _1: [ d.getUTCHours(), - d.getUTCMinutes() + d.getUTCMinutes(), + d.getUTCSeconds() ] }; }) - ], - tl: { - hd: [ - "setUTCHoursMS", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCHours(22, 48, 54); - return { - TAG: "Eq", - _0: [ - 22, - 48, - 54 - ], - _1: [ - d.getUTCHours(), - d.getUTCMinutes(), - d.getUTCSeconds() - ] - }; - }) ], tl: { hd: [ "setUTCMilliseconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMilliseconds(543); - return { - TAG: "Eq", - _0: 543, - _1: d.getUTCMilliseconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMilliseconds(543); + return { + TAG: "Eq", + _0: 543, + _1: d.getUTCMilliseconds() + }; + }) ], tl: { hd: [ "setUTCMinutes", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18); - return { - TAG: "Eq", - _0: 18, - _1: d.getUTCMinutes() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMinutes(18); + return { + TAG: "Eq", + _0: 18, + _1: d.getUTCMinutes() + }; + }) ], tl: { hd: [ "setUTCMinutesS", (function (param) { + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMinutes(18, 42); + return { + TAG: "Eq", + _0: [ + 18, + 42 + ], + _1: [ + d.getUTCMinutes(), + d.getUTCSeconds() + ] + }; + }) + ], + tl: { + hd: [ + "setUTCMinutesSMs", + (function (param) { var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18, 42); + d.setUTCMinutes(18, 42, 311); return { TAG: "Eq", _0: [ 18, - 42 + 42, + 311 ], _1: [ d.getUTCMinutes(), - d.getUTCSeconds() + d.getUTCSeconds(), + d.getUTCMilliseconds() ] }; }) - ], - tl: { - hd: [ - "setUTCMinutesSMs", - (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMinutes(18, 42, 311); - return { - TAG: "Eq", - _0: [ - 18, - 42, - 311 - ], - _1: [ - d.getUTCMinutes(), - d.getUTCSeconds(), - d.getUTCMilliseconds() - ] - }; - }) ], tl: { hd: [ "setUTCMonth", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMonth(10); - return { - TAG: "Eq", - _0: 10, - _1: d.getUTCMonth() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMonth(10); + return { + TAG: "Eq", + _0: 10, + _1: d.getUTCMonth() + }; + }) ], tl: { hd: [ "setUTCMonthD", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCMonth(10, 14); - return { - TAG: "Eq", - _0: [ - 10, - 14 - ], - _1: [ - d.getUTCMonth(), - d.getUTCDate() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCMonth(10, 14); + return { + TAG: "Eq", + _0: [ + 10, + 14 + ], + _1: [ + d.getUTCMonth(), + d.getUTCDate() + ] + }; + }) ], tl: { hd: [ "setUTCSeconds", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCSeconds(36); - return { - TAG: "Eq", - _0: 36, - _1: d.getUTCSeconds() - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCSeconds(36); + return { + TAG: "Eq", + _0: 36, + _1: d.getUTCSeconds() + }; + }) ], tl: { hd: [ "setUTCSecondsMs", (function (param) { - var d = new Date("1976-03-08T12:34:56.789+01:23"); - d.setUTCSeconds(36, 420); - return { - TAG: "Eq", - _0: [ - 36, - 420 - ], - _1: [ - d.getUTCSeconds(), - d.getUTCMilliseconds() - ] - }; - }) + var d = new Date("1976-03-08T12:34:56.789+01:23"); + d.setUTCSeconds(36, 420); + return { + TAG: "Eq", + _0: [ + 36, + 420 + ], + _1: [ + d.getUTCSeconds(), + d.getUTCMilliseconds() + ] + }; + }) ], tl: { hd: [ "toDateString", (function (param) { - return { - TAG: "Eq", - _0: "Mon Mar 08 1976", - _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() - }; - }) + return { + TAG: "Eq", + _0: "Mon Mar 08 1976", + _1: new Date("1976-03-08T12:34:56.789+01:23").toDateString() + }; + }) ], tl: { hd: [ "toGMTString", (function (param) { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + return { + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + }; + }) ], tl: { hd: [ "toISOString", (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() - }; - }) + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toISOString() + }; + }) ], tl: { hd: [ "toJSON", (function (param) { + return { + TAG: "Eq", + _0: "1976-03-08T11:11:56.789Z", + _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() + }; + }) + ], + tl: { + hd: [ + "toJSONUnsafe", + (function (param) { return { TAG: "Eq", _0: "1976-03-08T11:11:56.789Z", _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() }; }) - ], - tl: { - hd: [ - "toJSONUnsafe", - (function (param) { - return { - TAG: "Eq", - _0: "1976-03-08T11:11:56.789Z", - _1: new Date("1976-03-08T12:34:56.789+01:23").toJSON() - }; - }) ], tl: { hd: [ "toUTCString", (function (param) { - return { - TAG: "Eq", - _0: "Mon, 08 Mar 1976 11:11:56 GMT", - _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() - }; - }) + return { + TAG: "Eq", + _0: "Mon, 08 Mar 1976 11:11:56 GMT", + _1: new Date("1976-03-08T12:34:56.789+01:23").toUTCString() + }; + }) ], tl: { hd: [ "eq", (function (param) { - var a = new Date("2013-03-01T01:10:00"); - var b = new Date("2013-03-01T01:10:00"); - var c = new Date("2013-03-01T01:10:01"); - return { - TAG: "Ok", - _0: Caml_obj.equal(a, b) && Caml_obj.notequal(b, c) && Caml_obj.greaterthan(c, b) - }; - }) + var a = new Date("2013-03-01T01:10:00"); + var b = new Date("2013-03-01T01:10:00"); + var c = new Date("2013-03-01T01:10:01"); + return { + TAG: "Ok", + _0: Caml_obj.equal(a, b) && Caml_obj.notequal(b, c) && Caml_obj.greaterthan(c, b) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_dict_test.js b/jscomp/test/js_dict_test.js index 0453098f94..a09304d2a0 100644 --- a/jscomp/test/js_dict_test.js +++ b/jscomp/test/js_dict_test.js @@ -14,230 +14,230 @@ function obj(param) { var suites_0 = [ "empty", (function (param) { - return { - TAG: "Eq", - _0: [], - _1: Object.keys({}) - }; - }) + return { + TAG: "Eq", + _0: [], + _1: Object.keys({}) + }; + }) ]; var suites_1 = { hd: [ "get", (function (param) { - return { - TAG: "Eq", - _0: 43, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "foo") - }; - }) + return { + TAG: "Eq", + _0: 43, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "foo") + }; + }) ], tl: { hd: [ "get - property not in object", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_dict.get({ - foo: 43, - bar: 86 - }, "baz") - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_dict.get({ + foo: 43, + bar: 86 + }, "baz") + }; + }) ], tl: { hd: [ "unsafe_get", (function (param) { - return { - TAG: "Eq", - _0: 43, - _1: ({ - foo: 43, - bar: 86 - })["foo"] - }; - }) + return { + TAG: "Eq", + _0: 43, + _1: ({ + foo: 43, + bar: 86 + })["foo"] + }; + }) ], tl: { hd: [ "set", (function (param) { - var o = { - foo: 43, - bar: 86 - }; - o["foo"] = 36; - return { - TAG: "Eq", - _0: 36, - _1: Js_dict.get(o, "foo") - }; - }) + var o = { + foo: 43, + bar: 86 + }; + o["foo"] = 36; + return { + TAG: "Eq", + _0: 36, + _1: Js_dict.get(o, "foo") + }; + }) ], tl: { hd: [ "keys", (function (param) { + return { + TAG: "Eq", + _0: [ + "foo", + "bar" + ], + _1: Object.keys({ + foo: 43, + bar: 86 + }) + }; + }) + ], + tl: { + hd: [ + "entries", + (function (param) { return { TAG: "Eq", _0: [ - "foo", - "bar" + [ + "foo", + 43 + ], + [ + "bar", + 86 + ] ], - _1: Object.keys({ - foo: 43, - bar: 86 - }) + _1: Js_dict.entries({ + foo: 43, + bar: 86 + }) }; }) - ], - tl: { - hd: [ - "entries", - (function (param) { + ], + tl: { + hd: [ + "values", + (function (param) { return { TAG: "Eq", _0: [ - [ - "foo", - 43 - ], - [ - "bar", - 86 - ] + 43, + 86 ], - _1: Js_dict.entries({ - foo: 43, - bar: 86 - }) + _1: Js_dict.values({ + foo: 43, + bar: 86 + }) }; }) - ], - tl: { - hd: [ - "values", - (function (param) { - return { - TAG: "Eq", - _0: [ - 43, - 86 - ], - _1: Js_dict.values({ - foo: 43, - bar: 86 - }) - }; - }) ], tl: { hd: [ "fromList - []", (function (param) { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromList(/* [] */0) - }; - }) + return { + TAG: "Eq", + _0: {}, + _1: Js_dict.fromList(/* [] */0) + }; + }) ], tl: { hd: [ "fromList", (function (param) { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ + return { + TAG: "Eq", + _0: [ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromList({ + hd: [ + "x", + 23 + ], + tl: { + hd: [ "y", 46 - ] - ], - _1: Js_dict.entries(Js_dict.fromList({ - hd: [ - "x", - 23 - ], - tl: { - hd: [ - "y", - 46 - ], - tl: /* [] */0 - } - })) - }; - }) + ], + tl: /* [] */0 + } + })) + }; + }) ], tl: { hd: [ "fromArray - []", (function (param) { - return { - TAG: "Eq", - _0: {}, - _1: Js_dict.fromArray([]) - }; - }) + return { + TAG: "Eq", + _0: {}, + _1: Js_dict.fromArray([]) + }; + }) ], tl: { hd: [ "fromArray", (function (param) { - return { - TAG: "Eq", - _0: [ - [ - "x", - 23 - ], - [ - "y", - 46 - ] + return { + TAG: "Eq", + _0: [ + [ + "x", + 23 ], - _1: Js_dict.entries(Js_dict.fromArray([ - [ - "x", - 23 - ], - [ - "y", - 46 - ] - ])) - }; - }) + [ + "y", + 46 + ] + ], + _1: Js_dict.entries(Js_dict.fromArray([ + [ + "x", + 23 + ], + [ + "y", + 46 + ] + ])) + }; + }) ], tl: { hd: [ "map", (function (param) { - return { - TAG: "Eq", - _0: { - foo: "43", - bar: "86" - }, - _1: Js_dict.map((function (i) { - return String(i); - }), { - foo: 43, - bar: 86 - }) - }; - }) + return { + TAG: "Eq", + _0: { + foo: "43", + bar: "86" + }, + _1: Js_dict.map((function (i) { + return String(i); + }), { + foo: 43, + bar: 86 + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_exception_catch_test.js b/jscomp/test/js_exception_catch_test.js index 2bdeabb767..e3c2d95b62 100644 --- a/jscomp/test/js_exception_catch_test.js +++ b/jscomp/test/js_exception_catch_test.js @@ -29,30 +29,30 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } function false_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function true_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } var exit = 0; @@ -67,11 +67,11 @@ catch (raw_x){ var 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 (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { throw x; } @@ -79,11 +79,11 @@ catch (raw_x){ if (exit === 1) { add_test("File \"js_exception_catch_test.res\", line 19, characters 14-21", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var A = /* @__PURE__ */Caml_exceptions.create("Js_exception_catch_test.A"); @@ -130,84 +130,84 @@ function test(f) { } eq("File \"js_exception_catch_test.res\", line 44, characters 5-12", test(function (param) { - - }), "No_error"); + +}), "No_error"); eq("File \"js_exception_catch_test.res\", line 45, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - }), "Not_found"); + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; +}), "Not_found"); eq("File \"js_exception_catch_test.res\", line 46, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "x", - Error: new Error() - }; - }), "Invalid_argument"); + throw { + RE_EXN_ID: "Invalid_argument", + _1: "x", + Error: new Error() + }; +}), "Invalid_argument"); eq("File \"js_exception_catch_test.res\", line 47, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "", - Error: new Error() - }; - }), "Invalid_any"); + throw { + RE_EXN_ID: "Invalid_argument", + _1: "", + Error: new Error() + }; +}), "Invalid_any"); eq("File \"js_exception_catch_test.res\", line 48, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: A, - _1: 2, - Error: new Error() - }; - }), "A2"); + throw { + RE_EXN_ID: A, + _1: 2, + Error: new Error() + }; +}), "A2"); eq("File \"js_exception_catch_test.res\", line 49, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: A, - _1: 3, - Error: new Error() - }; - }), "A_any"); + throw { + RE_EXN_ID: A, + _1: 3, + Error: new Error() + }; +}), "A_any"); eq("File \"js_exception_catch_test.res\", line 50, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: B, - Error: new Error() - }; - }), "B"); + throw { + RE_EXN_ID: B, + Error: new Error() + }; +}), "B"); eq("File \"js_exception_catch_test.res\", line 51, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: C, - _1: 1, - _2: 2, - Error: new Error() - }; - }), "C"); + throw { + RE_EXN_ID: C, + _1: 1, + _2: 2, + Error: new Error() + }; +}), "C"); eq("File \"js_exception_catch_test.res\", line 52, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: C, - _1: 0, - _2: 2, - Error: new Error() - }; - }), "C_any"); + throw { + RE_EXN_ID: C, + _1: 0, + _2: 2, + Error: new Error() + }; +}), "C_any"); eq("File \"js_exception_catch_test.res\", line 53, characters 5-12", test(function (param) { - throw new Error("x"); - }), "Js_error"); + throw new Error("x"); +}), "Js_error"); eq("File \"js_exception_catch_test.res\", line 54, characters 5-12", test(function (param) { - throw { - RE_EXN_ID: "Failure", - _1: "x", - Error: new Error() - }; - }), "Any"); + throw { + RE_EXN_ID: "Failure", + _1: "x", + Error: new Error() + }; +}), "Any"); Mt.from_pair_suites("Js_exception_catch_test", suites.contents); diff --git a/jscomp/test/js_float_test.js b/jscomp/test/js_float_test.js index 2971a30702..fcf55631bd 100644 --- a/jscomp/test/js_float_test.js +++ b/jscomp/test/js_float_test.js @@ -7,484 +7,484 @@ var Pervasives = require("../../lib/js/pervasives.js"); var suites_0 = [ "_NaN <> _NaN", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: NaN === NaN - }; - }) + return { + TAG: "Eq", + _0: false, + _1: NaN === NaN + }; + }) ]; var suites_1 = { hd: [ "isNaN - _NaN", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(NaN) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isNaN(NaN) + }; + }) ], tl: { hd: [ "isNaN - 0.", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isNaN(0) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isNaN(0) + }; + }) ], tl: { hd: [ "isFinite - infinity", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.infinity) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.infinity) + }; + }) ], tl: { hd: [ "isFinite - neg_infinity", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(Pervasives.neg_infinity) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(Pervasives.neg_infinity) + }; + }) ], tl: { hd: [ "isFinite - _NaN", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Number.isFinite(NaN) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Number.isFinite(NaN) + }; + }) ], tl: { hd: [ "isFinite - 0.", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isFinite(0) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isFinite(0) + }; + }) ], tl: { hd: [ "toExponential", (function (param) { - return { - TAG: "Eq", - _0: "1.23456e+2", - _1: (123.456).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.23456e+2", + _1: (123.456).toExponential() + }; + }) ], tl: { hd: [ "toExponential - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toExponential() + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.23e+2", - _1: (123.456).toExponential(2) - }; - }) + return { + TAG: "Eq", + _0: "1.23e+2", + _1: (123.456).toExponential(2) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.2346e+2", - _1: (123.456).toExponential(4) - }; - }) + return { + TAG: "Eq", + _0: "1.2346e+2", + _1: (123.456).toExponential(4) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + }; + }) ], tl: { hd: [ "File \"js_float_test.res\", line 27, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(101); + }) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(-1); + }) + }; + }) ], tl: { hd: [ "toFixed", (function (param) { - return { - TAG: "Eq", - _0: "123", - _1: (123.456).toFixed() - }; - }) + return { + TAG: "Eq", + _0: "123", + _1: (123.456).toFixed() + }; + }) ], tl: { hd: [ "toFixed - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toFixed() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toFixed() + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "123.46", - _1: (123.456).toFixed(2) - }; - }) + return { + TAG: "Eq", + _0: "123.46", + _1: (123.456).toFixed(2) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "123.4560", - _1: (123.456).toFixed(4) - }; - }) + return { + TAG: "Eq", + _0: "123.4560", + _1: (123.456).toFixed(4) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000", - _1: (0).toFixed(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000", + _1: (0).toFixed(20) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:101", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toFixed(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toFixed(101); + }) + }; + }) ], tl: { hd: [ "toFixedWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toFixed(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toFixed(-1); + }) + }; + }) ], tl: { hd: [ "toPrecision", (function (param) { - return { - TAG: "Eq", - _0: "123.456", - _1: (123.456).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "123.456", + _1: (123.456).toPrecision() + }; + }) ], tl: { hd: [ "toPrecision - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toPrecision() + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+2", - _1: (123.456).toPrecision(2) - }; - }) + return { + TAG: "Eq", + _0: "1.2e+2", + _1: (123.456).toPrecision(2) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "123.5", - _1: (123.456).toPrecision(4) - }; - }) + return { + TAG: "Eq", + _0: "123.5", + _1: (123.456).toPrecision(4) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + return { + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + }; + }) ], tl: { hd: [ "File \"js_float_test.res\", line 68, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(101); + }) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(-1); + }) + }; + }) ], tl: { hd: [ "toString", (function (param) { - return { - TAG: "Eq", - _0: "1.23", - _1: (1.23).toString() - }; - }) + return { + TAG: "Eq", + _0: "1.23", + _1: (1.23).toString() + }; + }) ], tl: { hd: [ "toString - large number", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+21", - _1: (1.2e21).toString() - }; - }) + return { + TAG: "Eq", + _0: "1.2e+21", + _1: (1.2e21).toString() + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:2", (function (param) { - return { - TAG: "Eq", - _0: "1111011.0111010010111100011010100111111011111001110111", - _1: (123.456).toString(2) - }; - }) + return { + TAG: "Eq", + _0: "1111011.0111010010111100011010100111111011111001110111", + _1: (123.456).toString(2) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:16", (function (param) { - return { - TAG: "Eq", - _0: "7b.74bc6a7ef9dc", - _1: (123.456).toString(16) - }; - }) + return { + TAG: "Eq", + _0: "7b.74bc6a7ef9dc", + _1: (123.456).toString(16) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:36", (function (param) { - return { - TAG: "Eq", - _0: "3f", - _1: (123).toString(36) - }; - }) + return { + TAG: "Eq", + _0: "3f", + _1: (123).toString(36) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:37", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(37); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(37); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(1); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(-1); + }) + }; + }) ], tl: { hd: [ "fromString - 123", (function (param) { - return { - TAG: "Eq", - _0: 123, - _1: Number("123") - }; - }) + return { + TAG: "Eq", + _0: 123, + _1: Number("123") + }; + }) ], tl: { hd: [ "fromString - 12.3", (function (param) { - return { - TAG: "Eq", - _0: 12.3, - _1: Number("12.3") - }; - }) + return { + TAG: "Eq", + _0: 12.3, + _1: Number("12.3") + }; + }) ], tl: { hd: [ "fromString - empty string", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Number("") - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Number("") + }; + }) ], tl: { hd: [ "fromString - 0x11", (function (param) { - return { - TAG: "Eq", - _0: 17, - _1: Number("0x11") - }; - }) + return { + TAG: "Eq", + _0: 17, + _1: Number("0x11") + }; + }) ], tl: { hd: [ "fromString - 0b11", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Number("0b11") - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Number("0b11") + }; + }) ], tl: { hd: [ "fromString - 0o11", (function (param) { - return { - TAG: "Eq", - _0: 9, - _1: Number("0o11") - }; - }) + return { + TAG: "Eq", + _0: 9, + _1: Number("0o11") + }; + }) ], tl: { hd: [ "fromString - invalid string", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Number.isNaN(Number("foo")) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Number.isNaN(Number("foo")) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_global_test.js b/jscomp/test/js_global_test.js index c928236606..ee7af8589b 100644 --- a/jscomp/test/js_global_test.js +++ b/jscomp/test/js_global_test.js @@ -6,74 +6,74 @@ var Mt = require("./mt.js"); var suites_0 = [ "setTimeout/clearTimeout sanity check", (function (param) { - var handle = setTimeout((function (param) { - - }), 0); - clearTimeout(handle); - return { - TAG: "Ok", - _0: true - }; - }) + var handle = setTimeout((function (param) { + + }), 0); + clearTimeout(handle); + return { + TAG: "Ok", + _0: true + }; + }) ]; var suites_1 = { hd: [ "setInerval/clearInterval sanity check", (function (param) { - var handle = setInterval((function (param) { - - }), 0); - clearInterval(handle); - return { - TAG: "Ok", - _0: true - }; - }) + var handle = setInterval((function (param) { + + }), 0); + clearInterval(handle); + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "encodeURI", (function (param) { - return { - TAG: "Eq", - _0: encodeURI("[-=-]"), - _1: "%5B-=-%5D" - }; - }) + return { + TAG: "Eq", + _0: encodeURI("[-=-]"), + _1: "%5B-=-%5D" + }; + }) ], tl: { hd: [ "decodeURI", (function (param) { - return { - TAG: "Eq", - _0: decodeURI("%5B-=-%5D"), - _1: "[-=-]" - }; - }) + return { + TAG: "Eq", + _0: decodeURI("%5B-=-%5D"), + _1: "[-=-]" + }; + }) ], tl: { hd: [ "encodeURIComponent", (function (param) { - return { - TAG: "Eq", - _0: encodeURIComponent("[-=-]"), - _1: "%5B-%3D-%5D" - }; - }) + return { + TAG: "Eq", + _0: encodeURIComponent("[-=-]"), + _1: "%5B-%3D-%5D" + }; + }) ], tl: { hd: [ "decodeURIComponent", (function (param) { - return { - TAG: "Eq", - _0: decodeURIComponent("%5B-%3D-%5D"), - _1: "[-=-]" - }; - }) + return { + TAG: "Eq", + _0: decodeURIComponent("%5B-%3D-%5D"), + _1: "[-=-]" + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_int_test.js b/jscomp/test/js_int_test.js index f54b577e3e..50e533737e 100644 --- a/jscomp/test/js_int_test.js +++ b/jscomp/test/js_int_test.js @@ -6,218 +6,218 @@ var Mt = require("./mt.js"); var suites_0 = [ "toExponential", (function (param) { - return { - TAG: "Eq", - _0: "1.23456e+5", - _1: (123456).toExponential() - }; - }) + return { + TAG: "Eq", + _0: "1.23456e+5", + _1: (123456).toExponential() + }; + }) ]; var suites_1 = { hd: [ "toExponentialWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.23e+5", - _1: (123456).toExponential(2) - }; - }) + return { + TAG: "Eq", + _0: "1.23e+5", + _1: (123456).toExponential(2) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.2346e+5", - _1: (123456).toExponential(4) - }; - }) + return { + TAG: "Eq", + _0: "1.2346e+5", + _1: (123456).toExponential(4) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.00000000000000000000e+0", - _1: (0).toExponential(20) - }; - }) + return { + TAG: "Eq", + _0: "0.00000000000000000000e+0", + _1: (0).toExponential(20) + }; + }) ], tl: { hd: [ "File \"js_int_test.res\", line 19, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(101); + }) + }; + }) ], tl: { hd: [ "toExponentialWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toExponential(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toExponential(-1); + }) + }; + }) ], tl: { hd: [ "toPrecision", (function (param) { - return { - TAG: "Eq", - _0: "123456", - _1: (123456).toPrecision() - }; - }) + return { + TAG: "Eq", + _0: "123456", + _1: (123456).toPrecision() + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:2", (function (param) { - return { - TAG: "Eq", - _0: "1.2e+5", - _1: (123456).toPrecision(2) - }; - }) + return { + TAG: "Eq", + _0: "1.2e+5", + _1: (123456).toPrecision(2) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:4", (function (param) { - return { - TAG: "Eq", - _0: "1.235e+5", - _1: (123456).toPrecision(4) - }; - }) + return { + TAG: "Eq", + _0: "1.235e+5", + _1: (123456).toPrecision(4) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:20", (function (param) { - return { - TAG: "Eq", - _0: "0.0000000000000000000", - _1: (0).toPrecision(20) - }; - }) + return { + TAG: "Eq", + _0: "0.0000000000000000000", + _1: (0).toPrecision(20) + }; + }) ], tl: { hd: [ "File \"js_int_test.res\", line 37, characters 5-12", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(101); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(101); + }) + }; + }) ], tl: { hd: [ "toPrecisionWithPrecision - digits:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toPrecision(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toPrecision(-1); + }) + }; + }) ], tl: { hd: [ "toString", (function (param) { - return { - TAG: "Eq", - _0: "123", - _1: (123).toString() - }; - }) + return { + TAG: "Eq", + _0: "123", + _1: (123).toString() + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:2", (function (param) { - return { - TAG: "Eq", - _0: "11110001001000000", - _1: (123456).toString(2) - }; - }) + return { + TAG: "Eq", + _0: "11110001001000000", + _1: (123456).toString(2) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:16", (function (param) { - return { - TAG: "Eq", - _0: "1e240", - _1: (123456).toString(16) - }; - }) + return { + TAG: "Eq", + _0: "1e240", + _1: (123456).toString(16) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:36", (function (param) { - return { - TAG: "Eq", - _0: "2n9c", - _1: (123456).toString(36) - }; - }) + return { + TAG: "Eq", + _0: "2n9c", + _1: (123456).toString(36) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:37", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(37); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(37); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(1); + }) + }; + }) ], tl: { hd: [ "toStringWithRadix - radix:-1", (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - (0).toString(-1); - }) - }; - }) + return { + TAG: "ThrowAny", + _0: (function (param) { + (0).toString(-1); + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_json_test.js b/jscomp/test/js_json_test.js index e88a76d155..6b4a0e1fa8 100644 --- a/jscomp/test/js_json_test.js +++ b/jscomp/test/js_json_test.js @@ -32,99 +32,99 @@ function add_test(loc, test) { function eq(loc, x, y) { add_test(loc, (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - })); + return { + TAG: "Eq", + _0: x, + _1: y + }; + })); } function false_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function true_(loc) { add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } var v = JSON.parse(" { \"x\" : [1, 2, 3 ] } "); add_test("File \"js_json_test.res\", line 22, characters 11-18", (function (param) { - var ty = Js_json.classify(v); - if (typeof ty !== "object") { - return { - TAG: "Ok", - _0: false - }; - } - if (ty.TAG !== "JSONObject") { - return { - TAG: "Ok", - _0: false - }; - } - var v$1 = Js_dict.get(ty._0, "x"); - if (v$1 === undefined) { - return { - TAG: "Ok", - _0: false - }; - } - var ty2 = Js_json.classify(v$1); - if (typeof ty2 !== "object") { - return { - TAG: "Ok", - _0: false - }; - } - if (ty2.TAG !== "JSONArray") { - return { - TAG: "Ok", - _0: false - }; - } - ty2._0.forEach(function (x) { - var ty3 = Js_json.classify(x); - if (typeof ty3 !== "object") { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ], - Error: new Error() - }; - } - if (ty3.TAG === "JSONNumber") { - return; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "js_json_test.res", - 37, - 19 - ], - Error: new Error() - }; - }); - return { - TAG: "Ok", - _0: true - }; - })); + var ty = Js_json.classify(v); + if (typeof ty !== "object") { + return { + TAG: "Ok", + _0: false + }; + } + if (ty.TAG !== "JSONObject") { + return { + TAG: "Ok", + _0: false + }; + } + var v$1 = Js_dict.get(ty._0, "x"); + if (v$1 === undefined) { + return { + TAG: "Ok", + _0: false + }; + } + var ty2 = Js_json.classify(v$1); + if (typeof ty2 !== "object") { + return { + TAG: "Ok", + _0: false + }; + } + if (ty2.TAG !== "JSONArray") { + return { + TAG: "Ok", + _0: false + }; + } + ty2._0.forEach(function (x) { + var ty3 = Js_json.classify(x); + if (typeof ty3 !== "object") { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ], + Error: new Error() + }; + } + if (ty3.TAG === "JSONNumber") { + return; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "js_json_test.res", + 37, + 19 + ], + Error: new Error() + }; + }); + return { + TAG: "Ok", + _0: true + }; +})); eq("File \"js_json_test.res\", line 48, characters 5-12", Js_json.test(v, "Object"), true); @@ -135,28 +135,28 @@ var ty = Js_json.classify(json); if (typeof ty !== "object") { if (ty === "JSONNull") { add_test("File \"js_json_test.res\", line 55, characters 24-31", (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { console.log(ty); add_test("File \"js_json_test.res\", line 58, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { console.log(ty); add_test("File \"js_json_test.res\", line 58, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$1 = JSON.parse(JSON.stringify("test string")); @@ -165,20 +165,20 @@ var ty$1 = Js_json.classify(json$1); if (typeof ty$1 !== "object") { add_test("File \"js_json_test.res\", line 68, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONString") { eq("File \"js_json_test.res\", line 67, characters 26-33", ty$1._0, "test string"); } else { add_test("File \"js_json_test.res\", line 68, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$2 = JSON.parse(JSON.stringify(1.23456789)); @@ -195,11 +195,11 @@ if (typeof ty$2 !== "object" || ty$2.TAG !== "JSONNumber") { if (exit === 1) { add_test("File \"js_json_test.res\", line 78, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var json$3 = JSON.parse(JSON.stringify(-1347440721)); @@ -216,11 +216,11 @@ if (typeof ty$3 !== "object" || ty$3.TAG !== "JSONNumber") { if (exit$1 === 1) { add_test("File \"js_json_test.res\", line 88, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function test(v) { @@ -228,11 +228,11 @@ function test(v) { var ty = Js_json.classify(json); if (typeof ty === "object") { return add_test("File \"js_json_test.res\", line 100, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } switch (ty) { case "JSONFalse" : @@ -241,11 +241,11 @@ function test(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 (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } @@ -280,173 +280,173 @@ var ty$4 = Js_json.classify(json$4); if (typeof ty$4 !== "object") { add_test("File \"js_json_test.res\", line 142, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$4.TAG === "JSONObject") { var x = ty$4._0; var ta = Js_json.classify(option_get(Js_dict.get(x, "a"))); if (typeof ta !== "object") { add_test("File \"js_json_test.res\", line 140, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ta.TAG === "JSONString") { if (ta._0 !== "test string") { add_test("File \"js_json_test.res\", line 131, characters 15-22", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else { var ty$5 = Js_json.classify(option_get(Js_dict.get(x, "b"))); if (typeof ty$5 !== "object") { add_test("File \"js_json_test.res\", line 137, characters 22-29", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$5.TAG === "JSONNumber") { var b = ty$5._0; add_test("File \"js_json_test.res\", line 136, characters 38-45", (function (param) { - return { - TAG: "Approx", - _0: 123.0, - _1: b - }; - })); + return { + TAG: "Approx", + _0: 123.0, + _1: b + }; + })); } else { add_test("File \"js_json_test.res\", line 137, characters 22-29", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } } else { add_test("File \"js_json_test.res\", line 140, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 142, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } function eq_at_i(loc, json, i, kind, expected) { var ty = Js_json.classify(json); if (typeof ty !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } if (ty.TAG !== "JSONArray") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } var 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 (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONString") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Number" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONNumber") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Object" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONObject") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Array" : if (typeof ty$1 !== "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$1.TAG === "JSONArray") { return eq(loc, ty$1._0, expected); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Boolean" : if (typeof ty$1 === "object") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } switch (ty$1) { case "JSONFalse" : @@ -455,48 +455,48 @@ function eq_at_i(loc, json, i, kind, expected) { return eq(loc, true, expected); default: return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } case "Null" : if (typeof ty$1 !== "object") { if (ty$1 === "JSONNull") { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { return add_test(loc, (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } } var json$5 = JSON.parse(JSON.stringify($$Array.map((function (prim) { - return prim; - }), [ - "string 0", - "string 1", - "string 2" - ]))); + return prim; +}), [ + "string 0", + "string 1", + "string 2" +]))); eq_at_i("File \"js_json_test.res\", line 199, characters 10-17", json$5, 0, "String", "string 0"); @@ -505,10 +505,10 @@ eq_at_i("File \"js_json_test.res\", line 200, characters 10-17", json$5, 1, "Str eq_at_i("File \"js_json_test.res\", line 201, characters 10-17", json$5, 2, "String", "string 2"); var json$6 = JSON.parse(JSON.stringify([ - "string 0", - "string 1", - "string 2" - ])); + "string 0", + "string 1", + "string 2" +])); eq_at_i("File \"js_json_test.res\", line 208, characters 10-17", json$6, 0, "String", "string 0"); @@ -537,8 +537,8 @@ var a$1 = [ ]; var json$8 = JSON.parse(JSON.stringify($$Array.map((function (prim) { - return prim; - }), a$1))); + return prim; +}), a$1))); eq_at_i("File \"js_json_test.res\", line 230, characters 10-17", json$8, 0, "Number", Caml_array.get(a$1, 0)); @@ -578,87 +578,87 @@ var ty$6 = Js_json.classify(json$10); if (typeof ty$6 !== "object") { add_test("File \"js_json_test.res\", line 271, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$6.TAG === "JSONArray") { var ty$7 = Js_json.classify(Caml_array.get(ty$6._0, 1)); if (typeof ty$7 !== "object") { add_test("File \"js_json_test.res\", line 269, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$7.TAG === "JSONObject") { var ty$8 = Js_json.classify(option_get(Js_dict.get(ty$7._0, "a"))); if (typeof ty$8 !== "object") { add_test("File \"js_json_test.res\", line 267, characters 20-27", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } else if (ty$8.TAG === "JSONString") { eq("File \"js_json_test.res\", line 266, characters 35-42", ty$8._0, "bbb"); } else { add_test("File \"js_json_test.res\", line 267, characters 20-27", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 269, characters 18-25", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } } else { add_test("File \"js_json_test.res\", line 271, characters 16-23", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } try { JSON.parse("{{ A}"); add_test("File \"js_json_test.res\", line 279, characters 11-18", (function (param) { - return { - TAG: "Ok", - _0: false - }; - })); + return { + TAG: "Ok", + _0: false + }; + })); } catch (exn){ add_test("File \"js_json_test.res\", line 281, characters 17-24", (function (param) { - return { - TAG: "Ok", - _0: true - }; - })); + return { + TAG: "Ok", + _0: true + }; + })); } eq("File \"js_json_test.res\", line 287, characters 12-19", JSON.stringify([ - 1, - 2, - 3 - ]), "[1,2,3]"); + 1, + 2, + 3 +]), "[1,2,3]"); eq("File \"js_json_test.res\", line 290, characters 2-9", JSON.stringify({ - foo: 1, - bar: "hello", - baz: { - baaz: 10 - } - }), "{\"foo\":1,\"bar\":\"hello\",\"baz\":{\"baaz\":10}}"); + foo: 1, + bar: "hello", + baz: { + baaz: 10 + } +}), "{\"foo\":1,\"bar\":\"hello\",\"baz\":{\"baaz\":10}}"); eq("File \"js_json_test.res\", line 295, characters 12-19", JSON.stringify(null), "null"); @@ -747,29 +747,29 @@ function idtest(obj) { idtest(undefined); idtest({ - hd: [ - undefined, - undefined, - undefined - ], - tl: /* [] */0 - }); + hd: [ + undefined, + undefined, + undefined + ], + tl: /* [] */0 +}); idtest(Belt_List.makeBy(500, (function (i) { - if (i % 2 === 0) { - return; - } else { - return 1; - } - }))); + if (i % 2 === 0) { + return; + } else { + return 1; + } +}))); idtest(Belt_Array.makeBy(500, (function (i) { - if (i % 2 === 0) { - return; - } else { - return 1; - } - }))); + if (i % 2 === 0) { + return; + } else { + return 1; + } +}))); Mt.from_pair_suites("Js_json_test", suites.contents); diff --git a/jscomp/test/js_list_test.js b/jscomp/test/js_list_test.js index 3a000f0c19..acfb0db176 100644 --- a/jscomp/test/js_list_test.js +++ b/jscomp/test/js_list_test.js @@ -19,159 +19,159 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"js_list_test.res\", line 11, characters 4-11", Js_list.flatten({ - hd: { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, + hd: { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }, + tl: { + hd: { + hd: 3, + tl: /* [] */0 + }, + tl: { + hd: /* [] */0, + tl: { + hd: { + hd: 1, tl: { - hd: { + hd: 2, + tl: { hd: 3, tl: /* [] */0 - }, - tl: { - hd: /* [] */0, - tl: { - hd: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }, - tl: /* [] */0 - } } } - }), { - hd: 1, + }, + tl: /* [] */0 + } + } + } +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 1, tl: { - hd: 3, + hd: 2, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } + hd: 3, + tl: /* [] */0 } } } - }); + } + } +}); eq("File \"js_list_test.res\", line 15, characters 5-12", Js_list.filterMap((function (x) { - if (x % 2 === 0) { - return x; - } - - }), { - hd: 1, + if (x % 2 === 0) { + return x; + } + +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: { - hd: 7, - tl: /* [] */0 - } - } - } - } + hd: 7, + tl: /* [] */0 } } - }), { - hd: 2, - tl: { - hd: 4, - tl: { - hd: 6, - tl: /* [] */0 } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}); eq("File \"js_list_test.res\", line 22, characters 5-12", Js_list.filterMap((function (x) { - if (x % 2 === 0) { - return x; - } - - }), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } - } - }), { - hd: 2, + if (x % 2 === 0) { + return x; + } + +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { hd: 4, tl: { - hd: 6, - tl: /* [] */0 + hd: 5, + tl: { + hd: 6, + tl: /* [] */0 + } } } - }); + } + } +}), { + hd: 2, + tl: { + hd: 4, + tl: { + hd: 6, + tl: /* [] */0 + } + } +}); eq("File \"js_list_test.res\", line 29, characters 5-12", Js_list.countBy((function (x) { - return x % 2 === 0; - }), { - hd: 1, + return x % 2 === 0; +}), { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: { - hd: 5, - tl: { - hd: 6, - tl: /* [] */0 - } - } - } - } + hd: 6, + tl: /* [] */0 } - }), 3); + } + } + } + } +}), 3); function f(i) { return i; @@ -180,23 +180,23 @@ function f(i) { var v = Js_vector.toList(Js_vector.init(100000, f)); eq("File \"js_list_test.res\", line 31, characters 5-12", Js_list.countBy((function (x) { - return x % 2 === 0; - }), v), 50000); + return x % 2 === 0; +}), v), 50000); var vv = Js_list.foldRight((function (x, y) { - return { - hd: x, - tl: y - }; - }), v, /* [] */0); + return { + hd: x, + tl: y + }; +}), v, /* [] */0); eq("File \"js_list_test.res\", line 33, characters 5-12", true, Js_list.equal((function (x, y) { - return x === y; - }), v, vv)); + return x === y; +}), v, vv)); var vvv = Js_list.filter((function (x) { - return x % 10 === 0; - }), vv); + return x % 10 === 0; +}), vv); eq("File \"js_list_test.res\", line 36, characters 5-12", Js_list.length(vvv), 10000); @@ -205,8 +205,8 @@ function f$1(x) { } eq("File \"js_list_test.res\", line 37, characters 5-12", true, Js_list.equal((function (x, y) { - return x === y; - }), vvv, Js_vector.toList(Js_vector.init(10000, f$1)))); + return x === y; +}), vvv, Js_vector.toList(Js_vector.init(10000, f$1)))); Mt.from_pair_suites("Js_list_test", suites.contents); diff --git a/jscomp/test/js_math_test.js b/jscomp/test/js_math_test.js index 514952a094..b7ca5e9810 100644 --- a/jscomp/test/js_math_test.js +++ b/jscomp/test/js_math_test.js @@ -7,670 +7,670 @@ var Js_math = require("../../lib/js/js_math.js"); var suites_0 = [ "_E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.718, - _2: Math.E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.718, + _2: Math.E + }; + }) ]; var suites_1 = { hd: [ "_LN2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.693, - _2: Math.LN2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.693, + _2: Math.LN2 + }; + }) ], tl: { hd: [ "_LN10", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 2.303, - _2: Math.LN10 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 2.303, + _2: Math.LN10 + }; + }) ], tl: { hd: [ "_LOG2E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.443, - _2: Math.LOG2E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.443, + _2: Math.LOG2E + }; + }) ], tl: { hd: [ "_LOG10E", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.434, - _2: Math.LOG10E - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.434, + _2: Math.LOG10E + }; + }) ], tl: { hd: [ "_PI", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.00001, - _1: 3.14159, - _2: Math.PI - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.00001, + _1: 3.14159, + _2: Math.PI + }; + }) ], tl: { hd: [ "_SQRT1_2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.707, - _2: Math.SQRT1_2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.707, + _2: Math.SQRT1_2 + }; + }) ], tl: { hd: [ "_SQRT2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.414, - _2: Math.SQRT2 - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.414, + _2: Math.SQRT2 + }; + }) ], tl: { hd: [ "abs_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.abs(-4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.abs(-4) + }; + }) ], tl: { hd: [ "abs_float", (function (param) { - return { - TAG: "Eq", - _0: 1.2, - _1: Math.abs(-1.2) - }; - }) + return { + TAG: "Eq", + _0: 1.2, + _1: Math.abs(-1.2) + }; + }) ], tl: { hd: [ "acos", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.159, - _2: Math.acos(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.159, + _2: Math.acos(0.4) + }; + }) ], tl: { hd: [ "acosh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.622, - _2: Math.acosh(1.2) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.622, + _2: Math.acosh(1.2) + }; + }) ], tl: { hd: [ "asin", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.411, - _2: Math.asin(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.411, + _2: Math.asin(0.4) + }; + }) ], tl: { hd: [ "asinh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.390, - _2: Math.asinh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.390, + _2: Math.asinh(0.4) + }; + }) ], tl: { hd: [ "atan", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.380, - _2: Math.atan(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.380, + _2: Math.atan(0.4) + }; + }) ], tl: { hd: [ "atanh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.423, - _2: Math.atanh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.423, + _2: Math.atanh(0.4) + }; + }) ], tl: { hd: [ "atan2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.588, - _2: Math.atan2(0.4, 0.6) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.588, + _2: Math.atan2(0.4, 0.6) + }; + }) ], tl: { hd: [ "cbrt", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.cbrt(8) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.cbrt(8) + }; + }) ], tl: { hd: [ "unsafe_ceil_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + }; + }) ], tl: { hd: [ "ceil_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Js_math.ceil_int(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Js_math.ceil_int(3.2) + }; + }) ], tl: { hd: [ "ceil_float", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.ceil(3.2) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.ceil(3.2) + }; + }) ], tl: { hd: [ "cos", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.921, - _2: Math.cos(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.921, + _2: Math.cos(0.4) + }; + }) ], tl: { hd: [ "cosh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.081, - _2: Math.cosh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.081, + _2: Math.cosh(0.4) + }; + }) ], tl: { hd: [ "exp", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.491, - _2: Math.exp(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.491, + _2: Math.exp(0.4) + }; + }) ], tl: { hd: [ "expm1", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.491, - _2: Math.expm1(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.491, + _2: Math.expm1(0.4) + }; + }) ], tl: { hd: [ "unsafe_floor_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + }; + }) ], tl: { hd: [ "floor_int", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_math.floor_int(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_math.floor_int(3.2) + }; + }) ], tl: { hd: [ "floor_float", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.floor(3.2) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Math.floor(3.2) + }; + }) ], tl: { hd: [ "fround", (function (param) { - return { - TAG: "Approx", - _0: 3.2, - _1: Math.fround(3.2) - }; - }) + return { + TAG: "Approx", + _0: 3.2, + _1: Math.fround(3.2) + }; + }) ], tl: { hd: [ "hypot", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.721, - _2: Math.hypot(0.4, 0.6) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.721, + _2: Math.hypot(0.4, 0.6) + }; + }) ], tl: { hd: [ "hypotMany", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 1.077, - _2: Math.hypot(0.4, 0.6, 0.8) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 1.077, + _2: Math.hypot(0.4, 0.6, 0.8) + }; + }) ], tl: { hd: [ "imul", (function (param) { - return { - TAG: "Eq", - _0: 8, - _1: Math.imul(4, 2) - }; - }) + return { + TAG: "Eq", + _0: 8, + _1: Math.imul(4, 2) + }; + }) ], tl: { hd: [ "log", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.916, - _2: Math.log(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.916, + _2: Math.log(0.4) + }; + }) ], tl: { hd: [ "log1p", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.336, - _2: Math.log1p(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.336, + _2: Math.log1p(0.4) + }; + }) ], tl: { hd: [ "log10", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -0.397, - _2: Math.log10(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -0.397, + _2: Math.log10(0.4) + }; + }) ], tl: { hd: [ "log2", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: -1.321, - _2: Math.log2(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: -1.321, + _2: Math.log2(0.4) + }; + }) ], tl: { hd: [ "max_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4) + }; + }) ], tl: { hd: [ "maxMany_int", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.max(2, 4, 3) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Math.max(2, 4, 3) + }; + }) ], tl: { hd: [ "max_float", (function (param) { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2) - }; - }) + return { + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2) + }; + }) ], tl: { hd: [ "maxMany_float", (function (param) { - return { - TAG: "Eq", - _0: 4.2, - _1: Math.max(2.7, 4.2, 3.9) - }; - }) + return { + TAG: "Eq", + _0: 4.2, + _1: Math.max(2.7, 4.2, 3.9) + }; + }) ], tl: { hd: [ "min_int", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4) + }; + }) ], tl: { hd: [ "minMany_int", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.min(2, 4, 3) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.min(2, 4, 3) + }; + }) ], tl: { hd: [ "min_float", (function (param) { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2) - }; - }) + return { + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2) + }; + }) ], tl: { hd: [ "minMany_float", (function (param) { - return { - TAG: "Eq", - _0: 2.7, - _1: Math.min(2.7, 4.2, 3.9) - }; - }) + return { + TAG: "Eq", + _0: 2.7, + _1: Math.min(2.7, 4.2, 3.9) + }; + }) ], tl: { hd: [ "random", (function (param) { - var a = Math.random(); - return { - TAG: "Ok", - _0: a >= 0 && a < 1 - }; - }) + var a = Math.random(); + return { + TAG: "Ok", + _0: a >= 0 && a < 1 + }; + }) ], tl: { hd: [ "random_int", (function (param) { - var a = Js_math.random_int(1, 3); - return { - TAG: "Ok", - _0: a >= 1 && a < 3 - }; - }) + var a = Js_math.random_int(1, 3); + return { + TAG: "Ok", + _0: a >= 1 && a < 3 + }; + }) ], tl: { hd: [ "unsafe_round", (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: Math.round(3.2) + }; + }) + ], + tl: { + hd: [ + "round", + (function (param) { return { TAG: "Eq", _0: 3, _1: Math.round(3.2) }; }) - ], - tl: { - hd: [ - "round", - (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Math.round(3.2) - }; - }) ], tl: { hd: [ "sign_int", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: Math.sign(-4) + }; + }) ], tl: { hd: [ "sign_float", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: Math.sign(-4.2) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: Math.sign(-4.2) + }; + }) ], tl: { hd: [ "sign_float -0", (function (param) { - return { - TAG: "Eq", - _0: -0, - _1: Math.sign(-0) - }; - }) + return { + TAG: "Eq", + _0: -0, + _1: Math.sign(-0) + }; + }) ], tl: { hd: [ "sin", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.389, - _2: Math.sin(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.389, + _2: Math.sin(0.4) + }; + }) ], tl: { hd: [ "sinh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.410, - _2: Math.sinh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.410, + _2: Math.sinh(0.4) + }; + }) ], tl: { hd: [ "sqrt", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.632, - _2: Math.sqrt(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.632, + _2: Math.sqrt(0.4) + }; + }) ], tl: { hd: [ "tan", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.422, - _2: Math.tan(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.422, + _2: Math.tan(0.4) + }; + }) ], tl: { hd: [ "tanh", (function (param) { - return { - TAG: "ApproxThreshold", - _0: 0.001, - _1: 0.379, - _2: Math.tanh(0.4) - }; - }) + return { + TAG: "ApproxThreshold", + _0: 0.001, + _1: 0.379, + _2: Math.tanh(0.4) + }; + }) ], tl: { hd: [ "unsafe_trunc", (function (param) { + return { + TAG: "Eq", + _0: 4, + _1: Math.trunc(4.2156) + }; + }) + ], + tl: { + hd: [ + "trunc", + (function (param) { return { TAG: "Eq", _0: 4, _1: Math.trunc(4.2156) }; }) - ], - tl: { - hd: [ - "trunc", - (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Math.trunc(4.2156) - }; - }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_test.js b/jscomp/test/js_null_test.js index fc571752d2..1d035ad660 100644 --- a/jscomp/test/js_null_test.js +++ b/jscomp/test/js_null_test.js @@ -8,139 +8,139 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "toOption - empty", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ]; var suites_1 = { hd: [ "toOption - 'a", (function (param) { - return { - TAG: "Eq", - _0: Caml_option.some(undefined), - _1: Caml_option.some() - }; - }) + return { + TAG: "Eq", + _0: Caml_option.some(undefined), + _1: Caml_option.some() + }; + }) ], tl: { hd: [ "return", (function (param) { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.null_to_opt("something") - }; - }) + return { + TAG: "Eq", + _0: "something", + _1: Caml_option.null_to_opt("something") + }; + }) ], tl: { hd: [ "test - empty", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ], tl: { hd: [ "test - 'a", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) ], tl: { hd: [ "bind - empty", (function (param) { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null.bind(null, (function (v) { - return v; - })) - }; - }) + return { + TAG: "StrictEq", + _0: null, + _1: Js_null.bind(null, (function (v) { + return v; + })) + }; + }) ], tl: { hd: [ "bind - 'a", (function (param) { - return { - TAG: "StrictEq", - _0: 4, - _1: Js_null.bind(2, (function (n) { - return (n << 1); - })) - }; - }) + return { + TAG: "StrictEq", + _0: 4, + _1: Js_null.bind(2, (function (n) { + return (n << 1); + })) + }; + }) ], tl: { hd: [ "iter - empty", (function (param) { + var hit = { + contents: false + }; + Js_null.iter(null, (function (param) { + hit.contents = true; + })); + return { + TAG: "Eq", + _0: false, + _1: hit.contents + }; + }) + ], + tl: { + hd: [ + "iter - 'a", + (function (param) { var hit = { - contents: false + contents: 0 }; - Js_null.iter(null, (function (param) { - hit.contents = true; - })); + Js_null.iter(2, (function (v) { + hit.contents = v; + })); return { TAG: "Eq", - _0: false, + _0: 2, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - 'a", - (function (param) { - var hit = { - contents: 0 - }; - Js_null.iter(2, (function (v) { - hit.contents = v; - })); - return { - TAG: "Eq", - _0: 2, - _1: hit.contents - }; - }) ], tl: { hd: [ "fromOption - None", (function (param) { - return { - TAG: "Eq", - _0: null, - _1: Js_null.fromOption(undefined) - }; - }) + return { + TAG: "Eq", + _0: null, + _1: Js_null.fromOption(undefined) + }; + }) ], tl: { hd: [ "fromOption - Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_null.fromOption(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_null.fromOption(2) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_null_undefined_test.js b/jscomp/test/js_null_undefined_test.js index c7993e4264..4ffbf1acb1 100644 --- a/jscomp/test/js_null_undefined_test.js +++ b/jscomp/test/js_null_undefined_test.js @@ -8,283 +8,283 @@ var Js_null_undefined = require("../../lib/js/js_null_undefined.js"); var suites_0 = [ "toOption - null", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ]; var suites_1 = { hd: [ "toOption - undefined", (function (param) { + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) + ], + tl: { + hd: [ + "toOption - empty", + (function (param) { return { TAG: "Eq", _0: undefined, _1: undefined }; }) - ], - tl: { - hd: [ - "toOption - empty", - (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 9, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: Caml_option.nullable_to_opt("foo") - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: Caml_option.nullable_to_opt("foo") + }; + }) ], tl: { hd: [ "return", (function (param) { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.nullable_to_opt("something") - }; - }) + return { + TAG: "Eq", + _0: "something", + _1: Caml_option.nullable_to_opt("something") + }; + }) ], tl: { hd: [ "test - null", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) + ], + tl: { + hd: [ + "test - undefined", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "test - undefined", - (function (param) { + ], + tl: { + hd: [ + "test - empty", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "test - empty", - (function (param) { + ], + tl: { + hd: [ + "File \"js_null_undefined_test.res\", line 14, characters 5-12", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "File \"js_null_undefined_test.res\", line 14, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) ], tl: { hd: [ "bind - null", (function (param) { - return { - TAG: "StrictEq", - _0: null, - _1: Js_null_undefined.bind(null, (function (v) { - return v; - })) - }; - }) + return { + TAG: "StrictEq", + _0: null, + _1: Js_null_undefined.bind(null, (function (v) { + return v; + })) + }; + }) ], tl: { hd: [ "bind - undefined", (function (param) { + return { + TAG: "StrictEq", + _0: undefined, + _1: Js_null_undefined.bind(undefined, (function (v) { + return v; + })) + }; + }) + ], + tl: { + hd: [ + "bind - empty", + (function (param) { return { TAG: "StrictEq", _0: undefined, _1: Js_null_undefined.bind(undefined, (function (v) { - return v; - })) + return v; + })) }; }) - ], - tl: { - hd: [ - "bind - empty", - (function (param) { - return { - TAG: "StrictEq", - _0: undefined, - _1: Js_null_undefined.bind(undefined, (function (v) { - return v; - })) - }; - }) ], tl: { hd: [ "bind - 'a", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Js_null_undefined.bind(2, (function (n) { - return (n << 1); - })) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Js_null_undefined.bind(2, (function (n) { + return (n << 1); + })) + }; + }) ], tl: { hd: [ "iter - null", (function (param) { + var hit = { + contents: false + }; + Js_null_undefined.iter(null, (function (param) { + hit.contents = true; + })); + return { + TAG: "Eq", + _0: false, + _1: hit.contents + }; + }) + ], + tl: { + hd: [ + "iter - undefined", + (function (param) { var hit = { contents: false }; - Js_null_undefined.iter(null, (function (param) { - hit.contents = true; - })); + Js_null_undefined.iter(undefined, (function (param) { + hit.contents = true; + })); return { TAG: "Eq", _0: false, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - undefined", - (function (param) { + ], + tl: { + hd: [ + "iter - empty", + (function (param) { var hit = { contents: false }; Js_null_undefined.iter(undefined, (function (param) { - hit.contents = true; - })); + hit.contents = true; + })); return { TAG: "Eq", _0: false, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - empty", - (function (param) { + ], + tl: { + hd: [ + "iter - 'a", + (function (param) { var hit = { - contents: false + contents: 0 }; - Js_null_undefined.iter(undefined, (function (param) { - hit.contents = true; - })); + Js_null_undefined.iter(2, (function (v) { + hit.contents = v; + })); return { TAG: "Eq", - _0: false, + _0: 2, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - 'a", - (function (param) { - var hit = { - contents: 0 - }; - Js_null_undefined.iter(2, (function (v) { - hit.contents = v; - })); - return { - TAG: "Eq", - _0: 2, - _1: hit.contents - }; - }) ], tl: { hd: [ "fromOption - None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_null_undefined.fromOption(undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_null_undefined.fromOption(undefined) + }; + }) ], tl: { hd: [ "fromOption - Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_null_undefined.fromOption(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_null_undefined.fromOption(2) + }; + }) ], tl: { hd: [ "null <> undefined", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "null <> empty", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "undefined = empty", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: { hd: [ "File \"js_null_undefined_test.res\", line 57, characters 6-13", (function (param) { - return { - TAG: "Ok", - _0: true - }; - }) + return { + TAG: "Ok", + _0: true + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_nullable_test.js b/jscomp/test/js_nullable_test.js index a1c2f25dd2..bae3a4ede4 100644 --- a/jscomp/test/js_nullable_test.js +++ b/jscomp/test/js_nullable_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/js_obj_test.js b/jscomp/test/js_obj_test.js index ed49b1dcb1..eb5bc3c44d 100644 --- a/jscomp/test/js_obj_test.js +++ b/jscomp/test/js_obj_test.js @@ -6,28 +6,28 @@ var Mt = require("./mt.js"); var suites_0 = [ "empty", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Object.keys({}).length - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Object.keys({}).length + }; + }) ]; var suites_1 = { hd: [ "assign", (function (param) { - return { - TAG: "Eq", - _0: { - a: 1 - }, - _1: Object.assign({}, { - a: 1 - }) - }; - }) + return { + TAG: "Eq", + _0: { + a: 1 + }, + _1: Object.assign({}, { + a: 1 + }) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/js_option_test.js b/jscomp/test/js_option_test.js index 9e0d20bc4b..bd9519ae5c 100644 --- a/jscomp/test/js_option_test.js +++ b/jscomp/test/js_option_test.js @@ -11,269 +11,269 @@ function simpleEq(a, b) { var option_suites_0 = [ "option_isSome_Some", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ]; var option_suites_1 = { hd: [ "option_isSome_None", (function (param) { + return { + TAG: "Eq", + _0: false, + _1: false + }; + }) + ], + tl: { + hd: [ + "option_isNone_Some", + (function (param) { return { TAG: "Eq", _0: false, _1: false }; }) - ], - tl: { - hd: [ - "option_isNone_Some", - (function (param) { - return { - TAG: "Eq", - _0: false, - _1: false - }; - }) ], tl: { hd: [ "option_isNone_None", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) ], tl: { hd: [ "option_isSomeValue_Eq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, 2) + }; + }) ], tl: { hd: [ "option_isSomeValue_Diff", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, 2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, 2) + }; + }) ], tl: { hd: [ "option_isSomeValue_DiffNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 1, undefined) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 1, undefined) + }; + }) ], tl: { hd: [ "option_getExn_Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getExn(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_option.getExn(2) + }; + }) ], tl: { hd: [ "option_equal_Eq", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.equal(simpleEq, 2, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.equal(simpleEq, 2, 2) + }; + }) ], tl: { hd: [ "option_equal_Diff", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, 2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, 2) + }; + }) ], tl: { hd: [ "option_equal_DiffNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.equal(simpleEq, 1, undefined) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.equal(simpleEq, 1, undefined) + }; + }) ], tl: { hd: [ "option_andThen_SomeSome", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (a) { - return a + 1 | 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (a) { + return a + 1 | 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_andThen_SomeNone", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (param) { - - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.andThen((function (param) { + + }), 2)) + }; + }) ], tl: { hd: [ "option_map_Some", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((function (a) { - return a + 1 | 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.map((function (a) { + return a + 1 | 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_map_None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.map((function (a) { - return a + 1 | 0; - }), undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.map((function (a) { + return a + 1 | 0; + }), undefined) + }; + }) ], tl: { hd: [ "option_default_Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_option.getWithDefault(3, 2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_option.getWithDefault(3, 2) + }; + }) ], tl: { hd: [ "option_default_None", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_option.getWithDefault(3, undefined) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_option.getWithDefault(3, undefined) + }; + }) ], tl: { hd: [ "option_filter_Pass", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((function (a) { - return a % 2 === 0; - }), 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.filter((function (a) { + return a % 2 === 0; + }), 2)) + }; + }) ], tl: { hd: [ "option_filter_Reject", (function (param) { + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.filter((function (a) { + return a % 3 === 0; + }), 2) + }; + }) + ], + tl: { + hd: [ + "option_filter_None", + (function (param) { return { TAG: "Eq", _0: undefined, _1: Js_option.filter((function (a) { - return a % 3 === 0; - }), 2) + return a % 3 === 0; + }), undefined) }; }) - ], - tl: { - hd: [ - "option_filter_None", - (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.filter((function (a) { - return a % 3 === 0; - }), undefined) - }; - }) ], tl: { hd: [ "option_firstSome_First", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 3, Js_option.firstSome(3, 2)) + }; + }) ], tl: { hd: [ "option_firstSome_First", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_option.isSomeValue(simpleEq, 2, Js_option.firstSome(undefined, 2)) + }; + }) ], tl: { hd: [ "option_firstSome_None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_option.firstSome(undefined, undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_option.firstSome(undefined, undefined) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_re_test.js b/jscomp/test/js_re_test.js index 31ab40bc55..42e43e99c6 100644 --- a/jscomp/test/js_re_test.js +++ b/jscomp/test/js_re_test.js @@ -8,119 +8,139 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "captures", (function (param) { - var re = /(\d+)-(?:(\d+))?/g; - var result = re.exec("3-"); - if (result === null) { - return { - TAG: "Fail", - _0: undefined - }; - } - var defined = Caml_array.get(result, 1); - var $$undefined = Caml_array.get(result, 2); + var re = /(\d+)-(?:(\d+))?/g; + var result = re.exec("3-"); + if (result === null) { return { - TAG: "Eq", - _0: [ - "3", - null - ], - _1: [ - defined, - $$undefined - ] + TAG: "Fail", + _0: undefined }; - }) + } + var defined = Caml_array.get(result, 1); + var $$undefined = Caml_array.get(result, 2); + return { + TAG: "Eq", + _0: [ + "3", + null + ], + _1: [ + defined, + $$undefined + ] + }; + }) ]; var suites_1 = { hd: [ "fromString", (function (param) { - var contentOf = function (tag, xmlString) { - var x = new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString); - if (x !== null) { - return Caml_option.nullable_to_opt(Caml_array.get(x, 1)); - } - - }; - return { - TAG: "Eq", - _0: contentOf("div", "
Hi
"), - _1: "Hi" - }; - }) + var contentOf = function (tag, xmlString) { + var x = new RegExp("<" + (tag + (">(.*?)<\\/" + (tag + ">")))).exec(xmlString); + if (x !== null) { + return Caml_option.nullable_to_opt(Caml_array.get(x, 1)); + } + + }; + return { + TAG: "Eq", + _0: contentOf("div", "
Hi
"), + _1: "Hi" + }; + }) ], tl: { hd: [ "exec_literal", (function (param) { - var res = /[^.]+/.exec("http://xxx.domain.com"); - if (res !== null) { + var res = /[^.]+/.exec("http://xxx.domain.com"); + if (res !== null) { + return { + TAG: "Eq", + _0: "http://xxx", + _1: Caml_array.get(res, 0) + }; + } else { + return { + TAG: "FailWith", + _0: "regex should match" + }; + } + }) + ], + tl: { + hd: [ + "exec_no_match", + (function (param) { + var match = /https:\/\/(.*)/.exec("http://xxx.domain.com"); + if (match !== null) { return { - TAG: "Eq", - _0: "http://xxx", - _1: Caml_array.get(res, 0) + TAG: "FailWith", + _0: "regex should not match" }; } else { return { - TAG: "FailWith", - _0: "regex should match" + TAG: "Ok", + _0: true }; } }) - ], - tl: { - hd: [ - "exec_no_match", - (function (param) { - var match = /https:\/\/(.*)/.exec("http://xxx.domain.com"); - if (match !== null) { - return { - TAG: "FailWith", - _0: "regex should not match" - }; - } else { - return { - TAG: "Ok", - _0: true - }; - } - }) ], tl: { hd: [ "test_str", (function (param) { - var res = new RegExp("foo").test("#foo#"); - return { - TAG: "Eq", - _0: true, - _1: res - }; - }) + var res = new RegExp("foo").test("#foo#"); + return { + TAG: "Eq", + _0: true, + _1: res + }; + }) ], tl: { hd: [ "fromStringWithFlags", (function (param) { - var res = new RegExp("foo", "g"); - return { - TAG: "Eq", - _0: true, - _1: res.global - }; - }) + var res = new RegExp("foo", "g"); + return { + TAG: "Eq", + _0: true, + _1: res.global + }; + }) ], tl: { hd: [ "result_index", (function (param) { - var res = new RegExp("zbar").exec("foobarbazbar"); + var res = new RegExp("zbar").exec("foobarbazbar"); + if (res !== null) { + return { + TAG: "Eq", + _0: 8, + _1: res.index + }; + } else { + return { + TAG: "Fail", + _0: undefined + }; + } + }) + ], + tl: { + hd: [ + "result_input", + (function (param) { + var input = "foobar"; + var res = /foo/g.exec(input); if (res !== null) { return { TAG: "Eq", - _0: 8, - _1: res.index + _0: input, + _1: res.input }; } else { return { @@ -129,137 +149,117 @@ var suites_1 = { }; } }) - ], - tl: { - hd: [ - "result_input", - (function (param) { - var input = "foobar"; - var res = /foo/g.exec(input); - if (res !== null) { - return { - TAG: "Eq", - _0: input, - _1: res.input - }; - } else { - return { - TAG: "Fail", - _0: undefined - }; - } - }) ], tl: { hd: [ "t_flags", (function (param) { - return { - TAG: "Eq", - _0: "gi", - _1: /./ig.flags - }; - }) + return { + TAG: "Eq", + _0: "gi", + _1: /./ig.flags + }; + }) ], tl: { hd: [ "t_global", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: /./ig.global - }; - }) + return { + TAG: "Eq", + _0: true, + _1: /./ig.global + }; + }) ], tl: { hd: [ "t_ignoreCase", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: /./ig.ignoreCase - }; - }) + return { + TAG: "Eq", + _0: true, + _1: /./ig.ignoreCase + }; + }) ], tl: { hd: [ "t_lastIndex", (function (param) { - var re = /na/g; - re.exec("banana"); - return { - TAG: "Eq", - _0: 4, - _1: re.lastIndex - }; - }) + var re = /na/g; + re.exec("banana"); + return { + TAG: "Eq", + _0: 4, + _1: re.lastIndex + }; + }) ], tl: { hd: [ "t_setLastIndex", (function (param) { - var re = /na/g; - var before = re.lastIndex; - re.lastIndex = 42; - var after = re.lastIndex; - return { - TAG: "Eq", - _0: [ - 0, - 42 - ], - _1: [ - before, - after - ] - }; - }) + var re = /na/g; + var before = re.lastIndex; + re.lastIndex = 42; + var after = re.lastIndex; + return { + TAG: "Eq", + _0: [ + 0, + 42 + ], + _1: [ + before, + after + ] + }; + }) ], tl: { hd: [ "t_multiline", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: /./ig.multiline - }; - }) + return { + TAG: "Eq", + _0: false, + _1: /./ig.multiline + }; + }) ], tl: { hd: [ "t_source", (function (param) { - return { - TAG: "Eq", - _0: "f.+o", - _1: /f.+o/ig.source - }; - }) + return { + TAG: "Eq", + _0: "f.+o", + _1: /f.+o/ig.source + }; + }) ], tl: { hd: [ "t_sticky", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: /./yg.sticky - }; - }) + return { + TAG: "Eq", + _0: true, + _1: /./yg.sticky + }; + }) ], tl: { hd: [ "t_unicode", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: /./yg.unicode - }; - }) + return { + TAG: "Eq", + _0: false, + _1: /./yg.unicode + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_string_test.js b/jscomp/test/js_string_test.js index 06be750d7d..64a8eff69b 100644 --- a/jscomp/test/js_string_test.js +++ b/jscomp/test/js_string_test.js @@ -8,346 +8,364 @@ var Caml_option = require("../../lib/js/caml_option.js"); var suites_0 = [ "make", (function (param) { - return { - TAG: "Eq", - _0: "null", - _1: String(null).concat("") - }; - }) + return { + TAG: "Eq", + _0: "null", + _1: String(null).concat("") + }; + }) ]; var suites_1 = { hd: [ "fromCharCode", (function (param) { - return { - TAG: "Eq", - _0: "a", - _1: String.fromCharCode(97) - }; - }) + return { + TAG: "Eq", + _0: "a", + _1: String.fromCharCode(97) + }; + }) ], tl: { hd: [ "fromCharCodeMany", (function (param) { - return { - TAG: "Eq", - _0: "az", - _1: String.fromCharCode(97, 122) - }; - }) + return { + TAG: "Eq", + _0: "az", + _1: String.fromCharCode(97, 122) + }; + }) ], tl: { hd: [ "fromCodePoint", (function (param) { - return { - TAG: "Eq", - _0: "a", - _1: String.fromCodePoint(97) - }; - }) + return { + TAG: "Eq", + _0: "a", + _1: String.fromCodePoint(97) + }; + }) ], tl: { hd: [ "fromCodePointMany", (function (param) { - return { - TAG: "Eq", - _0: "az", - _1: String.fromCodePoint(97, 122) - }; - }) + return { + TAG: "Eq", + _0: "az", + _1: String.fromCodePoint(97, 122) + }; + }) ], tl: { hd: [ "length", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "foo".length - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "foo".length + }; + }) ], tl: { hd: [ "get", (function (param) { - return { - TAG: "Eq", - _0: "a", - _1: "foobar"[4] - }; - }) + return { + TAG: "Eq", + _0: "a", + _1: "foobar"[4] + }; + }) ], tl: { hd: [ "charAt", (function (param) { - return { - TAG: "Eq", - _0: "a", - _1: "foobar".charAt(4) - }; - }) + return { + TAG: "Eq", + _0: "a", + _1: "foobar".charAt(4) + }; + }) ], tl: { hd: [ "charCodeAt", (function (param) { - return { - TAG: "Eq", - _0: 97, - _1: "foobar".charCodeAt(4) - }; - }) + return { + TAG: "Eq", + _0: 97, + _1: "foobar".charCodeAt(4) + }; + }) ], tl: { hd: [ "codePointAt", (function (param) { - return { - TAG: "Eq", - _0: 97, - _1: "foobar".codePointAt(4) - }; - }) + return { + TAG: "Eq", + _0: 97, + _1: "foobar".codePointAt(4) + }; + }) ], tl: { hd: [ "codePointAt - out of bounds", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: "foobar".codePointAt(98) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: "foobar".codePointAt(98) + }; + }) ], tl: { hd: [ "concat", (function (param) { - return { - TAG: "Eq", - _0: "foobar", - _1: "foo".concat("bar") - }; - }) + return { + TAG: "Eq", + _0: "foobar", + _1: "foo".concat("bar") + }; + }) ], tl: { hd: [ "concatMany", (function (param) { - return { - TAG: "Eq", - _0: "foobarbaz", - _1: "foo".concat("bar", "baz") - }; - }) + return { + TAG: "Eq", + _0: "foobarbaz", + _1: "foo".concat("bar", "baz") + }; + }) ], tl: { hd: [ "endsWith", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: "foobar".endsWith("bar") - }; - }) + return { + TAG: "Eq", + _0: true, + _1: "foobar".endsWith("bar") + }; + }) ], tl: { hd: [ "endsWithFrom", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: "foobar".endsWith("bar", 1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: "foobar".endsWith("bar", 1) + }; + }) ], tl: { hd: [ "includes", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: "foobarbaz".includes("bar") - }; - }) + return { + TAG: "Eq", + _0: true, + _1: "foobarbaz".includes("bar") + }; + }) ], tl: { hd: [ "includesFrom", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: "foobarbaz".includes("bar", 4) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: "foobarbaz".includes("bar", 4) + }; + }) ], tl: { hd: [ "indexOf", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".indexOf("bar") - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "foobarbaz".indexOf("bar") + }; + }) ], tl: { hd: [ "indexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: "foobarbaz".indexOf("bar", 4) - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: "foobarbaz".indexOf("bar", 4) + }; + }) ], tl: { hd: [ "lastIndexOf", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".lastIndexOf("bar") - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "foobarbaz".lastIndexOf("bar") + }; + }) ], tl: { hd: [ "lastIndexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".lastIndexOf("bar", 4) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "foobarbaz".lastIndexOf("bar", 4) + }; + }) ], tl: { hd: [ "localeCompare", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: "foo".localeCompare("foo") - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: "foo".localeCompare("foo") + }; + }) ], tl: { hd: [ "match", (function (param) { - return { - TAG: "Eq", - _0: [ - "na", - "na" - ], - _1: Caml_option.null_to_opt("banana".match(/na+/g)) - }; - }) + return { + TAG: "Eq", + _0: [ + "na", + "na" + ], + _1: Caml_option.null_to_opt("banana".match(/na+/g)) + }; + }) ], tl: { hd: [ "match - no match", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Caml_option.null_to_opt("banana".match(/nanana+/g)) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Caml_option.null_to_opt("banana".match(/nanana+/g)) + }; + }) ], tl: { hd: [ "match - not found capture groups", (function (param) { - return { - TAG: "Eq", - _0: [ - "hello ", - undefined - ], - _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (function (prim) { - return prim.slice(); - })) - }; - }) + return { + TAG: "Eq", + _0: [ + "hello ", + undefined + ], + _1: Belt_Option.map(Caml_option.null_to_opt("hello word".match(/hello (world)?/)), (function (prim) { + return prim.slice(); + })) + }; + }) ], tl: { hd: [ "normalize", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".normalize() - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: "foo".normalize() + }; + }) ], tl: { hd: [ "normalizeByForm", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".normalize("NFKD") - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: "foo".normalize("NFKD") + }; + }) ], tl: { hd: [ "repeat", (function (param) { - return { - TAG: "Eq", - _0: "foofoofoo", - _1: "foo".repeat(3) - }; - }) + return { + TAG: "Eq", + _0: "foofoofoo", + _1: "foo".repeat(3) + }; + }) ], tl: { hd: [ "replace", (function (param) { - return { - TAG: "Eq", - _0: "fooBORKbaz", - _1: "foobarbaz".replace("bar", "BORK") - }; - }) + return { + TAG: "Eq", + _0: "fooBORKbaz", + _1: "foobarbaz".replace("bar", "BORK") + }; + }) ], tl: { hd: [ "replaceByRe", (function (param) { - return { - TAG: "Eq", - _0: "fooBORKBORK", - _1: "foobarbaz".replace(/ba./g, "BORK") - }; - }) + return { + TAG: "Eq", + _0: "fooBORKBORK", + _1: "foobarbaz".replace(/ba./g, "BORK") + }; + }) ], tl: { hd: [ "unsafeReplaceBy0", (function (param) { - var replace = function (whole, offset, s) { + var replace = function (whole, offset, s) { + if (whole === "bar") { + return "BORK"; + } else { + return "DORK"; + } + }; + return { + TAG: "Eq", + _0: "fooBORKDORK", + _1: "foobarbaz".replace(/ba./g, replace) + }; + }) + ], + tl: { + hd: [ + "unsafeReplaceBy1", + (function (param) { + var replace = function (whole, p1, offset, s) { if (whole === "bar") { return "BORK"; } else { @@ -360,12 +378,12 @@ var suites_1 = { _1: "foobarbaz".replace(/ba./g, replace) }; }) - ], - tl: { - hd: [ - "unsafeReplaceBy1", - (function (param) { - var replace = function (whole, p1, offset, s) { + ], + tl: { + hd: [ + "unsafeReplaceBy2", + (function (param) { + var replace = function (whole, p1, p2, offset, s) { if (whole === "bar") { return "BORK"; } else { @@ -378,12 +396,12 @@ var suites_1 = { _1: "foobarbaz".replace(/ba./g, replace) }; }) - ], - tl: { - hd: [ - "unsafeReplaceBy2", - (function (param) { - var replace = function (whole, p1, p2, offset, s) { + ], + tl: { + hd: [ + "unsafeReplaceBy3", + (function (param) { + var replace = function (whole, p1, p2, p3, offset, s) { if (whole === "bar") { return "BORK"; } else { @@ -396,273 +414,255 @@ var suites_1 = { _1: "foobarbaz".replace(/ba./g, replace) }; }) - ], - tl: { - hd: [ - "unsafeReplaceBy3", - (function (param) { - var replace = function (whole, p1, p2, p3, offset, s) { - if (whole === "bar") { - return "BORK"; - } else { - return "DORK"; - } - }; - return { - TAG: "Eq", - _0: "fooBORKDORK", - _1: "foobarbaz".replace(/ba./g, replace) - }; - }) ], tl: { hd: [ "search", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "foobarbaz".search(/ba./g) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "foobarbaz".search(/ba./g) + }; + }) ], tl: { hd: [ "slice", (function (param) { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".slice(3, 6) - }; - }) + return { + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".slice(3, 6) + }; + }) ], tl: { hd: [ "sliceToEnd", (function (param) { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".slice(3) - }; - }) + return { + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".slice(3) + }; + }) ], tl: { hd: [ "split", (function (param) { + return { + TAG: "Eq", + _0: [ + "foo", + "bar", + "baz" + ], + _1: "foo bar baz".split(" ") + }; + }) + ], + tl: { + hd: [ + "splitAtMost", + (function (param) { return { TAG: "Eq", _0: [ "foo", - "bar", - "baz" + "bar" ], - _1: "foo bar baz".split(" ") + _1: "foo bar baz".split(" ", 2) }; }) - ], - tl: { - hd: [ - "splitAtMost", - (function (param) { + ], + tl: { + hd: [ + "splitByRe", + (function (param) { return { TAG: "Eq", _0: [ - "foo", - "bar" + "a", + "#", + undefined, + "b", + "#", + ":", + "c" ], - _1: "foo bar baz".split(" ", 2) + _1: "a#b#:c".split(/(#)(:)?/) }; }) - ], - tl: { - hd: [ - "splitByRe", - (function (param) { + ], + tl: { + hd: [ + "splitByReAtMost", + (function (param) { return { TAG: "Eq", _0: [ "a", "#", - undefined, - "b", - "#", - ":", - "c" + undefined ], - _1: "a#b#:c".split(/(#)(:)?/) + _1: "a#b#:c".split(/(#)(:)?/, 3) }; }) - ], - tl: { - hd: [ - "splitByReAtMost", - (function (param) { - return { - TAG: "Eq", - _0: [ - "a", - "#", - undefined - ], - _1: "a#b#:c".split(/(#)(:)?/, 3) - }; - }) ], tl: { hd: [ "startsWith", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: "foobarbaz".startsWith("foo") - }; - }) + return { + TAG: "Eq", + _0: true, + _1: "foobarbaz".startsWith("foo") + }; + }) ], tl: { hd: [ "startsWithFrom", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: "foobarbaz".startsWith("foo", 1) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: "foobarbaz".startsWith("foo", 1) + }; + }) ], tl: { hd: [ "substr", (function (param) { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".substr(3) - }; - }) + return { + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".substr(3) + }; + }) ], tl: { hd: [ "substrAtMost", (function (param) { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".substr(3, 3) - }; - }) + return { + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".substr(3, 3) + }; + }) ], tl: { hd: [ "substring", (function (param) { - return { - TAG: "Eq", - _0: "bar", - _1: "foobarbaz".substring(3, 6) - }; - }) + return { + TAG: "Eq", + _0: "bar", + _1: "foobarbaz".substring(3, 6) + }; + }) ], tl: { hd: [ "substringToEnd", (function (param) { - return { - TAG: "Eq", - _0: "barbaz", - _1: "foobarbaz".substring(3) - }; - }) + return { + TAG: "Eq", + _0: "barbaz", + _1: "foobarbaz".substring(3) + }; + }) ], tl: { hd: [ "toLowerCase", (function (param) { - return { - TAG: "Eq", - _0: "bork", - _1: "BORK".toLowerCase() - }; - }) + return { + TAG: "Eq", + _0: "bork", + _1: "BORK".toLowerCase() + }; + }) ], tl: { hd: [ "toLocaleLowerCase", (function (param) { - return { - TAG: "Eq", - _0: "bork", - _1: "BORK".toLocaleLowerCase() - }; - }) + return { + TAG: "Eq", + _0: "bork", + _1: "BORK".toLocaleLowerCase() + }; + }) ], tl: { hd: [ "toUpperCase", (function (param) { - return { - TAG: "Eq", - _0: "FUBAR", - _1: "fubar".toUpperCase() - }; - }) + return { + TAG: "Eq", + _0: "FUBAR", + _1: "fubar".toUpperCase() + }; + }) ], tl: { hd: [ "toLocaleUpperCase", (function (param) { - return { - TAG: "Eq", - _0: "FUBAR", - _1: "fubar".toLocaleUpperCase() - }; - }) + return { + TAG: "Eq", + _0: "FUBAR", + _1: "fubar".toLocaleUpperCase() + }; + }) ], tl: { hd: [ "trim", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: " foo ".trim() - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: " foo ".trim() + }; + }) ], tl: { hd: [ "anchor", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".anchor("bar") - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: "foo".anchor("bar") + }; + }) ], tl: { hd: [ "link", (function (param) { - return { - TAG: "Eq", - _0: "foo", - _1: "foo".link("https://reason.ml") - }; - }) + return { + TAG: "Eq", + _0: "foo", + _1: "foo".link("https://reason.ml") + }; + }) ], tl: { hd: [ "File \"js_string_test.res\", line 138, characters 5-12", (function (param) { - return { - TAG: "Ok", - _0: "ab".includes("a") - }; - }) + return { + TAG: "Ok", + _0: "ab".includes("a") + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_typed_array_test.js b/jscomp/test/js_typed_array_test.js index 3cf244c886..ccbbab2686 100644 --- a/jscomp/test/js_typed_array_test.js +++ b/jscomp/test/js_typed_array_test.js @@ -29,2160 +29,2160 @@ var x = new Int8Array([ var suites_0 = [ "array_buffer - make", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: new ArrayBuffer(5).byteLength - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: new ArrayBuffer(5).byteLength + }; + }) ]; var suites_1 = { hd: [ "array_buffer - byteLength", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: new ArrayBuffer(5).byteLength - }; - }) + return { + TAG: "Eq", + _0: 5, + _1: new ArrayBuffer(5).byteLength + }; + }) ], tl: { hd: [ "array_buffer - slice", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_typed_array.$$ArrayBuffer.slice(2, 4, new ArrayBuffer(5)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_typed_array.$$ArrayBuffer.slice(2, 4, new ArrayBuffer(5)).byteLength + }; + }) ], tl: { hd: [ "array_buffer - sliceFrom", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_typed_array.$$ArrayBuffer.sliceFrom(2, new ArrayBuffer(5)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_typed_array.$$ArrayBuffer.sliceFrom(2, new ArrayBuffer(5)).byteLength + }; + }) ], tl: { hd: [ "typed_array - unsafe_get", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])[3] - }; - }) - ], - tl: { - hd: [ - "typed_array - unsafe_set", - (function (param) { - var a = new Int8Array([ + return { + TAG: "Eq", + _0: 4, + _1: new Int8Array([ 1, 2, 3, 4, 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + ])[3] + }; + }) + ], + tl: { + hd: [ + "typed_array - unsafe_set", + (function (param) { + var a = new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "typed_array - buffer", (function (param) { + return { + TAG: "Eq", + _0: new Int8Array([ + 3, + 4, + 5 + ]), + _1: new Int8Array(new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ]).buffer, 2) + }; + }) + ], + tl: { + hd: [ + "typed_array - byteLength", + (function (param) { return { TAG: "Eq", - _0: new Int8Array([ + _0: 10, + _1: new Int16Array([ + 1, + 2, 3, 4, 5 - ]), - _1: new Int8Array(new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ]).buffer, 2) + ]).byteLength }; }) - ], - tl: { - hd: [ - "typed_array - byteLength", - (function (param) { + ], + tl: { + hd: [ + "typed_array - byteOffset", + (function (param) { return { TAG: "Eq", - _0: 10, - _1: new Int16Array([ + _0: 0, + _1: new Int8Array([ 1, 2, 3, 4, 5 - ]).byteLength + ]).byteOffset }; }) - ], - tl: { - hd: [ - "typed_array - byteOffset", - (function (param) { + ], + tl: { + hd: [ + "typed_array - setArray", + (function (param) { + var f = function (a) { + Js_typed_array.$$Int8Array.setArray([ + 9, + 8, + 7 + ], a); + return a; + }; return { TAG: "Eq", - _0: 0, - _1: new Int8Array([ + _0: new Int8Array([ + 9, + 8, + 7, + 4, + 5 + ]), + _1: f(new Int8Array([ 1, 2, 3, 4, 5 - ]).byteOffset + ])) }; }) - ], - tl: { - hd: [ - "typed_array - setArray", - (function (param) { + ], + tl: { + hd: [ + "typed_array - setArrayOffset", + (function (param) { var f = function (a) { - Js_typed_array.$$Int8Array.setArray([ - 9, - 8, - 7 - ], a); + Js_typed_array.$$Int8Array.setArrayOffset([ + 9, + 8, + 7 + ], 2, a); return a; }; return { TAG: "Eq", _0: new Int8Array([ + 1, + 2, 9, 8, - 7, - 4, - 5 + 7 ]), _1: f(new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + 1, + 2, + 3, + 4, + 5 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - setArrayOffset", - (function (param) { - var f = function (a) { - Js_typed_array.$$Int8Array.setArrayOffset([ - 9, - 8, - 7 - ], 2, a); - return a; - }; + ], + tl: { + hd: [ + "typed_array - length", + (function (param) { return { TAG: "Eq", - _0: new Int8Array([ + _0: 5, + _1: new Int8Array([ 1, 2, - 9, - 8, - 7 - ]), - _1: f(new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + 3, + 4, + 5 + ]).length }; }) - ], - tl: { - hd: [ - "typed_array - length", - (function (param) { + ], + tl: { + hd: [ + "typed_array - copyWithin", + (function (param) { return { TAG: "Eq", - _0: 5, - _1: new Int8Array([ + _0: new Int8Array([ + 1, + 2, + 3, + 1, + 2 + ]), + _1: Js_typed_array.$$Int8Array.copyWithin(-2, new Int8Array([ 1, 2, 3, 4, 5 - ]).length + ])) }; }) - ], - tl: { - hd: [ - "typed_array - copyWithin", - (function (param) { + ], + tl: { + hd: [ + "typed_array - copyWithinFrom", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 4, + 5, + 3, + 4, + 5 + ]), + _1: Js_typed_array.$$Int8Array.copyWithinFrom(0, 3, new Int8Array([ 1, 2, 3, - 1, - 2 - ]), - _1: Js_typed_array.$$Int8Array.copyWithin(-2, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + 4, + 5 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - copyWithinFrom", - (function (param) { + ], + tl: { + hd: [ + "typed_array - copyWithinFromRange", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ 4, - 5, + 2, 3, 4, 5 ]), - _1: Js_typed_array.$$Int8Array.copyWithinFrom(0, 3, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + _1: Js_typed_array.$$Int8Array.copyWithinFromRange(0, 3, 4, new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - copyWithinFromRange", - (function (param) { + ], + tl: { + hd: [ + "typed_array - fillInPlace", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ 4, - 2, - 3, 4, - 5 + 4 ]), - _1: Js_typed_array.$$Int8Array.copyWithinFromRange(0, 3, 4, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + _1: Js_typed_array.$$Int8Array.fillInPlace(4, new Int8Array([ + 1, + 2, + 3 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - fillInPlace", - (function (param) { + ], + tl: { + hd: [ + "typed_array - fillFromInPlace", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ - 4, + 1, 4, 4 ]), - _1: Js_typed_array.$$Int8Array.fillInPlace(4, new Int8Array([ - 1, - 2, - 3 - ])) + _1: Js_typed_array.$$Int8Array.fillFromInPlace(4, 1, new Int8Array([ + 1, + 2, + 3 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - fillFromInPlace", - (function (param) { + ], + tl: { + hd: [ + "typed_array - fillRangeInPlace", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ 1, 4, - 4 + 3 ]), - _1: Js_typed_array.$$Int8Array.fillFromInPlace(4, 1, new Int8Array([ - 1, - 2, - 3 - ])) + _1: Js_typed_array.$$Int8Array.fillRangeInPlace(4, 1, 2, new Int8Array([ + 1, + 2, + 3 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - fillRangeInPlace", - (function (param) { + ], + tl: { + hd: [ + "typed_array - reverseInPlace", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 3, + 2, + 1 + ]), + _1: new Int8Array([ 1, - 4, + 2, 3 - ]), - _1: Js_typed_array.$$Int8Array.fillRangeInPlace(4, 1, 2, new Int8Array([ - 1, - 2, - 3 - ])) + ]).reverse() }; }) - ], - tl: { - hd: [ - "typed_array - reverseInPlace", - (function (param) { + ], + tl: { + hd: [ + "typed_array - sortInPlace", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ - 3, + 1, 2, - 1 + 3 ]), _1: new Int8Array([ - 1, - 2, - 3 - ]).reverse() + 3, + 1, + 2 + ]).sort() }; }) - ], - tl: { - hd: [ - "typed_array - sortInPlace", - (function (param) { + ], + tl: { + hd: [ + "typed_array - sortInPlaceWith", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ - 1, + 3, 2, - 3 + 1 ]), - _1: new Int8Array([ - 3, - 1, - 2 - ]).sort() + _1: Js_typed_array.$$Int8Array.sortInPlaceWith((function (a, b) { + return b - a | 0; + }), new Int8Array([ + 3, + 1, + 2 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - sortInPlaceWith", - (function (param) { - return { - TAG: "Eq", - _0: new Int8Array([ - 3, - 2, - 1 - ]), - _1: Js_typed_array.$$Int8Array.sortInPlaceWith((function (a, b) { - return b - a | 0; - }), new Int8Array([ - 3, - 1, - 2 - ])) - }; - }) ], tl: { hd: [ "typed_array - includes", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_typed_array.$$Int8Array.includes(3, new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_typed_array.$$Int8Array.includes(3, new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - indexOf", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Js_typed_array.$$Int8Array.indexOf(2, new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Js_typed_array.$$Int8Array.indexOf(2, new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - indexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: Js_typed_array.$$Int8Array.indexOfFrom(2, 2, new Int8Array([ - 1, - 2, - 3, - 2 - ])) - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: Js_typed_array.$$Int8Array.indexOfFrom(2, 2, new Int8Array([ + 1, + 2, + 3, + 2 + ])) + }; + }) ], tl: { hd: [ "typed_array - join", (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: new Int8Array([ - 1, - 2, - 3 - ]).join() - }; - }) + return { + TAG: "Eq", + _0: "1,2,3", + _1: new Int8Array([ + 1, + 2, + 3 + ]).join() + }; + }) ], tl: { hd: [ "typed_array - joinWith", (function (param) { - return { - TAG: "Eq", - _0: "1;2;3", - _1: Js_typed_array.$$Int8Array.joinWith(";", new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: "1;2;3", + _1: Js_typed_array.$$Int8Array.joinWith(";", new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - lastIndexOf", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Js_typed_array.$$Int8Array.lastIndexOf(2, new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Js_typed_array.$$Int8Array.lastIndexOf(2, new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - lastIndexOfFrom", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Js_typed_array.$$Int8Array.lastIndexOfFrom(2, 2, new Int8Array([ - 1, - 2, - 3, - 2 - ])) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Js_typed_array.$$Int8Array.lastIndexOfFrom(2, 2, new Int8Array([ + 1, + 2, + 3, + 2 + ])) + }; + }) ], tl: { hd: [ "typed_array - slice", (function (param) { + return { + TAG: "Eq", + _0: new Int8Array([ + 2, + 3 + ]), + _1: Js_typed_array.$$Int8Array.slice(1, 3, new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ])) + }; + }) + ], + tl: { + hd: [ + "typed_array - copy", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 1, 2, - 3 + 3, + 4, + 5 ]), - _1: Js_typed_array.$$Int8Array.slice(1, 3, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + _1: new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ]).slice() }; }) - ], - tl: { - hd: [ - "typed_array - copy", - (function (param) { + ], + tl: { + hd: [ + "typed_array - sliceFrom", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 3, + 4, + 5 + ]), + _1: Js_typed_array.$$Int8Array.sliceFrom(2, new Int8Array([ 1, 2, 3, 4, 5 - ]), - _1: new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ]).slice() + ])) }; }) - ], - tl: { - hd: [ - "typed_array - sliceFrom", - (function (param) { + ], + tl: { + hd: [ + "typed_array - subarray", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 2, + 3 + ]), + _1: Js_typed_array.$$Int8Array.subarray(1, 3, new Int8Array([ + 1, + 2, 3, 4, 5 - ]), - _1: Js_typed_array.$$Int8Array.sliceFrom(2, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + ])) }; }) - ], - tl: { - hd: [ - "typed_array - subarray", - (function (param) { + ], + tl: { + hd: [ + "typed_array - subarrayFrom", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ - 2, - 3 + 3, + 4, + 5 ]), - _1: Js_typed_array.$$Int8Array.subarray(1, 3, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) + _1: Js_typed_array.$$Int8Array.subarrayFrom(2, new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - subarrayFrom", - (function (param) { - return { - TAG: "Eq", - _0: new Int8Array([ - 3, - 4, - 5 - ]), - _1: Js_typed_array.$$Int8Array.subarrayFrom(2, new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ])) - }; - }) ], tl: { hd: [ "typed_array - toString", (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: new Int8Array([ - 1, - 2, - 3 - ]).toString() - }; - }) + return { + TAG: "Eq", + _0: "1,2,3", + _1: new Int8Array([ + 1, + 2, + 3 + ]).toString() + }; + }) ], tl: { hd: [ "typed_array - toLocaleString", (function (param) { - return { - TAG: "Eq", - _0: "1,2,3", - _1: new Int8Array([ - 1, - 2, - 3 - ]).toLocaleString() - }; - }) + return { + TAG: "Eq", + _0: "1,2,3", + _1: new Int8Array([ + 1, + 2, + 3 + ]).toLocaleString() + }; + }) ], tl: { hd: [ "typed_array - every", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_typed_array.$$Int8Array.every((function (n) { - return n > 0; - }), new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_typed_array.$$Int8Array.every((function (n) { + return n > 0; + }), new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - everyi", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_typed_array.$$Int8Array.everyi((function (param, i) { - return i > 0; - }), new Int8Array([ - 1, - 2, - 3 - ])) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_typed_array.$$Int8Array.everyi((function (param, i) { + return i > 0; + }), new Int8Array([ + 1, + 2, + 3 + ])) + }; + }) ], tl: { hd: [ "typed_array - filter", (function (param) { + return { + TAG: "Eq", + _0: new Int8Array([ + 2, + 4 + ]), + _1: Js_typed_array.$$Int8Array.filter((function (n) { + return n % 2 === 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) + ], + tl: { + hd: [ + "typed_array - filteri", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 1, + 3 + ]), + _1: Js_typed_array.$$Int8Array.filteri((function (param, i) { + return i % 2 === 0; + }), new Int8Array([ + 1, 2, + 3, 4 - ]), - _1: Js_typed_array.$$Int8Array.filter((function (n) { - return n % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) + ])) }; }) - ], - tl: { - hd: [ - "typed_array - filteri", - (function (param) { - return { - TAG: "Eq", - _0: new Int8Array([ - 1, - 3 - ]), - _1: Js_typed_array.$$Int8Array.filteri((function (param, i) { - return i % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) ], tl: { hd: [ "typed_array - find", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_typed_array.$$Int8Array.find((function (n) { - return n % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_typed_array.$$Int8Array.find((function (n) { + return n % 2 === 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - findi", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Js_typed_array.$$Int8Array.findi((function (param, i) { - return i % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Js_typed_array.$$Int8Array.findi((function (param, i) { + return i % 2 === 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - findIndex", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Js_typed_array.$$Int8Array.findIndex((function (n) { - return n % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Js_typed_array.$$Int8Array.findIndex((function (n) { + return n % 2 === 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - findIndexi", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Js_typed_array.$$Int8Array.findIndexi((function (param, i) { - return i % 2 === 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Js_typed_array.$$Int8Array.findIndexi((function (param, i) { + return i % 2 === 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - forEach", (function (param) { + var sum = { + contents: 0 + }; + Js_typed_array.$$Int8Array.forEach((function (n) { + sum.contents = sum.contents + n | 0; + }), new Int8Array([ + 1, + 2, + 3 + ])); + return { + TAG: "Eq", + _0: 6, + _1: sum.contents + }; + }) + ], + tl: { + hd: [ + "typed_array - forEachi", + (function (param) { var sum = { contents: 0 }; - Js_typed_array.$$Int8Array.forEach((function (n) { - sum.contents = sum.contents + n | 0; - }), new Int8Array([ - 1, - 2, - 3 - ])); + Js_typed_array.$$Int8Array.forEachi((function (param, i) { + sum.contents = sum.contents + i | 0; + }), new Int8Array([ + 1, + 2, + 3 + ])); return { TAG: "Eq", - _0: 6, + _0: 3, _1: sum.contents }; }) - ], - tl: { - hd: [ - "typed_array - forEachi", - (function (param) { - var sum = { - contents: 0 - }; - Js_typed_array.$$Int8Array.forEachi((function (param, i) { - sum.contents = sum.contents + i | 0; - }), new Int8Array([ - 1, - 2, - 3 - ])); - return { - TAG: "Eq", - _0: 3, - _1: sum.contents - }; - }) ], tl: { hd: [ "typed_array - map", (function (param) { + return { + TAG: "Eq", + _0: new Int8Array([ + 2, + 4, + 6, + 8 + ]), + _1: Js_typed_array.$$Int8Array.map((function (n) { + return (n << 1); + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) + ], + tl: { + hd: [ + "typed_array - map", + (function (param) { return { TAG: "Eq", _0: new Int8Array([ + 0, 2, 4, - 6, - 8 + 6 ]), - _1: Js_typed_array.$$Int8Array.map((function (n) { - return (n << 1); - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) + _1: Js_typed_array.$$Int8Array.mapi((function (param, i) { + return (i << 1); + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) }; }) - ], - tl: { - hd: [ - "typed_array - map", - (function (param) { - return { - TAG: "Eq", - _0: new Int8Array([ - 0, - 2, - 4, - 6 - ]), - _1: Js_typed_array.$$Int8Array.mapi((function (param, i) { - return (i << 1); - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) ], tl: { hd: [ "typed_array - reduce", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: Js_typed_array.$$Int8Array.reduce((function (acc, n) { - return acc - n | 0; - }), 0, new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: Js_typed_array.$$Int8Array.reduce((function (acc, n) { + return acc - n | 0; + }), 0, new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - reducei", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: Js_typed_array.$$Int8Array.reducei((function (acc, param, i) { - return acc - i | 0; - }), 0, new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: Js_typed_array.$$Int8Array.reducei((function (acc, param, i) { + return acc - i | 0; + }), 0, new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - reduceRight", (function (param) { - return { - TAG: "Eq", - _0: -10, - _1: Js_typed_array.$$Int8Array.reduceRight((function (acc, n) { - return acc - n | 0; - }), 0, new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: -10, + _1: Js_typed_array.$$Int8Array.reduceRight((function (acc, n) { + return acc - n | 0; + }), 0, new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - reduceRighti", (function (param) { - return { - TAG: "Eq", - _0: -6, - _1: Js_typed_array.$$Int8Array.reduceRighti((function (acc, param, i) { - return acc - i | 0; - }), 0, new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: -6, + _1: Js_typed_array.$$Int8Array.reduceRighti((function (acc, param, i) { + return acc - i | 0; + }), 0, new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - some", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Js_typed_array.$$Int8Array.some((function (n) { - return n <= 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Js_typed_array.$$Int8Array.some((function (n) { + return n <= 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "typed_array - somei", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Js_typed_array.$$Int8Array.somei((function (param, i) { - return i <= 0; - }), new Int8Array([ - 1, - 2, - 3, - 4 - ])) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Js_typed_array.$$Int8Array.somei((function (param, i) { + return i <= 0; + }), new Int8Array([ + 1, + 2, + 3, + 4 + ])) + }; + }) ], tl: { hd: [ "int8_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Int8Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Int8Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "int8_array - make", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Int8Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Int8Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "int8_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Int8Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Int8Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "int8_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Int8Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Int8Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "int8_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 2, - _1: new Int8Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 2, + _1: new Int8Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "int8_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Int8Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Int8Array(3).byteLength + }; + }) ], tl: { hd: [ "int8_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Int8Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Int8Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "uint8_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Uint8Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Uint8Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "uint8_array - make", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Uint8Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Uint8Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "uint8_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Uint8Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Uint8Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "uint8_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Uint8Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Uint8Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "uint8_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 2, - _1: new Uint8Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 2, + _1: new Uint8Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "uint8_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Uint8Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Uint8Array(3).byteLength + }; + }) ], tl: { hd: [ "uint8_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Uint8Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Uint8Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "uint8clamped_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: Uint8ClampedArray.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: Uint8ClampedArray.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "uint8clamped_array - make", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Uint8ClampedArray([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Uint8ClampedArray([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "uint8clamped_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Uint8ClampedArray(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Uint8ClampedArray(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "uint8clamped_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Uint8ClampedArray(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Uint8ClampedArray(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "uint8clamped_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 2, - _1: new Uint8ClampedArray(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 2, + _1: new Uint8ClampedArray(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "uint8clamped_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: new Uint8ClampedArray(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: new Uint8ClampedArray(3).byteLength + }; + }) ], tl: { hd: [ "uint8clamped_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Uint8ClampedArray([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Uint8ClampedArray([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "int16_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Int16Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Int16Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "int16_array - make", (function (param) { - return { - TAG: "Eq", - _0: 6, - _1: new Int16Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 6, + _1: new Int16Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "int16_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Int16Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Int16Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "int16_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Int16Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Int16Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "int16_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 4, - _1: new Int16Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 4, + _1: new Int16Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "int16_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 6, - _1: new Int16Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 6, + _1: new Int16Array(3).byteLength + }; + }) ], tl: { hd: [ "int16_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Int16Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Int16Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "uint16_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Uint16Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Uint16Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "uint16_array - make", (function (param) { - return { - TAG: "Eq", - _0: 6, - _1: new Uint16Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 6, + _1: new Uint16Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "uint16_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Uint16Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Uint16Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "uint16_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Uint16Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Uint16Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "uint16_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 4, - _1: new Uint16Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 4, + _1: new Uint16Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "uint16_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 6, - _1: new Uint16Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 6, + _1: new Uint16Array(3).byteLength + }; + }) ], tl: { hd: [ "uint16_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Uint16Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Uint16Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "int32_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Int32Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Int32Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "int32_array - make", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Int32Array($$Array.map((function (prim) { - return prim; - }), [ - 1, - 2, - 3 - ])).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Int32Array($$Array.map((function (prim) { + return prim; + }), [ + 1, + 2, + 3 + ])).byteLength + }; + }) ], tl: { hd: [ "int32_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Int32Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Int32Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "int32_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Int32Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Int32Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "int32_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 8, - _1: new Int32Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 8, + _1: new Int32Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "int32_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Int32Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Int32Array(3).byteLength + }; + }) ], tl: { hd: [ "int32_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Int32Array($$Array.map((function (prim) { - return prim; - }), [ - 1, - 2, - 3, - 4, - 5 - ])); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Int32Array($$Array.map((function (prim) { + return prim; + }), [ + 1, + 2, + 3, + 4, + 5 + ])); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "uint32_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Uint32Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Uint32Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "uint32_array - make", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Uint32Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Uint32Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "uint32_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Uint32Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Uint32Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "uint32_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Uint32Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Uint32Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "uint32_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 8, - _1: new Uint32Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 8, + _1: new Uint32Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "uint32_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Uint32Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Uint32Array(3).byteLength + }; + }) ], tl: { hd: [ "uint32_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Uint32Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Uint32Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "float32_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Float32Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Float32Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "float32_array - make", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Float32Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Float32Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "float32_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Float32Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Float32Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "float32_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Float32Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Float32Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "float32_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 8, - _1: new Float32Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 8, + _1: new Float32Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "float32_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 12, - _1: new Float32Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 12, + _1: new Float32Array(3).byteLength + }; + }) ], tl: { hd: [ "float32_array - unsafe_set - typed_array sanity check", (function (param) { - var a = new Float32Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + var a = new Float32Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "float64_array - _BYTES_PER_ELEMENT", (function (param) { - return { - TAG: "Eq", - _0: 8, - _1: Float64Array.BYTES_PER_ELEMENT - }; - }) + return { + TAG: "Eq", + _0: 8, + _1: Float64Array.BYTES_PER_ELEMENT + }; + }) ], tl: { hd: [ "float64_array - make", (function (param) { - return { - TAG: "Eq", - _0: 24, - _1: new Float64Array([ - 1, - 2, - 3 - ]).byteLength - }; - }) + return { + TAG: "Eq", + _0: 24, + _1: new Float64Array([ + 1, + 2, + 3 + ]).byteLength + }; + }) ], tl: { hd: [ "float64_array - fromBuffer", (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new Float64Array(new ArrayBuffer(32)).byteLength - }; - }) + return { + TAG: "Eq", + _0: 32, + _1: new Float64Array(new ArrayBuffer(32)).byteLength + }; + }) ], tl: { hd: [ "float64_array - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new Float64Array(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new Float64Array(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "float64_array - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 16, - _1: new Float64Array(buffer, 8, 2).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 16, + _1: new Float64Array(buffer, 8, 2).byteLength + }; + }) ], tl: { hd: [ "float64_array - fromLength", (function (param) { - return { - TAG: "Eq", - _0: 24, - _1: new Float64Array(3).byteLength - }; - }) + return { + TAG: "Eq", + _0: 24, + _1: new Float64Array(3).byteLength + }; + }) ], tl: { hd: [ - "float64_array - unsafe_set - typed_array sanity check", - (function (param) { - var a = new Float64Array([ - 1, - 2, - 3, - 4, - 5 - ]); - a[3] = 14; - return { - TAG: "Eq", - _0: 14, - _1: a[3] - }; - }) + "float64_array - unsafe_set - typed_array sanity check", + (function (param) { + var a = new Float64Array([ + 1, + 2, + 3, + 4, + 5 + ]); + a[3] = 14; + return { + TAG: "Eq", + _0: 14, + _1: a[3] + }; + }) ], tl: { hd: [ "DataView - make, byteLength", (function (param) { + return { + TAG: "Eq", + _0: 32, + _1: new DataView(new ArrayBuffer(32)).byteLength + }; + }) + ], + tl: { + hd: [ + "DataView - fromBuffer", + (function (param) { return { TAG: "Eq", _0: 32, _1: new DataView(new ArrayBuffer(32)).byteLength }; }) - ], - tl: { - hd: [ - "DataView - fromBuffer", - (function (param) { - return { - TAG: "Eq", - _0: 32, - _1: new DataView(new ArrayBuffer(32)).byteLength - }; - }) ], tl: { hd: [ "DataView - fromBufferOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 24, - _1: new DataView(buffer, 8).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 24, + _1: new DataView(buffer, 8).byteLength + }; + }) ], tl: { hd: [ "DataView - fromBufferRange", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 4, - _1: new DataView(buffer, 8, 4).byteLength - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 4, + _1: new DataView(buffer, 8, 4).byteLength + }; + }) ], tl: { hd: [ "DataView - buffer", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: buffer, - _1: new DataView(buffer).buffer - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: buffer, + _1: new DataView(buffer).buffer + }; + }) ], tl: { hd: [ "DataView - byteOffset", (function (param) { - var buffer = new ArrayBuffer(32); - return { - TAG: "Eq", - _0: 8, - _1: new DataView(buffer, 8).byteOffset - }; - }) + var buffer = new ArrayBuffer(32); + return { + TAG: "Eq", + _0: 8, + _1: new DataView(buffer, 8).byteOffset + }; + }) ], tl: { hd: [ "DataView - setInt8, getInt8", (function (param) { + var buffer = new ArrayBuffer(8); + var view = new DataView(buffer); + view.setInt8(0, 1); + return { + TAG: "Eq", + _0: 1, + _1: view.getInt8(0) + }; + }) + ], + tl: { + hd: [ + "DataView - setUint8, getUint8", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setInt8(0, 1); + view.setUint8(0, 128); return { TAG: "Eq", - _0: 1, - _1: view.getInt8(0) + _0: 128, + _1: view.getUint8(0) }; }) - ], - tl: { - hd: [ - "DataView - setUint8, getUint8", - (function (param) { + ], + tl: { + hd: [ + "DataView - setInt16, getInt16", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setUint8(0, 128); + view.setInt16(0, 257); return { TAG: "Eq", - _0: 128, - _1: view.getUint8(0) + _0: 257, + _1: view.getInt16(0) }; }) - ], - tl: { - hd: [ - "DataView - setInt16, getInt16", - (function (param) { + ], + tl: { + hd: [ + "DataView - getInt16LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setInt16(0, 257); + view.setInt16(0, 25000, 1); return { TAG: "Eq", - _0: 257, - _1: view.getInt16(0) + _0: 25000, + _1: view.getInt16(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getInt16LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setInt16LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); view.setInt16(0, 25000, 1); return { TAG: "Eq", - _0: 25000, - _1: view.getInt16(0, 1) + _0: -22431, + _1: view.getInt16(0) }; }) - ], - tl: { - hd: [ - "DataView - setInt16LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setUint16, getUint16", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setInt16(0, 25000, 1); + view.setUint16(0, 32768); return { TAG: "Eq", - _0: -22431, - _1: view.getInt16(0) + _0: 32768, + _1: view.getUint16(0) }; }) - ], - tl: { - hd: [ - "DataView - setUint16, getUint16", - (function (param) { + ], + tl: { + hd: [ + "DataView - getUint16LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setUint16(0, 32768); + view.setUint16(0, 32768, 1); return { TAG: "Eq", _0: 32768, - _1: view.getUint16(0) + _1: view.getUint16(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getUint16LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setUint16LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); view.setUint16(0, 32768, 1); return { TAG: "Eq", - _0: 32768, - _1: view.getUint16(0, 1) + _0: 128, + _1: view.getUint16(0) }; }) - ], - tl: { - hd: [ - "DataView - setUint16LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setInt32, getInt32", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setUint16(0, 32768, 1); + view.setInt32(0, 65537); return { TAG: "Eq", - _0: 128, - _1: view.getUint16(0) + _0: 65537, + _1: view.getInt32(0) }; }) - ], - tl: { - hd: [ - "DataView - setInt32, getInt32", - (function (param) { + ], + tl: { + hd: [ + "DataView - getInt32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setInt32(0, 65537); + view.setInt32(0, 65537, 1); return { TAG: "Eq", _0: 65537, - _1: view.getInt32(0) + _1: view.getInt32(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getInt32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setInt32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); view.setInt32(0, 65537, 1); return { TAG: "Eq", - _0: 65537, - _1: view.getInt32(0, 1) + _0: 16777472, + _1: view.getInt32(0) }; }) - ], - tl: { - hd: [ - "DataView - setInt32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setUint32, getUint32", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setInt32(0, 65537, 1); + view.setUint32(0, 65537); return { TAG: "Eq", - _0: 16777472, - _1: view.getInt32(0) + _0: 65537, + _1: view.getUint32(0) }; }) - ], - tl: { - hd: [ - "DataView - setUint32, getUint32", - (function (param) { + ], + tl: { + hd: [ + "DataView - getUint32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setUint32(0, 65537); + view.setUint32(0, 65537, 1); return { TAG: "Eq", _0: 65537, - _1: view.getUint32(0) + _1: view.getUint32(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getUint32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setUint32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); view.setUint32(0, 65537, 1); return { TAG: "Eq", - _0: 65537, - _1: view.getUint32(0, 1) + _0: 16777472, + _1: view.getUint32(0) }; }) - ], - tl: { - hd: [ - "DataView - setUint32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setFloat32, getFloat32", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setUint32(0, 65537, 1); + view.setFloat32(0, 65537.0); return { TAG: "Eq", - _0: 16777472, - _1: view.getUint32(0) + _0: 65537.0, + _1: view.getFloat32(0) }; }) - ], - tl: { - hd: [ - "DataView - setFloat32, getFloat32", - (function (param) { + ], + tl: { + hd: [ + "DataView - getFloat32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setFloat32(0, 65537.0); + view.setFloat32(0, 65537.0, 1); return { TAG: "Eq", _0: 65537.0, - _1: view.getFloat32(0) + _1: view.getFloat32(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getFloat32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setFloat32LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setFloat32(0, 65537.0, 1); + view.setFloat32(0, 1.0, 1); return { TAG: "Eq", - _0: 65537.0, - _1: view.getFloat32(0, 1) + _0: 4.600602988224807e-41, + _1: view.getFloat32(0) }; }) - ], - tl: { - hd: [ - "DataView - setFloat32LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setFloat64, getFloat64", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setFloat32(0, 1.0, 1); + view.setFloat64(0, 1e200); return { TAG: "Eq", - _0: 4.600602988224807e-41, - _1: view.getFloat32(0) + _0: 1e200, + _1: view.getFloat64(0) }; }) - ], - tl: { - hd: [ - "DataView - setFloat64, getFloat64", - (function (param) { + ], + tl: { + hd: [ + "DataView - getFloat64LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setFloat64(0, 1e200); + view.setFloat64(0, 1e200, 1); return { TAG: "Eq", _0: 1e200, - _1: view.getFloat64(0) + _1: view.getFloat64(0, 1) }; }) - ], - tl: { - hd: [ - "DataView - getFloat64LittleEndian", - (function (param) { + ], + tl: { + hd: [ + "DataView - setFloat64LittleEndian", + (function (param) { var buffer = new ArrayBuffer(8); var view = new DataView(buffer); - view.setFloat64(0, 1e200, 1); + view.setFloat64(0, 1.0, 1); return { TAG: "Eq", - _0: 1e200, - _1: view.getFloat64(0, 1) + _0: 3.03865e-319, + _1: view.getFloat64(0) }; }) - ], - tl: { - hd: [ - "DataView - setFloat64LittleEndian", - (function (param) { - var buffer = new ArrayBuffer(8); - var view = new DataView(buffer); - view.setFloat64(0, 1.0, 1); - return { - TAG: "Eq", - _0: 3.03865e-319, - _1: view.getFloat64(0) - }; - }) ], tl: /* [] */0 } diff --git a/jscomp/test/js_undefined_test.js b/jscomp/test/js_undefined_test.js index 19e721628f..eebbe8f6b4 100644 --- a/jscomp/test/js_undefined_test.js +++ b/jscomp/test/js_undefined_test.js @@ -8,139 +8,139 @@ var Js_undefined = require("../../lib/js/js_undefined.js"); var suites_0 = [ "toOption - empty", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ]; var suites_1 = { hd: [ "File \"js_undefined_test.res\", line 7, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: undefined - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: undefined + }; + }) ], tl: { hd: [ "return", (function (param) { - return { - TAG: "Eq", - _0: "something", - _1: Caml_option.undefined_to_opt("something") - }; - }) + return { + TAG: "Eq", + _0: "something", + _1: Caml_option.undefined_to_opt("something") + }; + }) ], tl: { hd: [ "test - empty", (function (param) { + return { + TAG: "Eq", + _0: true, + _1: true + }; + }) + ], + tl: { + hd: [ + "File \"js_undefined_test.res\", line 10, characters 5-12", + (function (param) { return { TAG: "Eq", _0: true, _1: true }; }) - ], - tl: { - hd: [ - "File \"js_undefined_test.res\", line 10, characters 5-12", - (function (param) { - return { - TAG: "Eq", - _0: true, - _1: true - }; - }) ], tl: { hd: [ "bind - empty", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_undefined.bind(undefined, (function (v) { - return v; - })) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_undefined.bind(undefined, (function (v) { + return v; + })) + }; + }) ], tl: { hd: [ "bind - 'a", (function (param) { - return { - TAG: "Eq", - _0: 4, - _1: Js_undefined.bind(2, (function (n) { - return (n << 1); - })) - }; - }) + return { + TAG: "Eq", + _0: 4, + _1: Js_undefined.bind(2, (function (n) { + return (n << 1); + })) + }; + }) ], tl: { hd: [ "iter - empty", (function (param) { + var hit = { + contents: false + }; + Js_undefined.iter(undefined, (function (param) { + hit.contents = true; + })); + return { + TAG: "Eq", + _0: false, + _1: hit.contents + }; + }) + ], + tl: { + hd: [ + "iter - 'a", + (function (param) { var hit = { - contents: false + contents: 0 }; - Js_undefined.iter(undefined, (function (param) { - hit.contents = true; - })); + Js_undefined.iter(2, (function (v) { + hit.contents = v; + })); return { TAG: "Eq", - _0: false, + _0: 2, _1: hit.contents }; }) - ], - tl: { - hd: [ - "iter - 'a", - (function (param) { - var hit = { - contents: 0 - }; - Js_undefined.iter(2, (function (v) { - hit.contents = v; - })); - return { - TAG: "Eq", - _0: 2, - _1: hit.contents - }; - }) ], tl: { hd: [ "fromOption - None", (function (param) { - return { - TAG: "Eq", - _0: undefined, - _1: Js_undefined.fromOption(undefined) - }; - }) + return { + TAG: "Eq", + _0: undefined, + _1: Js_undefined.fromOption(undefined) + }; + }) ], tl: { hd: [ "fromOption - Some", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Js_undefined.fromOption(2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Js_undefined.fromOption(2) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/jsoo_400_test.js b/jscomp/test/jsoo_400_test.js index f0071f38ed..f71bc40306 100644 --- a/jscomp/test/jsoo_400_test.js +++ b/jscomp/test/jsoo_400_test.js @@ -16,19 +16,19 @@ function u(param) { } Mt.from_pair_suites("Jsoo_400_test", { - hd: [ - "File \"jsoo_400_test.res\", line 7, characters 38-45", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - u(); - }) - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "File \"jsoo_400_test.res\", line 7, characters 38-45", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + u(); + }) + }; + }) + ], + tl: /* [] */0 +}); exports.u = u; /* Not a pure module */ diff --git a/jscomp/test/key_word_property_plus_test.js b/jscomp/test/key_word_property_plus_test.js index cb7b79c161..fe65523bd2 100644 --- a/jscomp/test/key_word_property_plus_test.js +++ b/jscomp/test/key_word_property_plus_test.js @@ -18,35 +18,35 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; } eq("File \"key_word_property_plus_test.res\", line 10, characters 2-9", [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14 - ].reduce((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 0), ((((((((((((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$clearImmediate | 0) + Global_mangles.$$clearInterval | 0) + Global_mangles.$$clearTimeout | 0) + Global_mangles.$$console | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$global | 0) + Global_mangles._module | 0) + Global_mangles.$$process | 0) + Global_mangles.$$require | 0) + Global_mangles.$$setImmediate | 0) + Global_mangles.$$setInterval | 0) + Global_mangles.$$setTimeout | 0); + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14 +].reduce((function (prim0, prim1) { + return prim0 + prim1 | 0; +}), 0), ((((((((((((Global_mangles.$$__dirname + Global_mangles.$$__filename | 0) + Global_mangles.$$clearImmediate | 0) + Global_mangles.$$clearInterval | 0) + Global_mangles.$$clearTimeout | 0) + Global_mangles.$$console | 0) + Global_mangles.$$exports | 0) + Global_mangles.$$global | 0) + Global_mangles._module | 0) + Global_mangles.$$process | 0) + Global_mangles.$$require | 0) + Global_mangles.$$setImmediate | 0) + Global_mangles.$$setInterval | 0) + Global_mangles.$$setTimeout | 0); Mt.from_pair_suites("Key_word_property_plus_test", suites.contents); diff --git a/jscomp/test/large_record_duplication_test.js b/jscomp/test/large_record_duplication_test.js index 56c7ff09e4..2f23480cd8 100644 --- a/jscomp/test/large_record_duplication_test.js +++ b/jscomp/test/large_record_duplication_test.js @@ -46,16 +46,16 @@ var h = { }; eq("File \"large_record_duplication_test.res\", line 70, characters 3-10", f_small(h), { - RE_EXN_ID: Small, - x: 2, - y: "" - }); + RE_EXN_ID: Small, + x: 2, + y: "" +}); eq("File \"large_record_duplication_test.res\", line 72, characters 3-10", Caml_obj.equal(h, { - RE_EXN_ID: Small, - x: 2, - y: "" - }), false); + RE_EXN_ID: Small, + x: 2, + y: "" +}), false); var v1 = { TAG: "A0", @@ -198,8 +198,8 @@ eq("File \"large_record_duplication_test.res\", line 275, characters 3-10", get_ eq("File \"large_record_duplication_test.res\", line 276, characters 3-10", get_x0$2(v3), 9); eq("File \"large_record_duplication_test.res\", line 277, characters 3-10", get_x0$2({ - RE_EXN_ID: "Not_found" - }), undefined); + RE_EXN_ID: "Not_found" +}), undefined); Mt.from_pair_suites("Large_record_duplication_test", suites.contents); diff --git a/jscomp/test/lazy_demo.js b/jscomp/test/lazy_demo.js index 4fdc4f534b..f8b7c08c49 100644 --- a/jscomp/test/lazy_demo.js +++ b/jscomp/test/lazy_demo.js @@ -4,13 +4,13 @@ var CamlinternalLazy = require("../../lib/js/camlinternalLazy.js"); var lazy1 = CamlinternalLazy.from_fun(function () { - console.log("Hello, lazy"); - return 1; - }); + console.log("Hello, lazy"); + return 1; +}); var lazy2 = CamlinternalLazy.from_fun(function () { - return 3; - }); + return 3; +}); console.log(lazy1, lazy2); diff --git a/jscomp/test/lazy_test.js b/jscomp/test/lazy_test.js index 5e1e4103d8..d8482e6545 100644 --- a/jscomp/test/lazy_test.js +++ b/jscomp/test/lazy_test.js @@ -10,8 +10,8 @@ var u = { }; var v = CamlinternalLazy.from_fun(function () { - u.contents = 32; - }); + u.contents = 32; +}); function lazy_test(param) { var h = u.contents; @@ -28,47 +28,47 @@ var u_v = { }; var u$1 = CamlinternalLazy.from_fun(function () { - u_v.contents = 2; - }); + u_v.contents = 2; +}); CamlinternalLazy.force(u$1); var exotic = CamlinternalLazy.force; var l_from_fun = CamlinternalLazy.from_fun(function () { - return 3; - }); + return 3; +}); var forward_test = CamlinternalLazy.from_fun(function () { - var u = 3; - u = u + 1 | 0; - return u; - }); + var u = 3; + u = u + 1 | 0; + return u; +}); var f005 = CamlinternalLazy.from_fun(function () { - return 6; - }); + return 6; +}); var f006 = CamlinternalLazy.from_fun(function () { - return function (param) { - return 3; - }; - }); + return function (param) { + return 3; + }; +}); var f007 = CamlinternalLazy.from_fun(function () { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - }); + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; +}); var f008 = CamlinternalLazy.from_fun(function () { - console.log("hi"); - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - }); + console.log("hi"); + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; +}); var a2 = CamlinternalLazy.from_val; @@ -85,138 +85,136 @@ var a7 = CamlinternalLazy.force(a5); var a8 = CamlinternalLazy.force(a6); Mt.from_pair_suites("Lazy_test", { + hd: [ + "simple", + (function (param) { + return { + TAG: "Eq", + _0: lazy_test(), + _1: [ + 3, + 32 + ] + }; + }) + ], + tl: { + hd: [ + "lazy_force", + (function (param) { + return { + TAG: "Eq", + _0: u_v.contents, + _1: 2 + }; + }) + ], + tl: { hd: [ - "simple", + "lazy_from_fun", (function (param) { - return { - TAG: "Eq", - _0: lazy_test(), - _1: [ - 3, - 32 - ] - }; - }) + return { + TAG: "Eq", + _0: CamlinternalLazy.force(l_from_fun), + _1: 3 + }; + }) ], tl: { hd: [ - "lazy_force", + "lazy_from_val", (function (param) { - return { - TAG: "Eq", - _0: u_v.contents, - _1: 2 - }; - }) + return { + TAG: "Eq", + _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), + _1: 3 + }; + }) ], tl: { hd: [ - "lazy_from_fun", + "lazy_from_val2", (function (param) { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(l_from_fun), - _1: 3 - }; - }) + return { + TAG: "Eq", + _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(function () { + return 3; + })))), + _1: 3 + }; + }) ], tl: { hd: [ - "lazy_from_val", + "lazy_from_val3", (function (param) { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.from_val(3)), - _1: 3 - }; - }) + debugger; + return { + TAG: "Eq", + _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(forward_test))), + _1: 4 + }; + }) ], tl: { hd: [ - "lazy_from_val2", + "lazy_test.res", (function (param) { - return { - TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(CamlinternalLazy.from_fun(function () { - return 3; - })))), - _1: 3 - }; - }) + return { + TAG: "Eq", + _0: a3, + _1: a4 + }; + }) ], tl: { hd: [ - "lazy_from_val3", + "lazy_test.res", (function (param) { - debugger; - return { - TAG: "Eq", - _0: CamlinternalLazy.force(CamlinternalLazy.force(CamlinternalLazy.from_val(forward_test))), - _1: 4 - }; - }) + return { + TAG: "Eq", + _0: a7, + _1: undefined + }; + }) ], tl: { hd: [ "lazy_test.res", (function (param) { - return { - TAG: "Eq", - _0: a3, - _1: a4 - }; - }) + return { + TAG: "Eq", + _0: a8, + _1: undefined + }; + }) ], tl: { hd: [ - "lazy_test.res", + "File \"lazy_test.res\", line 95, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: a7, - _1: undefined - }; - }) + return { + TAG: "Ok", + _0: Lazy.is_val(CamlinternalLazy.from_val(3)) + }; + }) ], tl: { hd: [ - "lazy_test.res", + "File \"lazy_test.res\", line 96, characters 7-14", (function (param) { - return { - TAG: "Eq", - _0: a8, - _1: undefined - }; - }) - ], - tl: { - hd: [ - "File \"lazy_test.res\", line 95, characters 7-14", - (function (param) { - return { - TAG: "Ok", - _0: Lazy.is_val(CamlinternalLazy.from_val(3)) + return { + TAG: "Ok", + _0: !Lazy.is_val(CamlinternalLazy.from_fun(function () { + throw { + RE_EXN_ID: "Not_found", + Error: new Error() }; - }) - ], - tl: { - hd: [ - "File \"lazy_test.res\", line 96, characters 7-14", - (function (param) { - return { - TAG: "Ok", - _0: !Lazy.is_val(CamlinternalLazy.from_fun(function () { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - })) - }; - }) - ], - tl: /* [] */0 - } - } + })) + }; + }) + ], + tl: /* [] */0 } } } @@ -225,7 +223,9 @@ Mt.from_pair_suites("Lazy_test", { } } } - }); + } + } +}); exports.v = v; exports.lazy_test = lazy_test; diff --git a/jscomp/test/lib_js_test.js b/jscomp/test/lib_js_test.js index 814ac7a6d7..a89af4d7b7 100644 --- a/jscomp/test/lib_js_test.js +++ b/jscomp/test/lib_js_test.js @@ -4,27 +4,27 @@ var Mt = require("./mt.js"); console.log(JSON.stringify({ - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +})); console.log("hey"); var suites_0 = [ "anything_to_string", (function (param) { - return { - TAG: "Eq", - _0: "3", - _1: String(3) - }; - }) + return { + TAG: "Eq", + _0: "3", + _1: String(3) + }; + }) ]; var suites = { diff --git a/jscomp/test/libqueue_test.js b/jscomp/test/libqueue_test.js index 851eca1f2d..194fb555f8 100644 --- a/jscomp/test/libqueue_test.js +++ b/jscomp/test/libqueue_test.js @@ -9,11 +9,11 @@ var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function to_list(q) { return List.rev(Queue.fold((function (l, x) { - return { - hd: x, - tl: l - }; - }), /* [] */0, q)); + return { + hd: x, + tl: l + }; + }), /* [] */0, q)); } var Q = { @@ -70,9 +70,9 @@ if (!(to_list(q) === /* [] */0 && q.length === 0)) { Queue.add(1, q); if (!(Caml_obj.equal(to_list(q), { - hd: 1, - tl: /* [] */0 - }) && q.length === 1)) { + hd: 1, + tl: /* [] */0 + }) && q.length === 1)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -87,12 +87,12 @@ if (!(Caml_obj.equal(to_list(q), { Queue.add(2, q); if (!(Caml_obj.equal(to_list(q), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) && q.length === 2)) { + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } + }) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -107,15 +107,15 @@ if (!(Caml_obj.equal(to_list(q), { Queue.add(3, q); if (!(Caml_obj.equal(to_list(q), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) && q.length === 3)) { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -130,18 +130,18 @@ if (!(Caml_obj.equal(to_list(q), { Queue.add(4, q); if (!(Caml_obj.equal(to_list(q), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }) && q.length === 4)) { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } + }) && q.length === 4)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -166,15 +166,15 @@ if (Queue.take(q) !== 1) { } if (!(Caml_obj.equal(to_list(q), { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - }) && q.length === 3)) { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + }) && q.length === 3)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -199,12 +199,12 @@ if (Queue.take(q) !== 2) { } if (!(Caml_obj.equal(to_list(q), { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - }) && q.length === 2)) { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + }) && q.length === 2)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -229,9 +229,9 @@ if (Queue.take(q) !== 3) { } if (!(Caml_obj.equal(to_list(q), { - hd: 4, - tl: /* [] */0 - }) && q.length === 1)) { + hd: 4, + tl: /* [] */0 + }) && q.length === 1)) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -530,10 +530,10 @@ if (!does_raise(Queue.take, q$3)) { } if (!Caml_obj.equal(q$3, { - length: 0, - first: "Nil", - last: "Nil" - })) { + length: 0, + first: "Nil", + last: "Nil" + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -572,28 +572,26 @@ for(var i$1 = 1; i$1 <= 10; ++i$1){ var q2 = Queue.copy(q1); if (!Caml_obj.equal(to_list(q1), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 4, tl: { - hd: 3, + hd: 5, tl: { - hd: 4, + hd: 6, tl: { - hd: 5, + hd: 7, tl: { - hd: 6, + hd: 8, tl: { - hd: 7, + hd: 9, tl: { - hd: 8, - tl: { - hd: 9, - tl: { - hd: 10, - tl: /* [] */0 - } - } + hd: 10, + tl: /* [] */0 } } } @@ -601,7 +599,9 @@ if (!Caml_obj.equal(to_list(q1), { } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -614,28 +614,26 @@ if (!Caml_obj.equal(to_list(q1), { } if (!Caml_obj.equal(to_list(q2), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, + hd: 4, tl: { - hd: 3, + hd: 5, tl: { - hd: 4, + hd: 6, tl: { - hd: 5, + hd: 7, tl: { - hd: 6, + hd: 8, tl: { - hd: 7, + hd: 9, tl: { - hd: 8, - tl: { - hd: 9, - tl: { - hd: 10, - tl: /* [] */0 - } - } + hd: 10, + tl: /* [] */0 } } } @@ -643,7 +641,9 @@ if (!Caml_obj.equal(to_list(q2), { } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -819,19 +819,19 @@ var i$7 = { }; Queue.iter((function (j) { - if (i$7.contents !== j) { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "libqueue_test.res", - 134, - 4 - ], - Error: new Error() - }; - } - i$7.contents = i$7.contents + 1 | 0; - }), q$5); + if (i$7.contents !== j) { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "libqueue_test.res", + 134, + 4 + ], + Error: new Error() + }; + } + i$7.contents = i$7.contents + 1 | 0; +}), q$5); var q1$1 = { length: 0, @@ -972,18 +972,18 @@ if (q1$2.length !== 4) { } if (!Caml_obj.equal(to_list(q1$2), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1058,18 +1058,18 @@ if (q2$2.length !== 4) { } if (!Caml_obj.equal(to_list(q2$2), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1134,18 +1134,18 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(to_list(q2$3), { - hd: 5, + hd: 5, + tl: { + hd: 6, + tl: { + hd: 7, tl: { - hd: 6, - tl: { - hd: 7, - tl: { - hd: 8, - tl: /* [] */0 - } - } + hd: 8, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1196,18 +1196,18 @@ if (q2$3.length !== 4) { } if (!Caml_obj.equal(to_list(q2$3), { - hd: 5, + hd: 5, + tl: { + hd: 6, + tl: { + hd: 7, tl: { - hd: 6, - tl: { - hd: 7, - tl: { - hd: 8, - tl: /* [] */0 - } - } + hd: 8, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1252,18 +1252,18 @@ if (q1$4.length !== 4) { } if (!Caml_obj.equal(to_list(q1$4), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1288,18 +1288,18 @@ if (q2$4.length !== 4) { } if (!Caml_obj.equal(to_list(q2$4), { - hd: 5, + hd: 5, + tl: { + hd: 6, + tl: { + hd: 7, tl: { - hd: 6, - tl: { - hd: 7, - tl: { - hd: 8, - tl: /* [] */0 - } - } + hd: 8, + tl: /* [] */0 } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1350,30 +1350,30 @@ if (q2$4.length !== 8) { } if (!Caml_obj.equal(to_list(q2$4), { - hd: 5, + hd: 5, + tl: { + hd: 6, + tl: { + hd: 7, tl: { - hd: 6, + hd: 8, tl: { - hd: 7, + hd: 1, tl: { - hd: 8, + hd: 2, tl: { - hd: 1, + hd: 3, tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } + hd: 4, + tl: /* [] */0 } } } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ diff --git a/jscomp/test/limits_test.js b/jscomp/test/limits_test.js index d99bc28807..9c0d83e7da 100644 --- a/jscomp/test/limits_test.js +++ b/jscomp/test/limits_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/list_stack.js b/jscomp/test/list_stack.js index 84fc2df05e..4a4d6ca861 100644 --- a/jscomp/test/list_stack.js +++ b/jscomp/test/list_stack.js @@ -4,7 +4,7 @@ var List = require("../../lib/js/list.js"); List.find((function (x) { - return x > 3; - }), /* [] */0); + return x > 3; +}), /* [] */0); /* Not a pure module */ diff --git a/jscomp/test/list_test.js b/jscomp/test/list_test.js index e9746f319e..e71eb7cb88 100644 --- a/jscomp/test/list_test.js +++ b/jscomp/test/list_test.js @@ -9,159 +9,159 @@ var $$Array = require("../../lib/js/array.js"); var list_suites_0 = [ "length", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: List.length({ - hd: [ - 0, - 1, - 2, - 3, - 4 - ], - tl: /* [] */0 - }) - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: List.length({ + hd: [ + 0, + 1, + 2, + 3, + 4 + ], + tl: /* [] */0 + }) + }; + }) ]; var list_suites_1 = { hd: [ "length2", (function (param) { - return { - TAG: "Eq", - _0: 5, - _1: List.length({ - hd: 0, + return { + TAG: "Eq", + _0: 5, + _1: List.length({ + hd: 0, + tl: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } + hd: 4, + tl: /* [] */0 } - }) - }; - }) + } + } + } + }) + }; + }) ], tl: { hd: [ "long_length", (function (param) { - return { - TAG: "Eq", - _0: 30000, - _1: List.length($$Array.to_list($$Array.init(30000, (function (param) { - return 0; - })))) - }; - }) + return { + TAG: "Eq", + _0: 30000, + _1: List.length($$Array.to_list($$Array.init(30000, (function (param) { + return 0; + })))) + }; + }) ], tl: { hd: [ "sort", (function (param) { - return { - TAG: "Eq", - _0: List.sort(Caml.int_compare, { - hd: 4, - tl: { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - } - }), - _1: { + return { + TAG: "Eq", + _0: List.sort(Caml.int_compare, { + hd: 4, + tl: { hd: 1, tl: { hd: 2, tl: { hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } + tl: /* [] */0 } } } - }; - }) + }), + _1: { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } + } + }; + }) ], tl: { hd: [ "File \"list_test.res\", line 20, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: List.mem(3, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: List.mem(3, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) + }; + }) ], tl: { hd: [ "File \"list_test.res\", line 21, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: List.mem(4, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: List.mem(4, { + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }) + }; + }) ], tl: { hd: [ "File \"list_test.res\", line 22, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: 9, - _1: List.assoc(4, { - hd: [ - 1, - 2 - ], - tl: { - hd: [ - 4, - 9 - ], - tl: /* [] */0 - } - }) - }; - }) + return { + TAG: "Eq", + _0: 9, + _1: List.assoc(4, { + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 4, + 9 + ], + tl: /* [] */0 + } + }) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/loop_regression_test.js b/jscomp/test/loop_regression_test.js index f0ecf7677f..50eec06a95 100644 --- a/jscomp/test/loop_regression_test.js +++ b/jscomp/test/loop_regression_test.js @@ -24,12 +24,12 @@ function f(param) { var suites_0 = [ "sum", (function (param) { - return { - TAG: "Eq", - _0: 55, - _1: f() - }; - }) + return { + TAG: "Eq", + _0: 55, + _1: f() + }; + }) ]; var suites = { diff --git a/jscomp/test/map_find_test.js b/jscomp/test/map_find_test.js index ddf57b85aa..f439a6a56a 100644 --- a/jscomp/test/map_find_test.js +++ b/jscomp/test/map_find_test.js @@ -154,32 +154,32 @@ function find(x, _param) { } var m = List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); function height$1(param) { if (typeof param !== "object") { @@ -330,57 +330,57 @@ function find$1(x, _param) { } var s = List.fold_left((function (acc, param) { - return add$1(param[0], param[1], acc); - }), "Empty", { + return add$1(param[0], param[1], acc); +}), "Empty", { + hd: [ + "10", + /* 'a' */97 + ], + tl: { + hd: [ + "3", + /* 'b' */98 + ], + tl: { hd: [ - "10", - /* 'a' */97 + "7", + /* 'c' */99 ], tl: { hd: [ - "3", - /* 'b' */98 + "20", + /* 'd' */100 ], - tl: { - hd: [ - "7", - /* 'c' */99 - ], - tl: { - hd: [ - "20", - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); Mt.from_pair_suites("Map_find_test", { - hd: [ - "int", - (function (param) { - return { - TAG: "Eq", - _0: find(10, m), - _1: /* 'a' */97 - }; - }) - ], - tl: { - hd: [ - "string", - (function (param) { - return { - TAG: "Eq", - _0: find$1("10", s), - _1: /* 'a' */97 - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "int", + (function (param) { + return { + TAG: "Eq", + _0: find(10, m), + _1: /* 'a' */97 + }; + }) + ], + tl: { + hd: [ + "string", + (function (param) { + return { + TAG: "Eq", + _0: find$1("10", s), + _1: /* 'a' */97 + }; + }) + ], + tl: /* [] */0 + } +}); /* m Not a pure module */ diff --git a/jscomp/test/map_test.js b/jscomp/test/map_test.js index e8f2116f06..46215b77cf 100644 --- a/jscomp/test/map_test.js +++ b/jscomp/test/map_test.js @@ -371,161 +371,161 @@ function find(x, _param) { function of_list(kvs) { return List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", kvs); + return add(param[0], param[1], acc); + }), "Empty", kvs); } var int_map_suites_0 = [ "add", (function (param) { + var v = of_list({ + hd: [ + 1, + /* '1' */49 + ], + tl: { + hd: [ + 2, + /* '3' */51 + ], + tl: { + hd: [ + 3, + /* '4' */52 + ], + tl: /* [] */0 + } + } + }); + return { + TAG: "Eq", + _0: cardinal(v), + _1: 3 + }; + }) +]; + +var int_map_suites_1 = { + hd: [ + "equal", + (function (param) { var v = of_list({ + hd: [ + 1, + /* '1' */49 + ], + tl: { + hd: [ + 2, + /* '3' */51 + ], + tl: { + hd: [ + 3, + /* '4' */52 + ], + tl: /* [] */0 + } + } + }); + var u = of_list({ + hd: [ + 2, + /* '3' */51 + ], + tl: { + hd: [ + 3, + /* '4' */52 + ], + tl: { hd: [ 1, /* '1' */49 ], - tl: { - hd: [ - 2, - /* '3' */51 - ], - tl: { - hd: [ - 3, - /* '4' */52 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } + }); return { TAG: "Eq", - _0: cardinal(v), - _1: 3 + _0: compare(Caml.int_compare, u, v), + _1: 0 }; }) -]; - -var int_map_suites_1 = { - hd: [ - "equal", - (function (param) { + ], + tl: { + hd: [ + "equal2", + (function (param) { var v = of_list({ + hd: [ + 1, + /* '1' */49 + ], + tl: { + hd: [ + 2, + /* '3' */51 + ], + tl: { hd: [ - 1, - /* '1' */49 + 3, + /* '4' */52 ], - tl: { - hd: [ - 2, - /* '3' */51 - ], - tl: { - hd: [ - 3, - /* '4' */52 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } + }); var u = of_list({ + hd: [ + 2, + /* '3' */51 + ], + tl: { + hd: [ + 3, + /* '4' */52 + ], + tl: { hd: [ - 2, - /* '3' */51 + 1, + /* '1' */49 ], - tl: { - hd: [ - 3, - /* '4' */52 - ], - tl: { - hd: [ - 1, - /* '1' */49 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } + }); return { TAG: "Eq", - _0: compare(Caml.int_compare, u, v), - _1: 0 + _0: true, + _1: equal((function (x, y) { + return x === y; + }), u, v) }; }) - ], - tl: { - hd: [ - "equal2", - (function (param) { - var v = of_list({ - hd: [ - 1, - /* '1' */49 - ], - tl: { - hd: [ - 2, - /* '3' */51 - ], - tl: { - hd: [ - 3, - /* '4' */52 - ], - tl: /* [] */0 - } - } - }); - var u = of_list({ - hd: [ - 2, - /* '3' */51 - ], - tl: { - hd: [ - 3, - /* '4' */52 - ], - tl: { - hd: [ - 1, - /* '1' */49 - ], - tl: /* [] */0 - } - } - }); - return { - TAG: "Eq", - _0: true, - _1: equal((function (x, y) { - return x === y; - }), u, v) - }; - }) ], tl: { hd: [ "iteration", (function (param) { - var m = "Empty"; - for(var i = 0; i <= 10000; ++i){ - m = add$1(String(i), String(i), m); - } - var v = -1; - for(var i$1 = 0; i$1 <= 10000; ++i$1){ - if (find(String(i$1), m) !== String(i$1)) { - v = i$1; - } - + var m = "Empty"; + for(var i = 0; i <= 10000; ++i){ + m = add$1(String(i), String(i), m); + } + var v = -1; + for(var i$1 = 0; i$1 <= 10000; ++i$1){ + if (find(String(i$1), m) !== String(i$1)) { + v = i$1; } - return { - TAG: "Eq", - _0: v, - _1: -1 - }; - }) + + } + return { + TAG: "Eq", + _0: v, + _1: -1 + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/mario_game.js b/jscomp/test/mario_game.js index 621a5eb499..77d3a6bbfd 100644 --- a/jscomp/test/mario_game.js +++ b/jscomp/test/mario_game.js @@ -25,9 +25,9 @@ function setup_sprite(loopOpt, bbox_offsetOpt, bbox_sizeOpt, img_src, max_frames 0 ]; var bbox_size$1 = Caml_obj.equal(bbox_size, [ - 0, - 0 - ]) ? frame_size : bbox_size; + 0, + 0 + ]) ? frame_size : bbox_size; var img_src$1 = "./sprites/" + img_src; return { max_frames: max_frames, @@ -46,106 +46,106 @@ function make_enemy(param) { switch (param[0]) { case "Goomba" : return setup_sprite(undefined, [ - 1, - 1 - ], [ - 14, - 14 - ], "enemies.png", 2, 10, [ - 16, - 16 - ], [ - 0, - 128 - ]); + 1, + 1 + ], [ + 14, + 14 + ], "enemies.png", 2, 10, [ + 16, + 16 + ], [ + 0, + 128 + ]); case "GKoopa" : if (dir === "Left") { return setup_sprite(undefined, [ - 4, - 10 - ], [ - 11, - 16 - ], "enemies.png", 2, 10, [ - 16, - 27 - ], [ - 0, - 69 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 1, + 10 + ], [ + 11, + 16 + ], "enemies.png", 2, 10, [ + 16, + 27 + ], [ + 32, + 5 + ]); } case "GKoopaShell" : return setup_sprite(undefined, [ - 2, - 2 - ], [ - 12, - 13 - ], "enemies.png", 4, 10, [ - 16, - 16 - ], [ - 0, - 96 - ]); + 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 - ]); + 2, + 2 + ], [ + 12, + 13 + ], "enemies.png", 4, 10, [ + 16, + 16 + ], [ + 0, + 32 + ]); } } @@ -154,92 +154,92 @@ function make_particle(x) { switch (x) { case "GoombaSquish" : return setup_sprite(undefined, undefined, undefined, "enemies.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 144 - ]); + 16, + 16 + ], [ + 0, + 144 + ]); case "BrickChunkL" : return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 0, - 0 - ]); + 8, + 8 + ], [ + 0, + 0 + ]); case "BrickChunkR" : return setup_sprite(undefined, undefined, undefined, "chunks.png", 1, 0, [ - 8, - 8 - ], [ - 8, - 0 - ]); + 8, + 8 + ], [ + 8, + 0 + ]); case "Score100" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 8 - ], [ - 0, - 0 - ]); + 12, + 8 + ], [ + 0, + 0 + ]); case "Score200" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 9 - ]); + 12, + 9 + ], [ + 0, + 9 + ]); case "Score400" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 18 - ]); + 12, + 9 + ], [ + 0, + 18 + ]); case "Score800" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 12, - 9 - ], [ - 0, - 27 - ]); + 12, + 9 + ], [ + 0, + 27 + ]); case "Score1000" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 0 - ]); + 14, + 9 + ], [ + 13, + 0 + ]); case "Score2000" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 9 - ]); + 14, + 9 + ], [ + 13, + 9 + ]); case "Score4000" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 18 - ]); + 14, + 9 + ], [ + 13, + 18 + ]); case "Score8000" : return setup_sprite(undefined, undefined, undefined, "score.png", 1, 0, [ - 14, - 9 - ], [ - 13, - 27 - ]); + 14, + 9 + ], [ + 13, + 27 + ]); } } @@ -258,120 +258,120 @@ function make_type(typ, dir) { switch (typ$1) { case "Standing" : return setup_sprite(undefined, [ - 2, - 1 - ], [ - 13, - 25 - ], "mario-big.png", 1, 0, [ - 16, - 27 - ], [ - 16, - 5 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 2, + 10 + ], [ + 13, + 17 + ], "mario-big.png", 1, 0, [ + 16, + 27 + ], [ + 32, + 69 + ]); } } @@ -381,238 +381,238 @@ function make_type(typ, dir) { switch (typ$2) { case "Standing" : return setup_sprite(undefined, [ - 3, - 1 - ], [ - 11, - 15 - ], "mario-small.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 0 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 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 - ]); + 1, + 5 + ], [ + 14, + 10 + ], "mario-small.png", 1, 0, [ + 16, + 16 + ], [ + 0, + 64 + ]); } } } case "SEnemy" : return make_enemy([ - typ._0, - dir - ]); + typ._0, + dir + ]); case "SItem" : var x = typ._0; switch (x) { case "Mushroom" : return setup_sprite(undefined, [ - 2, - 0 - ], [ - 12, - 16 - ], "items.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 0 - ]); + 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 - ]); + 16, + 16 + ], [ + 0, + 188 + ]); case "Star" : return setup_sprite(undefined, undefined, undefined, "items.png", 1, 0, [ - 16, - 16 - ], [ - 16, - 48 - ]); + 16, + 16 + ], [ + 16, + 48 + ]); case "Coin" : return setup_sprite(undefined, [ - 3, - 0 - ], [ - 12, - 16 - ], "items.png", 3, 15, [ - 16, - 16 - ], [ - 0, - 80 - ]); + 3, + 0 + ], [ + 12, + 16 + ], "items.png", 3, 15, [ + 16, + 16 + ], [ + 0, + 80 + ]); } case "SBlock" : var 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, - 16 + 32 ]); - } - 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 - ]); + 16, + 16 + ], [ + 0, + 0 + ]); case "UnBBlock" : return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 48 - ]); + 16, + 16 + ], [ + 0, + 48 + ]); case "Cloud" : return setup_sprite(undefined, undefined, undefined, "blocks.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 64 - ]); + 16, + 16 + ], [ + 0, + 64 + ]); case "Panel" : return setup_sprite(undefined, undefined, undefined, "panel.png", 3, 15, [ - 26, - 26 - ], [ - 0, - 0 - ]); + 26, + 26 + ], [ + 0, + 0 + ]); case "Ground" : return setup_sprite(undefined, undefined, undefined, "ground.png", 1, 0, [ - 16, - 16 - ], [ - 0, - 32 - ]); + 16, + 16 + ], [ + 0, + 32 + ]); } @@ -642,12 +642,12 @@ function make(spawn, dir, context) { function make_bgd(context) { var params = setup_sprite(undefined, undefined, undefined, "bgd-1.png", 1, 0, [ - 512, - 256 - ], [ - 0, - 0 - ]); + 512, + 256 + ], [ + 0, + 0 + ]); return make_from_params(params, context); } @@ -658,9 +658,9 @@ function make_particle$1(ptyp, context) { function transform_enemy(enemy_typ, spr, dir) { var params = make_enemy([ - enemy_typ, - dir - ]); + enemy_typ, + dir + ]); var img = document.createElement("img"); img.src = params.img_src; spr.params = params; @@ -762,9 +762,9 @@ function make_score(score, pos, ctx) { ) ); return make$1([ - 0.5, - -0.7 - ], undefined, t, pos, ctx); + 0.5, + -0.7 + ], undefined, t, pos, ctx); } function update_vel(part) { @@ -876,9 +876,9 @@ function make$2($staropt$star, $staropt$star$1, spawnable, context, param) { function spawn(spawnable, context, param) { var match = make$2(undefined, undefined, spawnable, context, [ - param[0], - param[1] - ]); + param[0], + param[1] + ]); var obj = match[1]; var spr = match[0]; switch (spawnable.TAG) { @@ -957,47 +957,47 @@ function update_player(player, keys, context) { var prev_dir = player.dir; var prev_vx = Math.abs(player.vel.x); List.iter((function (param) { - var lr_acc = player.vel.x * 0.2; - switch (param) { - 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; - } - 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; - } - 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; - } - case "CDown" : - if (!player.jumping && player.grounded) { - player.crouch = true; - return; - } else { - return; - } - + var lr_acc = player.vel.x * 0.2; + switch (param) { + 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; } - }), keys); + 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; + } + 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; + } + case "CDown" : + if (!player.jumping && player.grounded) { + player.crouch = true; + return; + } else { + return; + } + + } + }), keys); var v = player.vel.x * 0.9; var vel_damped = Math.abs(v) < 0.1 ? 0 : v; player.vel.x = vel_damped; @@ -1006,46 +1006,46 @@ function update_player(player, keys, context) { return [ pl_typ, make({ - TAG: "SPlayer", - _0: pl_typ, - _1: "Jumping" - }, player.dir, context) + TAG: "SPlayer", + _0: pl_typ, + _1: "Jumping" + }, player.dir, context) ]; } else if (prev_dir !== player.dir || prev_vx === 0 && Math.abs(player.vel.x) > 0 && !player.jumping) { return [ pl_typ, make({ - TAG: "SPlayer", - _0: pl_typ, - _1: "Running" - }, player.dir, context) + TAG: "SPlayer", + _0: pl_typ, + _1: "Running" + }, player.dir, context) ]; } else if (prev_dir !== player.dir && player.jumping && prev_jumping) { return [ pl_typ, make({ - TAG: "SPlayer", - _0: pl_typ, - _1: "Jumping" - }, player.dir, context) + TAG: "SPlayer", + _0: pl_typ, + _1: "Jumping" + }, player.dir, context) ]; } else if (player.vel.y === 0 && player.crouch) { return [ pl_typ, make({ - TAG: "SPlayer", - _0: pl_typ, - _1: "Crouching" - }, player.dir, context) + TAG: "SPlayer", + _0: pl_typ, + _1: "Crouching" + }, player.dir, context) ]; } else if (player.vel.y === 0 && player.vel.x === 0) { return [ pl_typ, make({ - TAG: "SPlayer", - _0: pl_typ, - _1: "Standing" - }, player.dir, context) + TAG: "SPlayer", + _0: pl_typ, + _1: "Standing" + }, player.dir, context) ]; } else { return; @@ -1134,12 +1134,12 @@ function evolve_enemy(player_dir, typ, spr, obj, context) { return; case "GKoopa" : var match = make$2(undefined, obj.dir, { - TAG: "SEnemy", - _0: "GKoopaShell" - }, context, [ - obj.pos.x, - obj.pos.y - ]); + TAG: "SEnemy", + _0: "GKoopaShell" + }, context, [ + obj.pos.x, + obj.pos.y + ]); var new_obj = match[1]; var new_spr = match[0]; normalize_pos(new_obj.pos, spr.params, new_spr.params); @@ -1151,12 +1151,12 @@ function evolve_enemy(player_dir, typ, spr, obj, context) { }; case "RKoopa" : var match$1 = make$2(undefined, obj.dir, { - TAG: "SEnemy", - _0: "RKoopaShell" - }, context, [ - obj.pos.x, - obj.pos.y - ]); + TAG: "SEnemy", + _0: "RKoopaShell" + }, context, [ + obj.pos.x, + obj.pos.y + ]); var new_obj$1 = match$1[1]; var new_spr$1 = match$1[0]; normalize_pos(new_obj$1.pos, spr.params, new_spr$1.params); @@ -1202,12 +1202,12 @@ function dec_health(obj) { function evolve_block(obj, context) { dec_health(obj); var match = make$2(undefined, undefined, { - TAG: "SBlock", - _0: "QBlockUsed" - }, context, [ - obj.pos.x, - obj.pos.y - ]); + TAG: "SBlock", + _0: "QBlockUsed" + }, context, [ + obj.pos.x, + obj.pos.y + ]); return { TAG: "Block", _0: "QBlockUsed", @@ -1218,12 +1218,12 @@ function evolve_block(obj, context) { function spawn_above(player_dir, obj, typ, context) { var item = spawn({ - TAG: "SItem", - _0: typ - }, context, [ - obj.pos.x, - obj.pos.y - ]); + TAG: "SItem", + _0: typ + }, context, [ + obj.pos.x, + obj.pos.y + ]); var item_obj = item._2; item_obj.pos.y = item_obj.pos.y - item._1.params.frame_size[1]; item_obj.dir = opposite_dir(player_dir); @@ -1348,9 +1348,9 @@ function kill(collid, ctx) { if (collid._0 === "Mushroom") { return { hd: make_score(o$1.score, [ - o$1.pos.x, - o$1.pos.y - ], ctx), + o$1.pos.x, + o$1.pos.y + ], ctx), tl: /* [] */0 }; } else { @@ -1372,33 +1372,33 @@ function kill(collid, ctx) { pos_1$1 ]; var p1 = make$1([ - -5, - -5 - ], [ - 0, - 0.2 - ], "BrickChunkL", pos$1, ctx); + -5, + -5 + ], [ + 0, + 0.2 + ], "BrickChunkL", pos$1, ctx); var p2 = make$1([ - -3, - -4 - ], [ - 0, - 0.2 - ], "BrickChunkL", pos$1, ctx); + -3, + -4 + ], [ + 0, + 0.2 + ], "BrickChunkL", pos$1, ctx); var p3 = make$1([ - 3, - -4 - ], [ - 0, - 0.2 - ], "BrickChunkR", pos$1, ctx); + 3, + -4 + ], [ + 0, + 0.2 + ], "BrickChunkR", pos$1, ctx); var p4 = make$1([ - 5, - -5 - ], [ - 0, - 0.2 - ], "BrickChunkR", pos$1, ctx); + 5, + -5 + ], [ + 0, + 0.2 + ], "BrickChunkR", pos$1, ctx); return { hd: p1, tl: { @@ -1456,27 +1456,27 @@ function render(sprite, param) { var match$2 = sprite.params.frame_size; var sx = match[0] + sprite.frame.contents * sw; return Curry.app(context.drawImage, [ - sprite.img, - sx, - match[1], - sw, - match$1[1], - param[0], - param[1], - match$2[0], - match$2[1] - ]); + sprite.img, + sx, + match[1], + sw, + match$1[1], + param[0], + param[1], + match$2[0], + match$2[1] + ]); } function draw_bgd(bgd, off_x) { render(bgd, [ - - off_x, - 0 - ]); + - off_x, + 0 + ]); return render(bgd, [ - bgd.params.frame_size[0] - off_x, - 0 - ]); + bgd.params.frame_size[0] - off_x, + 0 + ]); } function clear_canvas(canvas) { @@ -2119,12 +2119,12 @@ function process_collision(dir, c1, c2, state) { function broad_phase(collid, all_collids, state) { var obj = collid._2; return List.filter(function (c) { - if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { - return true; - } else { - return out_of_viewport_below(state.vpt, obj.pos.y); - } - })(all_collids); + if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { + return true; + } else { + return out_of_viewport_below(state.vpt, obj.pos.y); + } + })(all_collids); } function check_collisions(collid, all_collids, state) { @@ -2195,14 +2195,14 @@ function update_collidable(state, collid, all_collids) { var evolved = check_collisions(collid, all_collids, state); var vpt_adj_xy = coord_to_viewport(state.vpt, obj.pos); render(spr, [ - vpt_adj_xy.x, - vpt_adj_xy.y - ]); + vpt_adj_xy.x, + vpt_adj_xy.y + ]); if (pressed_keys.bbox === 1) { render_bbox(spr, [ - vpt_adj_xy.x, - vpt_adj_xy.y - ]); + vpt_adj_xy.x, + vpt_adj_xy.y + ]); } if (obj.vel.x !== 0 || !is_enemy(collid)) { update_animation(spr); @@ -2239,15 +2239,15 @@ function translate_keys(param) { tl: ctrls_1 }; return List.fold_left((function (a, x) { - if (x[0]) { - return { - hd: x[1], - tl: a - }; - } else { - return a; - } - }), /* [] */0, ctrls); + if (x[0]) { + return { + hd: x[1], + tl: a + }; + } else { + return a; + } + }), /* [] */0, ctrls); } function run_update_collid(state, collid, all_collids) { @@ -2292,9 +2292,9 @@ function update_loop(canvas, param, map_dim) { var cwidth = canvas.width / 1; var cheight = canvas.height / 1; var viewport = make$3([ - cwidth, - cheight - ], map_dim); + cwidth, + cheight + ], map_dim); var state = { bgd: make_bgd(ctx), ctx: ctx, @@ -2333,30 +2333,30 @@ function update_loop(canvas, param, map_dim) { game_over: state.game_over }; List.iter((function (obj) { - run_update_collid(state$1, obj, objs); - }), objs); + run_update_collid(state$1, obj, objs); + }), objs); List.iter((function (part) { - $$process(part); - var x = part.pos.x - state$1.vpt.pos.x; - var y = part.pos.y - state$1.vpt.pos.y; - render(part.params.sprite, [ - x, - y - ]); - if (!part.kill) { - particles.contents = { - hd: part, - tl: particles.contents - }; - return; - } - - }), parts); + $$process(part); + var x = part.pos.x - state$1.vpt.pos.x; + var y = part.pos.y - state$1.vpt.pos.y; + render(part.params.sprite, [ + x, + y + ]); + if (!part.kill) { + particles.contents = { + hd: part, + tl: particles.contents + }; + return; + } + + }), parts); fps(canvas, fps$1); hud(canvas, state$1.score, state$1.coins); requestAnimationFrame(function (t) { - update_helper(t, state$1, player$1, collid_objs.contents, particles.contents); - }); + update_helper(t, state$1, player$1, collid_objs.contents, particles.contents); + }); }; update_helper(0, state, player, param[1], /* [] */0); } @@ -2483,15 +2483,15 @@ function convert_list(lst) { } var h = lst.hd; return Pervasives.$at({ - hd: [ - h[0], - [ - h[1][0] * 16, - h[1][1] * 16 - ] - ], - tl: /* [] */0 - }, convert_list(lst.tl)); + hd: [ + h[0], + [ + h[1][0] * 16, + h[1][1] * 16 + ] + ], + tl: /* [] */0 + }, convert_list(lst.tl)); } function choose_enemy_typ(typ) { @@ -2545,9 +2545,9 @@ function avoid_overlap(_lst, currentLst) { var h = lst.hd; if (!mem_loc(h[1], currentLst)) { return Pervasives.$at({ - hd: h, - tl: /* [] */0 - }, avoid_overlap(t, currentLst)); + hd: h, + tl: /* [] */0 + }, avoid_overlap(t, currentLst)); } _lst = t; continue ; @@ -2568,9 +2568,9 @@ function trim_edges(_lst, blockw, blockh) { var pixy = blockh * 16; if (!(cx < 128 || pixx - cx < 528 || cy === 0 || pixy - cy < 48)) { return Pervasives.$at({ - hd: h, - tl: /* [] */0 - }, trim_edges(t, blockw, blockh)); + hd: h, + tl: /* [] */0 + }, trim_edges(t, blockw, blockh)); } _lst = t; continue ; @@ -2582,15 +2582,15 @@ function generate_clouds(cbx, cby, typ, num) { return /* [] */0; } else { return Pervasives.$at({ - hd: [ - typ, - [ - cbx, - cby - ] - ], - tl: /* [] */0 - }, generate_clouds(cbx + 1, cby, typ, num - 1 | 0)); + hd: [ + typ, + [ + cbx, + cby + ] + ], + tl: /* [] */0 + }, generate_clouds(cbx + 1, cby, typ, num - 1 | 0)); } } @@ -2607,15 +2607,15 @@ function generate_coins(_block_coord) { var xc = h[1][0]; var yc = h[1][1]; return Pervasives.$at({ - hd: [ - 0, - [ - xc, - yc - 16 - ] - ], - tl: /* [] */0 - }, generate_coins(t)); + hd: [ + 0, + [ + xc, + yc - 16 + ] + ], + tl: /* [] */0 + }, generate_coins(t)); } _block_coord = t; continue ; @@ -3063,9 +3063,9 @@ function generate_enemies(blockw, blockh, _cbx, _cby, acc) { continue ; } if (mem_loc([ - cbx, - cby - ], acc) || cby === 0) { + cbx, + cby + ], acc) || cby === 0) { _cby = cby + 1; continue ; } @@ -3103,15 +3103,15 @@ function generate_block_enemies(_block_coord) { var xc = h[1][0]; var yc = h[1][1]; return Pervasives.$at({ - hd: [ - enemy_typ, - [ - xc, - yc - 16 - ] - ], - tl: /* [] */0 - }, generate_block_enemies(t)); + hd: [ + enemy_typ, + [ + xc, + yc - 16 + ] + ], + tl: /* [] */0 + }, generate_block_enemies(t)); } _block_coord = t; continue ; @@ -3132,9 +3132,9 @@ function generate_block_locs(blockw, blockh, _cbx, _cby, _acc) { continue ; } if (mem_loc([ - cbx, - cby - ], acc) || cby === 0) { + cbx, + cby + ], acc) || cby === 0) { _cby = cby + 1; continue ; } @@ -3154,12 +3154,12 @@ function generate_block_locs(blockw, blockh, _cbx, _cby, _acc) { function generate_panel(context, blockw, blockh) { return spawn({ - TAG: "SBlock", - _0: "Panel" - }, context, [ - blockw * 16 - 256, - blockh * 16 * 2 / 3 - ]); + TAG: "SBlock", + _0: "Panel" + }, context, [ + blockw * 16 - 256, + blockh * 16 * 2 / 3 + ]); } function generate_ground(blockw, blockh, _inc, _acc) { @@ -3172,15 +3172,15 @@ function generate_ground(blockw, blockh, _inc, _acc) { if (inc > 10) { var skip = Random.$$int(10); var newacc = Pervasives.$at(acc, { - hd: [ - 4, - [ - inc * 16, - blockh * 16 - ] - ], - tl: /* [] */0 - }); + hd: [ + 4, + [ + inc * 16, + blockh * 16 + ] + ], + tl: /* [] */0 + }); if (skip === 7 && blockw - inc > 32) { _inc = inc + 1; continue ; @@ -3190,15 +3190,15 @@ function generate_ground(blockw, blockh, _inc, _acc) { continue ; } var newacc$1 = Pervasives.$at(acc, { - hd: [ - 4, - [ - inc * 16, - blockh * 16 - ] - ], - tl: /* [] */0 - }); + hd: [ + 4, + [ + inc * 16, + blockh * 16 + ] + ], + tl: /* [] */0 + }); _acc = newacc$1; _inc = inc + 1; continue ; @@ -3212,13 +3212,13 @@ function convert_to_block_obj(lst, context) { var h = lst.hd; var sblock_typ = choose_sblock_typ(h[0]); var ob = spawn({ - TAG: "SBlock", - _0: sblock_typ - }, context, h[1]); + TAG: "SBlock", + _0: sblock_typ + }, context, h[1]); return Pervasives.$at({ - hd: ob, - tl: /* [] */0 - }, convert_to_block_obj(lst.tl, context)); + hd: ob, + tl: /* [] */0 + }, convert_to_block_obj(lst.tl, context)); } function convert_to_enemy_obj(lst, context) { @@ -3228,13 +3228,13 @@ function convert_to_enemy_obj(lst, context) { var h = lst.hd; var senemy_typ = choose_enemy_typ(h[0]); var ob = spawn({ - TAG: "SEnemy", - _0: senemy_typ - }, context, h[1]); + TAG: "SEnemy", + _0: senemy_typ + }, context, h[1]); return Pervasives.$at({ - hd: ob, - tl: /* [] */0 - }, convert_to_enemy_obj(lst.tl, context)); + hd: ob, + tl: /* [] */0 + }, convert_to_enemy_obj(lst.tl, context)); } function convert_to_coin_obj(lst, context) { @@ -3242,13 +3242,13 @@ function convert_to_coin_obj(lst, context) { return /* [] */0; } var ob = spawn({ - TAG: "SItem", - _0: "Coin" - }, context, lst.hd[1]); + TAG: "SItem", + _0: "Coin" + }, context, lst.hd[1]); return Pervasives.$at({ - hd: ob, - tl: /* [] */0 - }, convert_to_coin_obj(lst.tl, context)); + hd: ob, + tl: /* [] */0 + }, convert_to_coin_obj(lst.tl, context)); } function generate_helper(blockw, blockh, cx, cy, context) { @@ -3270,9 +3270,9 @@ function generate_helper(blockw, blockh, cx, cy, context) { var coin_objects = convert_to_coin_obj(undup_coin_locs, context); var obj_panel = generate_panel(context, blockw, blockh); return Pervasives.$at(all_blocks, Pervasives.$at(obj_converted_enemies, Pervasives.$at(coin_objects, Pervasives.$at(obj_enemy_blocks, { - hd: obj_panel, - tl: /* [] */0 - })))); + hd: obj_panel, + tl: /* [] */0 + })))); } function generate(w, h, context) { @@ -3280,13 +3280,13 @@ function generate(w, h, context) { var blockh = h / 16 - 1; var collide_list = generate_helper(blockw, blockh, 0, 0, context); var player = spawn({ - TAG: "SPlayer", - _0: "SmallM", - _1: "Standing" - }, context, [ - 100, - 224 - ]); + TAG: "SPlayer", + _0: "SmallM", + _1: "Standing" + }, context, [ + 100, + 224 + ]); return [ player, collide_list @@ -3326,9 +3326,9 @@ function load(param) { document.addEventListener("keyup", keyup, true); Random.self_init(); update_loop(canvas, generate(2400, 256, context), [ - 2400, - 256 - ]); + 2400, + 256 + ]); console.log("asd"); } @@ -3342,32 +3342,32 @@ function inc_counter(param) { function preload(param) { return List.map((function (img_src) { - var img_src$1 = "sprites/" + img_src; - var img = document.createElement("img"); - img.src = img_src$1; - img.addEventListener("load", (function (ev) { - inc_counter(); - return true; - }), true); - }), { - hd: "blocks.png", + var img_src$1 = "sprites/" + img_src; + var img = document.createElement("img"); + img.src = img_src$1; + img.addEventListener("load", (function (ev) { + inc_counter(); + return true; + }), true); + }), { + hd: "blocks.png", + tl: { + hd: "items.png", + tl: { + hd: "enemies.png", tl: { - hd: "items.png", - tl: { - hd: "enemies.png", - tl: { - hd: "mario-small.png", - tl: /* [] */0 - } - } + hd: "mario-small.png", + tl: /* [] */0 } - }); + } + } + }); } window.onload = (function (param) { - preload(); - return true; - }); + preload(); + return true; +}); var Main = { Html: undefined, diff --git a/jscomp/test/method_name_test.js b/jscomp/test/method_name_test.js index 41c88d95de..3a365a54d4 100644 --- a/jscomp/test/method_name_test.js +++ b/jscomp/test/method_name_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/method_string_name.js b/jscomp/test/method_string_name.js index 2d883251bc..2f9a024f57 100644 --- a/jscomp/test/method_string_name.js +++ b/jscomp/test/method_string_name.js @@ -11,8 +11,8 @@ console.log(f["Content-Type"]); function ff(x) { x["Content-Type"] = "hello"; console.log(({ - "Content-Type": "hello" - })["Content-Type"]); + "Content-Type": "hello" + })["Content-Type"]); } exports.f = f; diff --git a/jscomp/test/mock_mt.js b/jscomp/test/mock_mt.js index 9deec3bf35..39e1bd2b0a 100644 --- a/jscomp/test/mock_mt.js +++ b/jscomp/test/mock_mt.js @@ -6,82 +6,82 @@ var Curry = require("../../lib/js/curry.js"); function from_pair_suites(name, suites) { console.log([ - name, - "testing" - ]); + name, + "testing" + ]); List.iter((function (param) { - var name = param[0]; - var fn = Curry._1(param[1], undefined); - switch (fn.TAG) { - case "Eq" : - console.log([ - name, - fn._0, - "eq?", - fn._1 - ]); - return; - case "Neq" : - console.log([ - name, - fn._0, - "neq?", - fn._1 - ]); - return; - case "StrictEq" : - console.log([ - name, - fn._0, - "strict_eq?", - fn._1 - ]); - return; - case "StrictNeq" : - console.log([ - name, - fn._0, - "strict_neq?", - fn._1 - ]); - return; - case "Ok" : - console.log([ - name, - fn._0, - "ok?" - ]); - return; - case "Approx" : - console.log([ - name, - fn._0, - "~", - fn._1 - ]); - return; - case "ApproxThreshold" : - console.log([ - name, - fn._1, - "~", - fn._2, - " (", - fn._0, - ")" - ]); - return; - case "ThrowAny" : - return; - case "Fail" : - console.log("failed"); - return; - case "FailWith" : - console.log("failed: " + fn._0); - return; - - } - }), suites); + var name = param[0]; + var fn = Curry._1(param[1], undefined); + switch (fn.TAG) { + case "Eq" : + console.log([ + name, + fn._0, + "eq?", + fn._1 + ]); + return; + case "Neq" : + console.log([ + name, + fn._0, + "neq?", + fn._1 + ]); + return; + case "StrictEq" : + console.log([ + name, + fn._0, + "strict_eq?", + fn._1 + ]); + return; + case "StrictNeq" : + console.log([ + name, + fn._0, + "strict_neq?", + fn._1 + ]); + return; + case "Ok" : + console.log([ + name, + fn._0, + "ok?" + ]); + return; + case "Approx" : + console.log([ + name, + fn._0, + "~", + fn._1 + ]); + return; + case "ApproxThreshold" : + console.log([ + name, + fn._1, + "~", + fn._2, + " (", + fn._0, + ")" + ]); + return; + case "ThrowAny" : + return; + case "Fail" : + console.log("failed"); + return; + case "FailWith" : + console.log("failed: " + fn._0); + return; + + } + }), suites); } exports.from_pair_suites = from_pair_suites; diff --git a/jscomp/test/module_alias_test.js b/jscomp/test/module_alias_test.js index 0c89bc9753..c1f9755f35 100644 --- a/jscomp/test/module_alias_test.js +++ b/jscomp/test/module_alias_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -39,15 +39,15 @@ function f(x) { var h = f(/* [] */0); var a = Curry._1(h.length, { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}); eq("File \"module_alias_test.res\", line 30, characters 3-10", a, 3); diff --git a/jscomp/test/module_as_function.js b/jscomp/test/module_as_function.js index 2ec1288620..622cb03997 100644 --- a/jscomp/test/module_as_function.js +++ b/jscomp/test/module_as_function.js @@ -4,8 +4,8 @@ var Nightmare = require("nightmare"); var v = Nightmare({ - show: true - }); + show: true +}); exports.v = v; /* v Not a pure module */ diff --git a/jscomp/test/module_parameter_test.js b/jscomp/test/module_parameter_test.js index a1443e9685..313ee6ec8a 100644 --- a/jscomp/test/module_parameter_test.js +++ b/jscomp/test/module_parameter_test.js @@ -23,24 +23,24 @@ function v(x) { var suites_0 = [ "const", (function (param) { - return { - TAG: "Eq", - _0: 1, - _1: v0 - }; - }) + return { + TAG: "Eq", + _0: 1, + _1: v0 + }; + }) ]; var suites_1 = { hd: [ "other", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: "abc".length - }; - }) + return { + TAG: "Eq", + _0: 3, + _1: "abc".length + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/module_splice_test.js b/jscomp/test/module_splice_test.js index 3f97fe88f5..29087fe127 100644 --- a/jscomp/test/module_splice_test.js +++ b/jscomp/test/module_splice_test.js @@ -21,12 +21,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/mpr_6033_test.js b/jscomp/test/mpr_6033_test.js index b5859531ac..d302548aef 100644 --- a/jscomp/test/mpr_6033_test.js +++ b/jscomp/test/mpr_6033_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -34,8 +34,8 @@ function f(x) { } var x = CamlinternalLazy.from_fun(function () { - return "def"; - }); + return "def"; +}); CamlinternalLazy.force(x); diff --git a/jscomp/test/mt.js b/jscomp/test/mt.js index a15a71fda0..0fef5a3df4 100644 --- a/jscomp/test/mt.js +++ b/jscomp/test/mt.js @@ -98,9 +98,9 @@ function handleCode(spec) { function force_curry(x) { List.hd({ - hd: 3, - tl: /* [] */0 - }); + hd: 3, + tl: /* [] */0 + }); $$Array.copy([5]); return Curry._1(x, undefined); } @@ -232,17 +232,17 @@ function old_from_promise_suites_donotuse(name, suites) { if (match) { if (is_mocha()) { describe(name, (function () { - List.iter((function (param) { - var code = param[1]; - it(param[0], (function (param) { - var arg1 = function (x) { - handleCode(x); - return val_unit; - }; - return code.then(arg1); - })); - }), suites); - })); + List.iter((function (param) { + var code = param[1]; + it(param[0], (function (param) { + var arg1 = function (x) { + handleCode(x); + return val_unit; + }; + return code.then(arg1); + })); + }), suites); + })); } else { console.log("promise suites"); } @@ -257,12 +257,12 @@ function eq_suites(test_id, suites, loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -274,11 +274,11 @@ function bool_suites(test_id, suites, loc, x) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Ok", - _0: x - }; - }) + return { + TAG: "Ok", + _0: x + }; + }) ], tl: suites.contents }; @@ -290,11 +290,11 @@ function throw_suites(test_id, suites, loc, x) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "ThrowAny", - _0: x - }; - }) + return { + TAG: "ThrowAny", + _0: x + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/mt_global.js b/jscomp/test/mt_global.js index 75666e18db..7c2e5f1a68 100644 --- a/jscomp/test/mt_global.js +++ b/jscomp/test/mt_global.js @@ -8,12 +8,12 @@ function collect_eq(test_id, suites, loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -25,12 +25,12 @@ function collect_neq(test_id, suites, loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Neq", - _0: x, - _1: y - }; - }) + return { + TAG: "Neq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -42,12 +42,12 @@ function collect_approx(test_id, suites, loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Approx", - _0: x, - _1: y - }; - }) + return { + TAG: "Approx", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/mutable_obj_test.js b/jscomp/test/mutable_obj_test.js index 724b5f47d0..d8a8805455 100644 --- a/jscomp/test/mutable_obj_test.js +++ b/jscomp/test/mutable_obj_test.js @@ -4,11 +4,11 @@ function f(x) { x.dec = (function (x) { - return { - x: x, - y: x - }; - }); + return { + x: x, + y: x + }; + }); } exports.f = f; diff --git a/jscomp/test/mutable_uncurry_test.js b/jscomp/test/mutable_uncurry_test.js index f2026f4dea..92d1834244 100644 --- a/jscomp/test/mutable_uncurry_test.js +++ b/jscomp/test/mutable_uncurry_test.js @@ -29,16 +29,16 @@ function eq2(x, param) { } eqs("File \"mutable_uncurry_test.res\", line 15, characters 4-11", false, eq({ - contents: 1 - }, { - contents: 2 - })); + contents: 1 +}, { + contents: 2 +})); eqs("File \"mutable_uncurry_test.res\", line 16, characters 4-11", true, eq({ - contents: 2 - }, { - contents: 2 - })); + contents: 2 +}, { + contents: 2 +})); function ut3(param, param$1, param$2) { var x0 = param.contents; @@ -70,17 +70,17 @@ function ut4(param, param$1, param$2, param$3) { var x0 = param.contents; var x1 = param$1.contents; return Curry._2((function (param) { - var x2 = param.contents; - return function (param) { - var x3 = param.contents; - return [ - x0, - x1, - x2, - x3 - ]; - }; - }), param$2, param$3); + var x2 = param.contents; + return function (param) { + var x3 = param.contents; + return [ + x0, + x1, + x2, + x3 + ]; + }; + }), param$2, param$3); } function t4(param) { @@ -106,21 +106,21 @@ function ut5(param, param$1, param$2, param$3, param$4) { var x0 = param.contents; var x1 = param$1.contents; return Curry._3((function (param) { - var x2 = param.contents; - return function (param) { - var x3 = param.contents; - return function (param) { - var x4 = param.contents; - return [ - x0, - x1, - x2, - x3, - x4 - ]; - }; - }; - }), param$2, param$3, param$4); + var x2 = param.contents; + return function (param) { + var x3 = param.contents; + return function (param) { + var x4 = param.contents; + return [ + x0, + x1, + x2, + x3, + x4 + ]; + }; + }; + }), param$2, param$3, param$4); } function t5(param) { @@ -181,46 +181,46 @@ function nested1(param) { } eqs("File \"mutable_uncurry_test.res\", line 51, characters 4-11", ut3({ - contents: 1 - }, { - contents: 2 - }, { - contents: 3 - }), [ - 1, - 2, - 3 - ]); + contents: 1 +}, { + contents: 2 +}, { + contents: 3 +}), [ + 1, + 2, + 3 +]); eqs("File \"mutable_uncurry_test.res\", line 52, characters 4-11", Curry._1(t3({ - contents: 1 - })({ - contents: 2 - }), { - contents: 3 - }), [ - 1, - 2, - 3 - ]); + contents: 1 +})({ + contents: 2 +}), { + contents: 3 +}), [ + 1, + 2, + 3 +]); eqs("File \"mutable_uncurry_test.res\", line 54, characters 4-11", ut5({ - contents: 1 - }, { - contents: 2 - }, { - contents: 3 - }, { - contents: 1 - }, { - contents: 1 - }), [ - 1, - 2, - 3, - 1, - 1 - ]); + contents: 1 +}, { + contents: 2 +}, { + contents: 3 +}, { + contents: 1 +}, { + contents: 1 +}), [ + 1, + 2, + 3, + 1, + 1 +]); Mt.from_pair_suites("mutable_uncurry_test.res", suites.contents); diff --git a/jscomp/test/name_mangle_test.js b/jscomp/test/name_mangle_test.js index fd7928e34e..4ff9eda7d9 100644 --- a/jscomp/test/name_mangle_test.js +++ b/jscomp/test/name_mangle_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/obj_literal_ppx.js b/jscomp/test/obj_literal_ppx.js index 0670cfd92d..ae45748c70 100644 --- a/jscomp/test/obj_literal_ppx.js +++ b/jscomp/test/obj_literal_ppx.js @@ -12,8 +12,8 @@ var b = { y: [1], z: 3, u: (function (x, y) { - return x + y | 0; - }) + return x + y | 0; + }) }; function f(obj) { diff --git a/jscomp/test/obj_magic_test.js b/jscomp/test/obj_magic_test.js index d1128b24e9..a9715f75f5 100644 --- a/jscomp/test/obj_magic_test.js +++ b/jscomp/test/obj_magic_test.js @@ -10,49 +10,49 @@ function is_block(x) { var suites_0 = [ "is_block_test1", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: "number" !== "number" - }; - }) + return { + TAG: "Eq", + _0: false, + _1: "number" !== "number" + }; + }) ]; var suites_1 = { hd: [ "is_block_test2", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: typeof ({ - hd: 3, - tl: /* [] */0 - }) !== "number" - }; - }) + return { + TAG: "Eq", + _0: true, + _1: typeof ({ + hd: 3, + tl: /* [] */0 + }) !== "number" + }; + }) ], tl: { hd: [ "is_block_test3", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: "string" !== "number" - }; - }) + return { + TAG: "Eq", + _0: true, + _1: "string" !== "number" + }; + }) ], tl: { hd: [ "is_block_test4", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: "number" !== "number" - }; - }) + return { + TAG: "Eq", + _0: false, + _1: "number" !== "number" + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/ocaml_re_test.js b/jscomp/test/ocaml_re_test.js index 37d8cfc1e8..81e3749f4b 100644 --- a/jscomp/test/ocaml_re_test.js +++ b/jscomp/test/ocaml_re_test.js @@ -33,12 +33,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -685,14 +685,14 @@ function mk_expr(ids, def) { function cst(ids, s) { if (s ? false : true) { return mk_expr(ids, { - TAG: "Alt", - _0: /* [] */0 - }); + TAG: "Alt", + _0: /* [] */0 + }); } else { return mk_expr(ids, { - TAG: "Cst", - _0: s - }); + TAG: "Cst", + _0: s + }); } } @@ -700,17 +700,17 @@ function alt(ids, x) { if (x) { if (x.tl) { return mk_expr(ids, { - TAG: "Alt", - _0: x - }); + TAG: "Alt", + _0: x + }); } else { return x.hd; } } else { return mk_expr(ids, { - TAG: "Alt", - _0: /* [] */0 - }); + TAG: "Alt", + _0: /* [] */0 + }); } } @@ -741,11 +741,11 @@ function seq$1(ids, kind, x, y) { } return mk_expr(ids, { - TAG: "Seq", - _0: kind, - _1: x, - _2: y - }); + TAG: "Seq", + _0: kind, + _1: x, + _2: y + }); } function is_eps(expr) { @@ -759,19 +759,19 @@ function is_eps(expr) { function rep(ids, kind, sem, x) { return mk_expr(ids, { - TAG: "Rep", - _0: kind, - _1: sem, - _2: x - }); + TAG: "Rep", + _0: kind, + _1: sem, + _2: x + }); } function erase(ids, m, m$p) { return mk_expr(ids, { - TAG: "Erase", - _0: m, - _1: m$p - }); + TAG: "Erase", + _0: m, + _1: m$p + }); } function rename(ids, x) { @@ -782,25 +782,25 @@ function rename(ids, x) { switch (l.TAG) { case "Alt" : return mk_expr(ids, { - TAG: "Alt", - _0: List.map((function (param) { - return rename(ids, param); - }), l._0) - }); + TAG: "Alt", + _0: List.map((function (param) { + return rename(ids, param); + }), l._0) + }); case "Seq" : return mk_expr(ids, { - TAG: "Seq", - _0: l._0, - _1: rename(ids, l._1), - _2: rename(ids, l._2) - }); + 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) - }); + TAG: "Rep", + _0: l._0, + _1: l._1, + _2: rename(ids, l._2) + }); default: return mk_expr(ids, x.def); } @@ -969,13 +969,13 @@ function mk(idx, cat, desc) { function create$2(cat, e) { return mk(0, cat, { - hd: { - TAG: "TExp", - _0: empty, - _1: e - }, - tl: /* [] */0 - }); + hd: { + TAG: "TExp", + _0: empty, + _1: e + }, + tl: /* [] */0 + }); } function equal$1(x, y) { @@ -991,9 +991,9 @@ function hash$3(t) { } var Table = Hashtbl.Make({ - equal: equal$1, - hash: hash$3 - }); + equal: equal$1, + hash: hash$3 +}); function reset_table(a) { $$Array.fill(a, 0, a.length, false); @@ -1002,22 +1002,22 @@ function reset_table(a) { function mark_used_indices(tbl) { return function (param) { return List.iter((function (x) { - switch (x.TAG) { - case "TSeq" : - return mark_used_indices(tbl)(x._0); - case "TExp" : - case "TMatch" : - break; - - } - List.iter((function (param) { - var i = param[1]; - if (i >= 0) { - return Caml_array.set(tbl, i, true); - } - - }), x._0.marks); - }), param); + switch (x.TAG) { + case "TSeq" : + return mark_used_indices(tbl)(x._0); + case "TExp" : + case "TMatch" : + break; + + } + List.iter((function (param) { + var i = param[1]; + if (i >= 0) { + return Caml_array.set(tbl, i, true); + } + + }), x._0.marks); + }), param); }; } @@ -1045,15 +1045,15 @@ function free_index(tbl_ref, l) { } var remove_matches = List.filter(function (x) { - switch (x.TAG) { - case "TSeq" : - case "TExp" : - return true; - case "TMatch" : - return false; - - } - }); + switch (x.TAG) { + case "TSeq" : + case "TExp" : + return true; + case "TMatch" : + return false; + + } +}); function split_at_match_rec(_l$p, _x) { while(true) { @@ -1120,9 +1120,9 @@ function remove_duplicates(prev, _l, y) { continue ; } var match$2 = remove_duplicates({ - hd: y.id, - tl: prev - }, r, y); + hd: y.id, + tl: prev + }, r, y); return [ { hd: x, @@ -1137,9 +1137,9 @@ function remove_duplicates(prev, _l, y) { continue ; } var match$3 = remove_duplicates({ - hd: x$2.id, - tl: prev - }, r$1, y); + hd: x$2.id, + tl: prev + }, r$1, y); return [ { hd: x, @@ -1200,13 +1200,13 @@ function set_idx(idx, x) { function filter_marks(b, e, marks) { return { marks: List.filter(function (param) { - var i = param[0]; - if (i < b) { - return true; - } else { - return i > e; - } - })(marks.marks), + var i = param[0]; + if (i < b) { + return true; + } else { + return i > e; + } + })(marks.marks), pmarks: marks.pmarks }; } @@ -1245,15 +1245,15 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { var kind = s._1; var y$p$1 = delta_1(marks, c, next_cat, prev_cat, s._2, /* [] */0); var marks$p = first((function (x) { - switch (x.TAG) { - case "TSeq" : - case "TExp" : - return; - case "TMatch" : - return x._0; - - } - }), y$p$1); + switch (x.TAG) { + case "TSeq" : + case "TExp" : + return; + case "TMatch" : + return x._0; + + } + }), y$p$1); var match = marks$p !== undefined ? [ Curry._1(remove_matches, y$p$1), marks$p @@ -1272,12 +1272,12 @@ function delta_1(marks, c, next_cat, prev_cat, x, rem) { }; } else { return tseq(kind, y$p$p, x, { - hd: { - TAG: "TMatch", - _0: match[1] - }, - tl: rem - }); + hd: { + TAG: "TMatch", + _0: match[1] + }, + tl: rem + }); } case "Mark" : var i = s._0; @@ -1360,15 +1360,15 @@ function delta_2(marks, c, next_cat, prev_cat, l, rem) { function delta_seq(c, next_cat, prev_cat, kind, y, z, rem) { var marks = first((function (x) { - switch (x.TAG) { - case "TSeq" : - case "TExp" : - return; - case "TMatch" : - return x._0; - - } - }), y); + switch (x.TAG) { + case "TSeq" : + case "TExp" : + return; + case "TMatch" : + return x._0; + + } + }), y); if (marks === undefined) { return tseq(kind, y, z, rem); } @@ -1415,12 +1415,12 @@ function delta(tbl_ref, next_cat, $$char, st) { function flatten_match(m) { var ma = List.fold_left((function (ma, param) { - return Caml.int_max(ma, param[0]); - }), -1, m); + return Caml.int_max(ma, param[0]); + }), -1, m); var res = Caml_array.make(ma + 1 | 0, -1); List.iter((function (param) { - Caml_array.set(res, param[0], param[1]); - }), m); + Caml_array.set(res, param[0], param[1]); + }), m); return res; } @@ -1751,8 +1751,8 @@ function trans_set(cache, cm, s) { var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { var l = List.fold_right((function (param, l) { - return union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l); - }), s, /* [] */0); + return union(seq(Caml_bytes.get(cm, param[0]), Caml_bytes.get(cm, param[1])), l); + }), s, /* [] */0); cache.contents = add(v, l, cache.contents); return l; } @@ -1817,33 +1817,33 @@ var cupper = union(seq(/* 'A' */65, /* 'Z' */90), union(seq(/* '\192' */192, /* var clower = offset(32, cupper); var calpha = List.fold_right(cadd, { - hd: /* '\170' */170, + hd: /* '\170' */170, + tl: { + hd: /* '\181' */181, + tl: { + hd: /* '\186' */186, tl: { - hd: /* '\181' */181, + hd: /* '\223' */223, tl: { - hd: /* '\186' */186, - tl: { - hd: /* '\223' */223, - tl: { - hd: /* '\255' */255, - tl: /* [] */0 - } - } + hd: /* '\255' */255, + tl: /* [] */0 } } - }, union(clower, cupper)); + } + } +}, union(clower, cupper)); var cdigit = seq(/* '0' */48, /* '9' */57); var calnum = union(calpha, cdigit); var cword = union({ - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - }, calnum); + hd: [ + /* '_' */95, + /* '_' */95 + ], + tl: /* [] */0 +}, calnum); function colorize(c, regexp) { var lnl = { @@ -1857,12 +1857,12 @@ function colorize(c, regexp) { case "Beg_of_line" : case "End_of_line" : return split({ - hd: [ - /* '\n' */10, - /* '\n' */10 - ], - tl: /* [] */0 - }, c); + hd: [ + /* '\n' */10, + /* '\n' */10 + ], + tl: /* [] */0 + }, c); case "Beg_of_word" : case "End_of_word" : case "Not_bound" : @@ -2286,18 +2286,18 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var c$1 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); return [ mk_expr(ids, { - TAG: "After", - _0: c$1 - }), + TAG: "After", + _0: c$1 + }), kind ]; case "End_of_line" : var c$2 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.newline); return [ mk_expr(ids, { - TAG: "Before", - _0: c$2 - }), + TAG: "Before", + _0: c$2 + }), kind ]; case "Beg_of_word" : @@ -2305,12 +2305,12 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var c$4 = Curry._2(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 - })), + TAG: "After", + _0: c$3 + }), mk_expr(ids, { + TAG: "Before", + _0: c$4 + })), kind ]; case "End_of_word" : @@ -2318,76 +2318,76 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var c$6 = Curry._2(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 - })), + 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: Re_automata_Category.letter - }), mk_expr(ids, { - 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 - } - }), + 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: { + 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 ]; case "Beg_of_str" : return [ mk_expr(ids, { - TAG: "After", - _0: Re_automata_Category.inexistant - }), + TAG: "After", + _0: Re_automata_Category.inexistant + }), kind ]; case "End_of_str" : return [ mk_expr(ids, { - TAG: "Before", - _0: Re_automata_Category.inexistant - }), + TAG: "Before", + _0: Re_automata_Category.inexistant + }), kind ]; case "Last_end_of_line" : var c$7 = Curry._2(Re_automata_Category.$plus$plus, Re_automata_Category.inexistant, Re_automata_Category.lastnewline); return [ mk_expr(ids, { - TAG: "Before", - _0: c$7 - }), + TAG: "Before", + _0: c$7 + }), kind ]; case "Start" : return [ mk_expr(ids, { - TAG: "After", - _0: Re_automata_Category.search_boundary - }), + TAG: "After", + _0: Re_automata_Category.search_boundary + }), kind ]; case "Stop" : return [ mk_expr(ids, { - TAG: "Before", - _0: Re_automata_Category.search_boundary - }), + TAG: "Before", + _0: Re_automata_Category.search_boundary + }), kind ]; @@ -2415,11 +2415,11 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) } return [ alt(ids, List.map((function(ign_group,greedy){ - return function (r$p) { - var match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); - return enforce_kind(ids, kind, match[1], match[0]); - } - }(ign_group,greedy)), merged_sequences)), + return function (r$p) { + var match = translate(ids, kind, ign_group, ign_case, greedy, pos, cache, c, r$p); + return enforce_kind(ids, kind, match[1], match[0]); + } + }(ign_group,greedy)), merged_sequences)), kind ]; case "Repeat" : @@ -2433,22 +2433,22 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var f = greedy === "Non_greedy" ? (function(cr,kind$p){ return function (rem) { return alt(ids, { - hd: mk_expr(ids, "Eps"), - tl: { - hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: /* [] */0 - } - }); + hd: mk_expr(ids, "Eps"), + tl: { + hd: seq$1(ids, kind$p, rename(ids, cr), rem), + tl: /* [] */0 + } + }); } }(cr,kind$p)) : (function(cr,kind$p){ return function (rem) { return alt(ids, { - hd: seq$1(ids, kind$p, rename(ids, cr), rem), - tl: { - hd: mk_expr(ids, "Eps"), - tl: /* [] */0 - } - }); + hd: seq$1(ids, kind$p, rename(ids, cr), rem), + tl: { + hd: mk_expr(ids, "Eps"), + tl: /* [] */0 + } + }); } }(cr,kind$p)); rem = iter(j - i | 0, f, mk_expr(ids, "Eps")); @@ -2457,10 +2457,10 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) } return [ iter(i, (function(cr,kind$p){ - return function (rem) { - return seq$1(ids, kind$p, rename(ids, cr), rem); - } - }(cr,kind$p)), rem), + return function (rem) { + return seq$1(ids, kind$p, rename(ids, cr), rem); + } + }(cr,kind$p)), rem), kind ]; case "Sem" : @@ -2485,12 +2485,12 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var 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 - }))), + 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" : @@ -2518,9 +2518,9 @@ function translate(ids, kind, _ign_group, ign_case, _greedy, pos, cache, c, _x) var 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]), + TAG: "Pmark", + _0: x._0 + }), match$5[0]), match$5[1] ]; default: @@ -2608,26 +2608,26 @@ function handle_case(_ign_case, _x) { return { TAG: "Sequence", _0: List.map((function(ign_case){ - return function (param) { - return handle_case(ign_case, param); - } - }(ign_case)), x._0) + return function (param) { + return handle_case(ign_case, param); + } + }(ign_case)), x._0) }; case "Alternative" : var l$p = List.map((function(ign_case){ - return function (param) { - return handle_case(ign_case, param); - } - }(ign_case)), x._0); + return function (param) { + return handle_case(ign_case, param); + } + }(ign_case)), x._0); if (is_charset({ - TAG: "Alternative", - _0: l$p - })) { + TAG: "Alternative", + _0: l$p + })) { return { TAG: "Set", _0: List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */0, l$p) + return union(s, as_set(r)); + }), /* [] */0, l$p) }; } else { return { @@ -2699,27 +2699,27 @@ function handle_case(_ign_case, _x) { continue ; case "Intersection" : var l$p$1 = List.map((function(ign_case){ - return function (r) { - return handle_case(ign_case, r); - } - }(ign_case)), x._0); + return function (r) { + return handle_case(ign_case, r); + } + }(ign_case)), x._0); return { TAG: "Set", _0: List.fold_left((function (s, r) { - return inter(s, as_set(r)); - }), cany, l$p$1) + return inter(s, as_set(r)); + }), cany, l$p$1) }; case "Complement" : var l$p$2 = List.map((function(ign_case){ - return function (r) { - return handle_case(ign_case, r); - } - }(ign_case)), x._0); + return function (r) { + return handle_case(ign_case, r); + } + }(ign_case)), x._0); return { TAG: "Set", _0: diff(cany, List.fold_left((function (s, r) { - return union(s, as_set(r)); - }), /* [] */0, l$p$2)) + return union(s, as_set(r)); + }), /* [] */0, l$p$2)) }; case "Difference" : return { @@ -2863,97 +2863,97 @@ var any = { var notnl = { TAG: "Set", _0: diff(cany, { - hd: [ - /* '\n' */10, - /* '\n' */10 - ], - tl: /* [] */0 - }) + hd: [ + /* '\n' */10, + /* '\n' */10 + ], + tl: /* [] */0 + }) }; var lower = alt$1({ + hd: { + TAG: "Set", + _0: seq(/* 'a' */97, /* 'z' */122) + }, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '\181' */181, + /* '\181' */181 + ], + tl: /* [] */0 + } + }, + tl: { hd: { TAG: "Set", - _0: seq(/* 'a' */97, /* 'z' */122) + _0: seq(/* '\223' */223, /* '\246' */246) }, tl: { hd: { TAG: "Set", - _0: { - hd: [ - /* '\181' */181, - /* '\181' */181 - ], - tl: /* [] */0 - } + _0: seq(/* '\248' */248, /* '\255' */255) }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\223' */223, /* '\246' */246) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\248' */248, /* '\255' */255) - }, - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); var upper = alt$1({ + hd: { + TAG: "Set", + _0: seq(/* 'A' */65, /* 'Z' */90) + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* '\192' */192, /* '\214' */214) + }, + tl: { hd: { TAG: "Set", - _0: seq(/* 'A' */65, /* 'Z' */90) + _0: seq(/* '\216' */216, /* '\222' */222) }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\192' */192, /* '\214' */214) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\216' */216, /* '\222' */222) - }, - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); var alpha = alt$1({ - hd: lower, + hd: lower, + tl: { + hd: upper, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '\170' */170, + /* '\170' */170 + ], + tl: /* [] */0 + } + }, tl: { - hd: upper, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '\170' */170, - /* '\170' */170 - ], - tl: /* [] */0 - } - }, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '\186' */186, - /* '\186' */186 - ], - tl: /* [] */0 - } - }, + hd: { + TAG: "Set", + _0: { + hd: [ + /* '\186' */186, + /* '\186' */186 + ], tl: /* [] */0 } - } + }, + tl: /* [] */0 } - }); + } + } +}); var digit = { TAG: "Set", @@ -2961,29 +2961,29 @@ var digit = { }; var alnum = alt$1({ - hd: alpha, - tl: { - hd: digit, - tl: /* [] */0 - } - }); + hd: alpha, + tl: { + hd: digit, + tl: /* [] */0 + } +}); var wordc = alt$1({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], tl: /* [] */0 } - }); + }, + tl: /* [] */0 + } +}); var ascii = { TAG: "Set", @@ -2993,112 +2993,110 @@ var ascii = { var blank = set("\t "); var cntrl = alt$1({ - hd: { - TAG: "Set", - _0: seq(/* '\000' */0, /* '\031' */31) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\127' */127, /* '\159' */159) - }, - tl: /* [] */0 - } - }); + hd: { + TAG: "Set", + _0: seq(/* '\000' */0, /* '\031' */31) + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* '\127' */127, /* '\159' */159) + }, + tl: /* [] */0 + } +}); var graph = alt$1({ - hd: { - TAG: "Set", - _0: seq(/* '!' */33, /* '~' */126) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\160' */160, /* '\255' */255) - }, - tl: /* [] */0 - } - }); + hd: { + TAG: "Set", + _0: seq(/* '!' */33, /* '~' */126) + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* '\160' */160, /* '\255' */255) + }, + tl: /* [] */0 + } +}); var print = alt$1({ - hd: { - TAG: "Set", - _0: seq(/* ' ' */32, /* '~' */126) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\160' */160, /* '\255' */255) - }, - tl: /* [] */0 - } - }); + hd: { + TAG: "Set", + _0: seq(/* ' ' */32, /* '~' */126) + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* '\160' */160, /* '\255' */255) + }, + tl: /* [] */0 + } +}); var punct = alt$1({ + hd: { + TAG: "Set", + _0: seq(/* '!' */33, /* '/' */47) + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* ':' */58, /* '@' */64) + }, + tl: { hd: { TAG: "Set", - _0: seq(/* '!' */33, /* '/' */47) + _0: seq(/* '[' */91, /* '`' */96) }, tl: { hd: { TAG: "Set", - _0: seq(/* ':' */58, /* '@' */64) + _0: seq(/* '{' */123, /* '~' */126) }, tl: { hd: { TAG: "Set", - _0: seq(/* '[' */91, /* '`' */96) + _0: seq(/* '\160' */160, /* '\169' */169) }, tl: { hd: { TAG: "Set", - _0: seq(/* '{' */123, /* '~' */126) + _0: seq(/* '\171' */171, /* '\180' */180) }, tl: { hd: { TAG: "Set", - _0: seq(/* '\160' */160, /* '\169' */169) + _0: seq(/* '\182' */182, /* '\185' */185) }, tl: { hd: { TAG: "Set", - _0: seq(/* '\171' */171, /* '\180' */180) + _0: seq(/* '\187' */187, /* '\191' */191) }, tl: { hd: { TAG: "Set", - _0: seq(/* '\182' */182, /* '\185' */185) + _0: { + hd: [ + /* '\215' */215, + /* '\215' */215 + ], + tl: /* [] */0 + } }, tl: { hd: { TAG: "Set", - _0: seq(/* '\187' */187, /* '\191' */191) - }, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '\215' */215, - /* '\215' */215 - ], - tl: /* [] */0 - } - }, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '\247' */247, - /* '\247' */247 - ], - tl: /* [] */0 - } - }, + _0: { + hd: [ + /* '\247' */247, + /* '\247' */247 + ], tl: /* [] */0 } - } + }, + tl: /* [] */0 } } } @@ -3106,63 +3104,65 @@ var punct = alt$1({ } } } - }); + } + } +}); var space = alt$1({ + hd: { + TAG: "Set", + _0: { + hd: [ + /* ' ' */32, + /* ' ' */32 + ], + tl: /* [] */0 + } + }, + tl: { + hd: { + TAG: "Set", + _0: seq(/* '\t' */9, /* '\r' */13) + }, + tl: /* [] */0 + } +}); + +var xdigit = alt$1({ + hd: digit, + tl: { + hd: { + TAG: "Set", + _0: seq(/* 'a' */97, /* 'f' */102) + }, + tl: { hd: { TAG: "Set", - _0: { - hd: [ - /* ' ' */32, - /* ' ' */32 - ], - tl: /* [] */0 - } + _0: seq(/* 'A' */65, /* 'F' */70) }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* '\t' */9, /* '\r' */13) - }, - tl: /* [] */0 - } - }); - -var xdigit = alt$1({ - hd: digit, - tl: { - hd: { - TAG: "Set", - _0: seq(/* 'a' */97, /* 'f' */102) - }, - tl: { - hd: { - TAG: "Set", - _0: seq(/* 'A' */65, /* 'F' */70) - }, - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); function compile(r) { var regexp = anchored(r) ? ({ TAG: "Group", _0: r }) : seq$2({ - hd: { - TAG: "Sem", - _0: "Shortest", - _1: repn(any, 0, undefined) - }, - tl: { - hd: { - TAG: "Group", - _0: r - }, - tl: /* [] */0 - } - }); + hd: { + TAG: "Sem", + _0: "Shortest", + _1: repn(any, 0, undefined) + }, + tl: { + hd: { + TAG: "Group", + _0: r + }, + tl: /* [] */0 + } + }); var regexp$1 = handle_case(false, regexp); var c = Bytes.make(257, /* '\000' */0); var need_lnl = colorize(c, regexp$1); @@ -3178,8 +3178,8 @@ function compile(r) { contents: 0 }; var match$1 = translate(ids, "First", false, false, "Greedy", pos, { - contents: "Empty" - }, col, regexp$1); + contents: "Empty" + }, col, regexp$1); var r$1 = enforce_kind(ids, "First", match$1[1], match$1[0]); var col_repr = match[1]; var group_count = pos.contents / 2 | 0; @@ -3512,64 +3512,64 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return "Not_bound"; case 68 : return compl({ - hd: digit, - tl: /* [] */0 - }); + hd: digit, + tl: /* [] */0 + }); case 71 : return "Start"; case 83 : return compl({ - hd: space, - tl: /* [] */0 - }); + hd: space, + tl: /* [] */0 + }); case 87 : return compl({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], tl: /* [] */0 } - }); + }, + tl: /* [] */0 + } + }); case 90 : return "Last_end_of_line"; case 98 : return alt$1({ - hd: "Beg_of_word", - tl: { - hd: "End_of_word", - tl: /* [] */0 - } - }); + hd: "Beg_of_word", + tl: { + hd: "End_of_word", + tl: /* [] */0 + } + }); case 100 : return digit; case 115 : return space; case 119 : return alt$1({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], tl: /* [] */0 } - }); + }, + tl: /* [] */0 + } + }); case 67 : case 69 : case 70 : @@ -3724,34 +3724,32 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { var cls; try { cls = List.find(accept_s, { - hd: "alnum", + hd: "alnum", + tl: { + hd: "ascii", + tl: { + hd: "blank", tl: { - hd: "ascii", + hd: "cntrl", tl: { - hd: "blank", + hd: "digit", tl: { - hd: "cntrl", + hd: "lower", tl: { - hd: "digit", + hd: "print", tl: { - hd: "lower", + hd: "space", tl: { - hd: "print", + hd: "upper", tl: { - hd: "space", + hd: "word", tl: { - hd: "upper", + hd: "punct", tl: { - hd: "word", + hd: "graph", tl: { - hd: "punct", - tl: { - hd: "graph", - tl: { - hd: "xdigit", - tl: /* [] */0 - } - } + hd: "xdigit", + tl: /* [] */0 } } } @@ -3762,7 +3760,9 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } } } - }); + } + } + }); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); @@ -3782,9 +3782,9 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { } var posix_class = posix_class_of_string(cls); var re = compl$1 ? compl({ - hd: posix_class, - tl: /* [] */0 - }) : posix_class; + hd: posix_class, + tl: /* [] */0 + }) : posix_class; return { NAME: "Set", VAL: re @@ -3839,37 +3839,37 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return { NAME: "Set", VAL: compl({ - hd: digit, - tl: /* [] */0 - }) + hd: digit, + tl: /* [] */0 + }) }; case 83 : return { NAME: "Set", VAL: compl({ - hd: space, - tl: /* [] */0 - }) + hd: space, + tl: /* [] */0 + }) }; case 87 : return { NAME: "Set", VAL: compl({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], tl: /* [] */0 } - }) + }, + tl: /* [] */0 + } + }) }; case 58 : case 59 : @@ -3922,21 +3922,21 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return { NAME: "Set", VAL: alt$1({ - hd: alnum, - tl: { - hd: { - TAG: "Set", - _0: { - hd: [ - /* '_' */95, - /* '_' */95 - ], - tl: /* [] */0 - } - }, + hd: alnum, + tl: { + hd: { + TAG: "Set", + _0: { + hd: [ + /* '_' */95, + /* '_' */95 + ], tl: /* [] */0 } - }) + }, + tl: /* [] */0 + } + }) }; case 65 : case 66 : @@ -4134,12 +4134,12 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { return left; } _left = alt$1({ - hd: left, - tl: { - hd: branch$p(/* [] */0), - tl: /* [] */0 - } - }); + hd: left, + tl: { + hd: branch$p(/* [] */0), + tl: /* [] */0 + } + }); continue ; }; }; @@ -4156,24 +4156,24 @@ function parse(multiline, dollar_endonly, dotall, ungreedy, s) { function re(flagsOpt, pat) { var flags = flagsOpt !== undefined ? flagsOpt : /* [] */0; var opts = List.map((function (x) { - if (x === "CASELESS") { - return "Caseless"; - } else if (x === "ANCHORED") { - return "Anchored"; - } else { - return "Multiline"; - } - }), flags); + if (x === "CASELESS") { + return "Caseless"; + } else if (x === "ANCHORED") { + return "Anchored"; + } else { + return "Multiline"; + } + }), flags); var optsOpt = opts; var opts$1 = optsOpt !== undefined ? optsOpt : /* [] */0; var r = parse(List.memq("Multiline", opts$1), List.memq("Dollar_endonly", opts$1), List.memq("Dotall", opts$1), List.memq("Ungreedy", opts$1), pat); var r$1 = List.memq("Anchored", opts$1) ? seq$2({ - hd: "Start", - tl: { - hd: r, - tl: /* [] */0 - } - }) : r; + hd: "Start", + tl: { + hd: r, + tl: /* [] */0 + } + }) : r; if (List.memq("Caseless", opts$1)) { return { TAG: "No_case", diff --git a/jscomp/test/of_string_test.js b/jscomp/test/of_string_test.js index b8f15cc351..a3720b0cbf 100644 --- a/jscomp/test/of_string_test.js +++ b/jscomp/test/of_string_test.js @@ -7,35 +7,35 @@ var Pervasives = require("../../lib/js/pervasives.js"); var suites_0 = [ "string_of_float_1", (function (param) { - return { - TAG: "Eq", - _0: "10.", - _1: Pervasives.string_of_float(10) - }; - }) + return { + TAG: "Eq", + _0: "10.", + _1: Pervasives.string_of_float(10) + }; + }) ]; var suites_1 = { hd: [ "string_of_int", (function (param) { - return { - TAG: "Eq", - _0: "10", - _1: String(10) - }; - }) + return { + TAG: "Eq", + _0: "10", + _1: String(10) + }; + }) ], tl: { hd: [ "valid_float_lexem", (function (param) { - return { - TAG: "Eq", - _0: "10.", - _1: Pervasives.valid_float_lexem("10") - }; - }) + return { + TAG: "Eq", + _0: "10.", + _1: Pervasives.valid_float_lexem("10") + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/offset.js b/jscomp/test/offset.js index d06487eed2..78ca7f269c 100644 --- a/jscomp/test/offset.js +++ b/jscomp/test/offset.js @@ -486,24 +486,24 @@ function subset(_s1, _s2) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/jscomp/test/omit_trailing_undefined_in_external_calls.js b/jscomp/test/omit_trailing_undefined_in_external_calls.js index 12603d50f5..4966d21d62 100644 --- a/jscomp/test/omit_trailing_undefined_in_external_calls.js +++ b/jscomp/test/omit_trailing_undefined_in_external_calls.js @@ -6,8 +6,8 @@ var SomeModule = require("SomeModule"); SomeModule.formatDate(new Date()); SomeModule.formatDate(new Date(), { - someOption: true - }); + someOption: true +}); SomeModule.formatDate(new Date(), undefined, true); diff --git a/jscomp/test/option_repr_test.js b/jscomp/test/option_repr_test.js index e74487f071..a3d8418e18 100644 --- a/jscomp/test/option_repr_test.js +++ b/jscomp/test/option_repr_test.js @@ -105,24 +105,24 @@ function f12(x) { } var length_8_id = Belt_List.makeBy(8, (function (x) { - return x; - })); + return x; +})); var length_10_id = Belt_List.makeBy(10, (function (x) { - return x; - })); + return x; +})); function f13$1(param) { return Caml_obj.equal(Belt_List.take(length_10_id, 8), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } + }); } b("File \"option_repr_test.res\", line 93, characters 4-11", Caml_obj.lessthan(undefined, null)); @@ -171,8 +171,8 @@ function neqx(a, b) { function all_true(xs) { return Belt_List.every(xs, (function (x) { - return x; - })); + return x; + })); } var xs_0 = gtx(Caml_option.some(null), Caml_option.some(undefined)); @@ -183,8 +183,8 @@ var xs = { }; b("File \"option_repr_test.res\", line 125, characters 8-15", Belt_List.every(xs, (function (x) { - return x; - }))); + return x; +}))); var xs_0$1 = ltx(Caml_option.some(undefined), 3); @@ -206,8 +206,8 @@ var xs_1 = { hd: ltx(undefined, null), tl: { hd: ltx(undefined, (function (x) { - return x; - })), + return x; + })), tl: { hd: ltx(null, 3), tl: /* [] */0 @@ -228,8 +228,8 @@ var xs$1 = { }; b("File \"option_repr_test.res\", line 128, characters 4-11", Belt_List.every(xs$1, (function (x) { - return x; - }))); + return x; +}))); var xs_0$2 = eqx(undefined, undefined); @@ -253,8 +253,8 @@ var xs$2 = { }; b("File \"option_repr_test.res\", line 145, characters 4-11", Belt_List.every(xs$2, (function (x) { - return x; - }))); + return x; +}))); function v(x) { return x; diff --git a/jscomp/test/optional_ffi_test.js b/jscomp/test/optional_ffi_test.js index 9a838b397d..a376360e88 100644 --- a/jscomp/test/optional_ffi_test.js +++ b/jscomp/test/optional_ffi_test.js @@ -20,12 +20,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -42,15 +42,15 @@ var u = hey(undefined, 3); var z = hey(5, 3); eq("File \"optional_ffi_test.res\", line 21, characters 12-19", [ - [ - u, - z - ], - [ - 6, - 8 - ] - ]); + [ + u, + z + ], + [ + 6, + 8 + ] +]); var counter = { contents: 0 diff --git a/jscomp/test/pipe_send_readline.js b/jscomp/test/pipe_send_readline.js index cd94f7a2c6..0e1ec13fd6 100644 --- a/jscomp/test/pipe_send_readline.js +++ b/jscomp/test/pipe_send_readline.js @@ -4,10 +4,10 @@ function u(rl) { return rl.on("line", (function (x) { - console.log(x); - })).on("close", (function () { - console.log("finished"); - })); + console.log(x); + })).on("close", (function () { + console.log("finished"); + })); } function xx(h) { diff --git a/jscomp/test/poly_variant_test.js b/jscomp/test/poly_variant_test.js index 40c63a75a6..0e81428667 100644 --- a/jscomp/test/poly_variant_test.js +++ b/jscomp/test/poly_variant_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -61,24 +61,24 @@ var vv = [ ]; eq("File \"poly_variant_test.res\", line 64, characters 5-12", vv, [ - 3, - 0, - 4 - ]); + 3, + 0, + 4 +]); eq("File \"poly_variant_test.res\", line 65, characters 5-12", [ - hey_int(5), - hey_int(6) - ], [ - 5, - 6 - ]); + hey_int(5), + hey_int(6) +], [ + 5, + 6 +]); eq("File \"poly_variant_test.res\", line 66, characters 5-12", uu, [ - "on_open", - "on_closed", - "in" - ]); + "on_open", + "on_closed", + "in" +]); hey_string("on_closed"); @@ -95,9 +95,9 @@ function p_is_int_test(x) { eq("File \"poly_variant_test.res\", line 156, characters 5-12", 2, 2); eq("File \"poly_variant_test.res\", line 157, characters 5-12", 3, p_is_int_test({ - NAME: "b", - VAL: 2 - })); + NAME: "b", + VAL: 2 +})); Mt.from_pair_suites("Poly_variant_test", suites.contents); diff --git a/jscomp/test/polymorphic_raw_test.js b/jscomp/test/polymorphic_raw_test.js index 6635dfa397..0a05ae61e8 100644 --- a/jscomp/test/polymorphic_raw_test.js +++ b/jscomp/test/polymorphic_raw_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/polyvar_test.js b/jscomp/test/polyvar_test.js index ed1cae51fd..743919eca0 100644 --- a/jscomp/test/polyvar_test.js +++ b/jscomp/test/polyvar_test.js @@ -5,9 +5,9 @@ var ff = "B"; console.log([ - "A", - ff, - "A" - ]); + "A", + ff, + "A" +]); /* Not a pure module */ diff --git a/jscomp/test/ppx_apply_test.js b/jscomp/test/ppx_apply_test.js index fa1382d279..dd2ca6aa5b 100644 --- a/jscomp/test/ppx_apply_test.js +++ b/jscomp/test/ppx_apply_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/pr_regression_test.js b/jscomp/test/pr_regression_test.js index 68e8ad1caa..11cdf7b06b 100644 --- a/jscomp/test/pr_regression_test.js +++ b/jscomp/test/pr_regression_test.js @@ -17,12 +17,12 @@ function f(h) { } f(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); f(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); var a = v.contents; @@ -39,12 +39,12 @@ function f$1(h) { } f$1(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); f$1(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); var b = v$1.contents; @@ -57,12 +57,12 @@ function f$2(h) { } f$2(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); f$2(function (prim0, prim1) { - return prim0 + prim1 | 0; - }); + return prim0 + prim1 | 0; +}); var c = v$2.contents; @@ -79,38 +79,38 @@ function f$3(h, g) { } f$3((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 3); + return prim0 + prim1 | 0; +}), 3); f$3((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), 3); + return prim0 + prim1 | 0; +}), 3); var d = v$3.contents; Mt.from_pair_suites("Pr_regression_test", { - hd: [ - "partial", - (function (param) { - return { - TAG: "Eq", - _0: [ - 5, - 5, - 5, - 5 - ], - _1: [ - a, - b, - c, - d - ] - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "partial", + (function (param) { + return { + TAG: "Eq", + _0: [ + 5, + 5, + 5, + 5 + ], + _1: [ + a, + b, + c, + d + ] + }; + }) + ], + tl: /* [] */0 +}); exports.a = a; exports.b = b; diff --git a/jscomp/test/prepend_data_ffi.js b/jscomp/test/prepend_data_ffi.js index dafe61356b..d6dbe6c452 100644 --- a/jscomp/test/prepend_data_ffi.js +++ b/jscomp/test/prepend_data_ffi.js @@ -13,47 +13,47 @@ var v2 = { }; process.on("exit", (function (exit_code) { - return String(exit_code); - })); + return String(exit_code); +})); process.on(1, (function (param) { - - })); + +})); process.on((function (i) { - return String(i); - }), "exit"); + return String(i); +}), "exit"); process.on((function (i) { - return String(i); - }), 1); + return String(i); +}), 1); xx(3, 3, "xxx", "a", "b"); function f(x) { x.xx(72, [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 + ]); x.xx(73, 3, "xxx", [ - 1, - 2, - 3 - ]); + 1, + 2, + 3 + ]); x.xx(74, 3, "xxx", 1, 2, 3); x.xx(75, 3, "xxx", 0, "b", 1, 2, 3, 4, 5); x.xx(76, 3, true, false, "你好", ["你好",1,2,3] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , [{ "arr" : ["你好",1,2,3], "encoding" : "utf8"}] , "xxx", 0, "yyy", "b", 1, 2, 3, 4, 5); } process.on("exit", (function (exit_code) { - console.log("error code: " + String(exit_code)); - })); + console.log("error code: " + String(exit_code)); +})); function register(p) { p.on("exit", (function (i) { - console.log(i); - })); + console.log(i); + })); } var config = { diff --git a/jscomp/test/print_alpha_test.js b/jscomp/test/print_alpha_test.js index de0ca2755f..deb33dd711 100644 --- a/jscomp/test/print_alpha_test.js +++ b/jscomp/test/print_alpha_test.js @@ -10,20 +10,20 @@ function f(h, param) { } Mt.from_pair_suites("Print_alpha_test", { - hd: [ - "File \"print_alpha_test.res\", line 16, characters 10-17", - (function (param) { - return { - TAG: "Eq", - _0: f((function (prim0, prim1) { - return prim0 + prim1 | 0; - }), undefined)(1, 2), - _1: 3 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "File \"print_alpha_test.res\", line 16, characters 10-17", + (function (param) { + return { + TAG: "Eq", + _0: f((function (prim0, prim1) { + return prim0 + prim1 | 0; + }), undefined)(1, 2), + _1: 3 + }; + }) + ], + tl: /* [] */0 +}); exports.f = f; /* Not a pure module */ diff --git a/jscomp/test/queue_402.js b/jscomp/test/queue_402.js index dc081b0f00..487f89ac01 100644 --- a/jscomp/test/queue_402.js +++ b/jscomp/test/queue_402.js @@ -77,9 +77,9 @@ function copy(q) { var tail = q.tail; var tail$p = {}; Caml_obj.update_dummy(tail$p, { - content: tail.content, - next: tail$p - }); + content: tail.content, + next: tail$p + }); var copy$1 = function (_prev, _cell) { while(true) { var cell = _cell; diff --git a/jscomp/test/queue_test.js b/jscomp/test/queue_test.js index 5ecc71ebd8..8e8dd80f11 100644 --- a/jscomp/test/queue_test.js +++ b/jscomp/test/queue_test.js @@ -12,16 +12,16 @@ function Test(Queue) { var to_array = function (q) { var v = Caml_array.make(Curry._1(Queue.length, q), 0); Curry._3(Queue.fold, (function (i, e) { - Caml_array.set(v, i, e); - return i + 1 | 0; - }), 0, q); + Caml_array.set(v, i, e); + return i + 1 | 0; + }), 0, q); return v; }; var queue_1 = function (x) { var q = Curry._1(Queue.create, undefined); $$Array.iter((function (x) { - Curry._2(Queue.add, x, q); - }), x); + Curry._2(Queue.add, x, q); + }), x); return to_array(q); }; return { @@ -33,9 +33,9 @@ function Test(Queue) { function to_array(q) { var v = Caml_array.make(q.length, 0); Queue.fold((function (i, e) { - Caml_array.set(v, i, e); - return i + 1 | 0; - }), 0, q); + Caml_array.set(v, i, e); + return i + 1 | 0; + }), 0, q); return v; } @@ -46,8 +46,8 @@ function queue_1(x) { last: "Nil" }; $$Array.iter((function (x) { - Queue.add(x, q); - }), x); + Queue.add(x, q); + }), x); return to_array(q); } @@ -59,9 +59,9 @@ var T1 = { function to_array$1(q) { var v = Caml_array.make(q.length, 0); Queue_402.fold((function (i, e) { - Caml_array.set(v, i, e); - return i + 1 | 0; - }), 0, q); + Caml_array.set(v, i, e); + return i + 1 | 0; + }), 0, q); return v; } @@ -71,8 +71,8 @@ function queue_1$1(x) { tail: undefined }; $$Array.iter((function (x) { - Queue_402.add(x, q); - }), x); + Queue_402.add(x, q); + }), x); return to_array$1(q); } @@ -84,6 +84,24 @@ var T2 = { var suites_0 = [ "File \"queue_test.res\", line 34, characters 6-13", (function (param) { + var x = [ + 3, + 4, + 5, + 2 + ]; + return { + TAG: "Eq", + _0: x, + _1: queue_1(x) + }; + }) +]; + +var suites_1 = { + hd: [ + "File \"queue_test.res\", line 41, characters 6-13", + (function (param) { var x = [ 3, 4, @@ -93,27 +111,9 @@ var suites_0 = [ return { TAG: "Eq", _0: x, - _1: queue_1(x) + _1: queue_1$1(x) }; }) -]; - -var suites_1 = { - hd: [ - "File \"queue_test.res\", line 41, characters 6-13", - (function (param) { - var x = [ - 3, - 4, - 5, - 2 - ]; - return { - TAG: "Eq", - _0: x, - _1: queue_1$1(x) - }; - }) ], tl: /* [] */0 }; diff --git a/jscomp/test/random_test.js b/jscomp/test/random_test.js index e32d5eadf9..aca1f2aa7e 100644 --- a/jscomp/test/random_test.js +++ b/jscomp/test/random_test.js @@ -44,24 +44,24 @@ for(var i = 0; i <= 9; ++i){ } Mt_global.collect_eq(id, suites, "File \"random_test.res\", line 28, characters 12-19", v, [ - true, - true, - true, - true, - true, - false, - true, - true, - true, - false - ]); + true, + true, + true, + true, + true, + false, + true, + true, + true, + false +]); var f = Random.int64(Int64.max_int); var h = Random.int64([ - 0, - 3 - ]); + 0, + 3 +]); var vv = Random.bits(); diff --git a/jscomp/test/raw_output_test.js b/jscomp/test/raw_output_test.js index 515fb69a3f..e185759e2a 100644 --- a/jscomp/test/raw_output_test.js +++ b/jscomp/test/raw_output_test.js @@ -10,8 +10,8 @@ function mk(fn) { (((_)=> console.log('should works'))()); console.log((function () { - return 1; - })()); + return 1; +})()); exports.mk = mk; /* Not a pure module */ diff --git a/jscomp/test/rbset.js b/jscomp/test/rbset.js index f22b2a2103..c8e5ea0107 100644 --- a/jscomp/test/rbset.js +++ b/jscomp/test/rbset.js @@ -219,12 +219,12 @@ function unbalanced_left(x) { if (match._0 === "Black") { return [ balance_left({ - TAG: "Node", - _0: "Red", - _1: match._1, - _2: match._2, - _3: match._3 - }, x._2, x._3), + TAG: "Node", + _0: "Red", + _1: match._1, + _2: match._2, + _3: match._3 + }, x._2, x._3), true ]; } @@ -237,12 +237,12 @@ function unbalanced_left(x) { _1: match._1, _2: match._2, _3: balance_left({ - TAG: "Node", - _0: "Red", - _1: match$1._1, - _2: match$1._2, - _3: match$1._3 - }, x._2, x._3) + TAG: "Node", + _0: "Red", + _1: match$1._1, + _2: match$1._2, + _3: match$1._3 + }, x._2, x._3) }, false ]; @@ -255,12 +255,12 @@ function unbalanced_left(x) { if (typeof match$2 === "object" && match$2._0 === "Black") { return [ balance_left({ - TAG: "Node", - _0: "Red", - _1: match$2._1, - _2: match$2._2, - _3: match$2._3 - }, x._2, x._3), + TAG: "Node", + _0: "Red", + _1: match$2._1, + _2: match$2._2, + _3: match$2._3 + }, x._2, x._3), false ]; } @@ -288,12 +288,12 @@ function unbalanced_right(x) { if (match._0 === "Black") { return [ balance_right(a, x$1, { - TAG: "Node", - _0: "Red", - _1: match._1, - _2: match._2, - _3: match._3 - }), + TAG: "Node", + _0: "Red", + _1: match._1, + _2: match._2, + _3: match._3 + }), true ]; } @@ -304,12 +304,12 @@ function unbalanced_right(x) { TAG: "Node", _0: "Black", _1: balance_right(a, x$1, { - TAG: "Node", - _0: "Red", - _1: match$1._1, - _2: match$1._2, - _3: match$1._3 - }), + TAG: "Node", + _0: "Red", + _1: match$1._1, + _2: match$1._2, + _3: match$1._3 + }), _2: match._2, _3: match._3 }, @@ -324,12 +324,12 @@ function unbalanced_right(x) { if (typeof match$2 === "object" && match$2._0 === "Black") { return [ balance_right(x._1, x._2, { - TAG: "Node", - _0: "Red", - _1: match$2._1, - _2: match$2._2, - _3: match$2._3 - }), + TAG: "Node", + _0: "Red", + _1: match$2._1, + _2: match$2._2, + _3: match$2._3 + }), false ]; } diff --git a/jscomp/test/reactDOMRe.js b/jscomp/test/reactDOMRe.js index c8eed6108c..9bdc80bab6 100644 --- a/jscomp/test/reactDOMRe.js +++ b/jscomp/test/reactDOMRe.js @@ -82,9 +82,9 @@ var Ref = {}; function createElementVariadic(domClassName, props, children) { var variadicArguments = [ - domClassName, - props - ].concat(children); + domClassName, + props + ].concat(children); return React.createElement.apply(null, variadicArguments); } diff --git a/jscomp/test/reactTestUtils.js b/jscomp/test/reactTestUtils.js index 94bc82f53b..c5f06d9b94 100644 --- a/jscomp/test/reactTestUtils.js +++ b/jscomp/test/reactTestUtils.js @@ -16,8 +16,8 @@ function act(func) { function actAsync(func) { return TestUtils.act(function () { - return Curry._1(func, undefined); - }); + return Curry._1(func, undefined); + }); } function changeWithValue(element, value) { @@ -53,14 +53,14 @@ function findByAllSelector(element, selector) { function findBySelectorAndTextContent(element, selector, content) { return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (function (node) { - return node.textContent === content; - })); + return node.textContent === content; + })); } function findBySelectorAndPartialTextContent(element, selector, content) { return Belt_Array.getBy(Array.from(element.querySelectorAll(selector)), (function (node) { - return node.textContent.includes(content); - })); + return node.textContent.includes(content); + })); } var DOM = { @@ -73,15 +73,15 @@ var DOM = { function prepareContainer(container, param) { var containerElement = document.createElement("div"); Belt_Option.map(document.body, (function (body) { - return body.appendChild(containerElement); - })); + return body.appendChild(containerElement); + })); container.contents = Caml_option.some(containerElement); } function cleanupContainer(container, param) { Belt_Option.map(container.contents, (function (prim) { - prim.remove(); - })); + prim.remove(); + })); container.contents = undefined; } diff --git a/jscomp/test/reasonReact.js b/jscomp/test/reasonReact.js index c2092592fc..457528f13f 100644 --- a/jscomp/test/reasonReact.js +++ b/jscomp/test/reasonReact.js @@ -6,9 +6,9 @@ var React = require("react"); function createDomElement(s, props, children) { var vararg = [ - s, - props - ].concat(children); + s, + props + ].concat(children); return Curry._2(React.createElement.apply, null, vararg); } @@ -77,10 +77,10 @@ function element(keyOpt, refOpt, component) { return Curry._2(jsElementWrapped, key, ref); } else { return React.createElement(component.reactClassInternal, { - key: key, - ref: ref, - reasonProps: element$1 - }); + key: key, + ref: ref, + reasonProps: element$1 + }); } } @@ -94,16 +94,16 @@ var dummyInteropComponent = basicComponent("interop"); function wrapJsForReason(reactClass, props, children) { var jsElementWrapped = (function (param, param$1) { - var props$1 = Object.assign(Object.assign({}, props), { - ref: param$1, - key: param - }); - var varargs = [ - reactClass, - props$1 - ].concat(children); - return Curry._2(React.createElement.apply, null, varargs); + var props$1 = Object.assign(Object.assign({}, props), { + ref: param$1, + key: param }); + var varargs = [ + reactClass, + props$1 + ].concat(children); + return Curry._2(React.createElement.apply, null, varargs); + }); return { debugName: dummyInteropComponent.debugName, reactClassInternal: dummyInteropComponent.reactClassInternal, diff --git a/jscomp/test/reasonReactRouter.js b/jscomp/test/reasonReactRouter.js index f4aa12637d..980ad043b3 100644 --- a/jscomp/test/reasonReactRouter.js +++ b/jscomp/test/reasonReactRouter.js @@ -160,30 +160,30 @@ function unwatchUrl(watcherID) { function useUrl(serverUrl, param) { var match = React.useState(function (param) { - if (serverUrl !== undefined) { - return serverUrl; - } else { - return url(); - } - }); + if (serverUrl !== undefined) { + return serverUrl; + } else { + return url(); + } + }); var setUrl = match[1]; var url$1 = match[0]; React.useEffect((function (param) { - var watcherId = watchUrl(function (url) { - Curry._1(setUrl, (function (param) { - return url; - })); - }); - var newUrl = url(); - if (urlNotEqual(newUrl, url$1)) { - Curry._1(setUrl, (function (param) { - return newUrl; - })); - } - return (function (param) { - unwatchUrl(watcherId); - }); - }), []); + var watcherId = watchUrl(function (url) { + Curry._1(setUrl, (function (param) { + return url; + })); + }); + var newUrl = url(); + if (urlNotEqual(newUrl, url$1)) { + Curry._1(setUrl, (function (param) { + return newUrl; + })); + } + return (function (param) { + unwatchUrl(watcherId); + }); + }), []); return url$1; } diff --git a/jscomp/test/rec_array_test.js b/jscomp/test/rec_array_test.js index 6c4c9833c4..d79b26c073 100644 --- a/jscomp/test/rec_array_test.js +++ b/jscomp/test/rec_array_test.js @@ -8,12 +8,12 @@ var vicky = {}; var teacher = {}; Caml_obj.update_dummy(vicky, { - taughtBy: teacher - }); + taughtBy: teacher +}); Caml_obj.update_dummy(teacher, { - students: [vicky] - }); + students: [vicky] +}); exports.vicky = vicky; exports.teacher = teacher; diff --git a/jscomp/test/rec_fun_test.js b/jscomp/test/rec_fun_test.js index 4077d12d8f..f97cb953f0 100644 --- a/jscomp/test/rec_fun_test.js +++ b/jscomp/test/rec_fun_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -44,8 +44,8 @@ function g(param) { return i + 1 | 0; }; Caml_obj.update_dummy(v, { - contents: next - }); + contents: next + }); console.log(String(next(0, true))); } @@ -56,14 +56,14 @@ var x = {}; var y = {}; Caml_obj.update_dummy(x, { - hd: 1, - tl: y - }); + hd: 1, + tl: y +}); Caml_obj.update_dummy(y, { - hd: 2, - tl: x - }); + hd: 2, + tl: x +}); eq("File \"rec_fun_test.res\", line 29, characters 3-10", called.contents, 2); diff --git a/jscomp/test/rec_module_test.js b/jscomp/test/rec_module_test.js index 94c38e6a47..49fa9062c0 100644 --- a/jscomp/test/rec_module_test.js +++ b/jscomp/test/rec_module_test.js @@ -574,24 +574,24 @@ function subset(_s1, _s2) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; @@ -1096,107 +1096,107 @@ var ASet = { var suites_0 = [ "test1", (function (param) { - return { - TAG: "Eq", - _0: [ - true, - true, - false, - false - ], - _1: [ - Curry._1(A.even, 2), - Curry._1(even$1, 4), - Curry._1(B.odd, 2), - Curry._1(odd$1, 4) - ] - }; - }) + return { + TAG: "Eq", + _0: [ + true, + true, + false, + false + ], + _1: [ + Curry._1(A.even, 2), + Curry._1(even$1, 4), + Curry._1(B.odd, 2), + Curry._1(odd$1, 4) + ] + }; + }) ]; var suites_1 = { hd: [ "test2", (function (param) { - return { - TAG: "Eq", - _0: Curry._1(y, undefined), - _1: 32 - }; - }) + return { + TAG: "Eq", + _0: Curry._1(y, undefined), + _1: 32 + }; + }) ], tl: { hd: [ "test3", (function (param) { - return { - TAG: "Eq", - _0: Curry._1(x, undefined), - _1: 35 - }; - }) + return { + TAG: "Eq", + _0: Curry._1(x, undefined), + _1: 35 + }; + }) ], tl: { hd: [ "test4", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Curry._1(A.even, 2) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Curry._1(A.even, 2) + }; + }) ], tl: { hd: [ "test4", (function (param) { - return { - TAG: "Eq", - _0: true, - _1: Curry._1(even$1, 4) - }; - }) + return { + TAG: "Eq", + _0: true, + _1: Curry._1(even$1, 4) + }; + }) ], tl: { hd: [ "test5", (function (param) { - return { - TAG: "Eq", - _0: false, - _1: Curry._1(B.odd, 2) - }; - }) + return { + TAG: "Eq", + _0: false, + _1: Curry._1(B.odd, 2) + }; + }) ], tl: { hd: [ "test6", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Curry._1(cardinal, Curry._1(of_list, { - hd: { - TAG: "Leaf", - _0: "a" - }, - tl: { - hd: { - TAG: "Leaf", - _0: "b" - }, - tl: { - hd: { - TAG: "Leaf", - _0: "a" - }, - tl: /* [] */0 - } - } - })) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Curry._1(cardinal, Curry._1(of_list, { + hd: { + TAG: "Leaf", + _0: "a" + }, + tl: { + hd: { + TAG: "Leaf", + _0: "b" + }, + tl: { + hd: { + TAG: "Leaf", + _0: "a" + }, + tl: /* [] */0 + } + } + })) + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/recmodule.js b/jscomp/test/recmodule.js index f1c55d5b1a..1183ee98fb 100644 --- a/jscomp/test/recmodule.js +++ b/jscomp/test/recmodule.js @@ -9,9 +9,9 @@ var Entity = {}; function MakeLayer(Deps) { var getLight = function (id) { return Curry._1(Deps.presentLight, { - id: id, - name: "Light 1" - }); + id: id, + name: "Light 1" + }); }; return { getLight: getLight @@ -68,52 +68,52 @@ var Infra = { }; var I = Caml_module.init_mod([ - "recmodule.res", - 67, - 30 - ], { - TAG: "Module", - _0: [ - [ - "Function", - "presentJson" - ], - [ - "Function", - "routes" - ] - ] - }); + "recmodule.res", + 67, + 30 +], { + TAG: "Module", + _0: [ + [ + "Function", + "presentJson" + ], + [ + "Function", + "routes" + ] + ] +}); var A = Caml_module.init_mod([ - "recmodule.res", - 68, - 25 - ], { - TAG: "Module", - _0: [ - [ - "Function", - "handleGetLight" - ], - [ - "Function", - "presentLight" - ] - ] - }); + "recmodule.res", + 68, + 25 +], { + TAG: "Module", + _0: [ + [ + "Function", + "handleGetLight" + ], + [ + "Function", + "presentLight" + ] + ] +}); var U = Caml_module.init_mod([ - "recmodule.res", - 69, - 25 - ], { - TAG: "Module", - _0: [[ - "Function", - "getLight" - ]] - }); + "recmodule.res", + 69, + 25 +], { + TAG: "Module", + _0: [[ + "Function", + "getLight" + ]] +}); function presentJson(json, status) { throw { @@ -135,21 +135,21 @@ function routes(param) { } Caml_module.update_mod({ - TAG: "Module", - _0: [ - [ - "Function", - "presentJson" - ], - [ - "Function", - "routes" - ] - ] - }, I, { - presentJson: presentJson, - routes: routes - }); + TAG: "Module", + _0: [ + [ + "Function", + "presentJson" + ], + [ + "Function", + "routes" + ] + ] +}, I, { + presentJson: presentJson, + routes: routes +}); function presentLight(light) { return Curry._2(I.presentJson, light, 200); @@ -160,38 +160,38 @@ function handleGetLight(req) { } Caml_module.update_mod({ - TAG: "Module", - _0: [ - [ - "Function", - "handleGetLight" - ], - [ - "Function", - "presentLight" - ] - ] - }, A, { - handleGetLight: handleGetLight, - presentLight: presentLight - }); + TAG: "Module", + _0: [ + [ + "Function", + "handleGetLight" + ], + [ + "Function", + "presentLight" + ] + ] +}, A, { + handleGetLight: handleGetLight, + presentLight: presentLight +}); function getLight(id) { return Curry._1(A.presentLight, { - id: id, - name: "Light 1" - }); + id: id, + name: "Light 1" + }); } Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "getLight" - ]] - }, U, { - getLight: getLight - }); + TAG: "Module", + _0: [[ + "Function", + "getLight" + ]] +}, U, { + getLight: getLight +}); var App = { I: I, diff --git a/jscomp/test/record_debug_test.js b/jscomp/test/record_debug_test.js index 3c191e796e..3d6e6ae6d9 100644 --- a/jscomp/test/record_debug_test.js +++ b/jscomp/test/record_debug_test.js @@ -87,12 +87,12 @@ var c = [ console.log(a, c); eq("File \"record_debug_test.res\", line 58, characters 3-10", [ - "", - "a" - ], [ - "", - "a" - ]); + "", + "a" +], [ + "", + "a" +]); Mt.from_pair_suites("record_debug_test.res", suites.contents); diff --git a/jscomp/test/record_with_test.js b/jscomp/test/record_with_test.js index cd2746df38..99d0b9e295 100644 --- a/jscomp/test/record_with_test.js +++ b/jscomp/test/record_with_test.js @@ -40,12 +40,12 @@ function f(g, h) { var suites_0 = [ "eq_with", (function (param) { - return { - TAG: "Eq", - _0: v, - _1: u_v - }; - }) + return { + TAG: "Eq", + _0: v, + _1: u_v + }; + }) ]; var suites = { diff --git a/jscomp/test/recursive_module.js b/jscomp/test/recursive_module.js index 6c6117c7f6..9c1d1f8045 100644 --- a/jscomp/test/recursive_module.js +++ b/jscomp/test/recursive_module.js @@ -23,81 +23,81 @@ function eq(loc, x, y) { var Xx = { f: (function (prim0, prim1) { - return Caml_external_polyfill.resolve("hfiehi")(prim0, prim1); - }) + return Caml_external_polyfill.resolve("hfiehi")(prim0, prim1); + }) }; var Int3 = Caml_module.init_mod([ - "recursive_module.res", - 25, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "u" - ]] - }); + "recursive_module.res", + 25, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "u" + ]] +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "u" - ]] - }, Int3, Int3); + TAG: "Module", + _0: [[ + "Function", + "u" + ]] +}, Int3, Int3); var Inta = Caml_module.init_mod([ - "recursive_module.res", - 29, - 4 - ], { - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }); + "recursive_module.res", + 29, + 4 +], { + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}); var Intb = Caml_module.init_mod([ - "recursive_module.res", - 34, - 4 - ], { - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }); + "recursive_module.res", + 34, + 4 +], { + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}); var a = CamlinternalLazy.from_fun(function () { - return CamlinternalLazy.force(Intb.a); - }); + return CamlinternalLazy.force(Intb.a); +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }, Inta, { - a: a - }); + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}, Inta, { + a: a +}); var a$1 = CamlinternalLazy.from_fun(function () { - return CamlinternalLazy.force(Inta.a) + 1 | 0; - }); + return CamlinternalLazy.force(Inta.a) + 1 | 0; +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }, Intb, { - a: a$1 - }); + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}, Intb, { + a: a$1 +}); var tmp; @@ -116,56 +116,56 @@ catch (raw_exn){ eq("File \"recursive_module.res\", line 39, characters 2-9", -1, tmp); var Inta$1 = Caml_module.init_mod([ - "recursive_module.res", - 49, - 6 - ], { - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }); + "recursive_module.res", + 49, + 6 +], { + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}); var Intb$1 = Caml_module.init_mod([ - "recursive_module.res", - 54, - 6 - ], { - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }); + "recursive_module.res", + 54, + 6 +], { + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}); var a$2 = CamlinternalLazy.from_fun(function () { - return CamlinternalLazy.force(Intb$1.a) + 1 | 0; - }); + return CamlinternalLazy.force(Intb$1.a) + 1 | 0; +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }, Inta$1, { - a: a$2 - }); + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}, Inta$1, { + a: a$2 +}); var a$3 = CamlinternalLazy.from_fun(function () { - return 2; - }); + return 2; +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Lazy", - "a" - ]] - }, Intb$1, { - a: a$3 - }); + TAG: "Module", + _0: [[ + "Lazy", + "a" + ]] +}, Intb$1, { + a: a$3 +}); var A = { Inta: Inta$1, diff --git a/jscomp/test/recursive_module_test.js b/jscomp/test/recursive_module_test.js index 07d1ef5d6f..100cc75c64 100644 --- a/jscomp/test/recursive_module_test.js +++ b/jscomp/test/recursive_module_test.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -38,24 +38,24 @@ function add(suite) { } var Int3 = Caml_module.init_mod([ - "recursive_module_test.res", - 12, - 4 - ], { - TAG: "Module", - _0: [[ - "Function", - "u" - ]] - }); + "recursive_module_test.res", + 12, + 4 +], { + TAG: "Module", + _0: [[ + "Function", + "u" + ]] +}); Caml_module.update_mod({ - TAG: "Module", - _0: [[ - "Function", - "u" - ]] - }, Int3, Int3); + TAG: "Module", + _0: [[ + "Function", + "u" + ]] +}, Int3, Int3); function fact(n) { if (n <= 1) { @@ -79,16 +79,16 @@ var Fact = { eq("File \"recursive_module_test.res\", line 29, characters 12-19", 120, Curry._1(fact$1, 5)); add([ - "File \"recursive_module_test.res\", line 31, characters 14-21", - (function (param) { - return { - TAG: "ThrowAny", - _0: (function (param) { - Curry._1(Int3.u, 3); - }) - }; - }) - ]); + "File \"recursive_module_test.res\", line 31, characters 14-21", + (function (param) { + return { + TAG: "ThrowAny", + _0: (function (param) { + Curry._1(Int3.u, 3); + }) + }; + }) +]); Mt.from_pair_suites("Recursive_module_test", suites.contents); diff --git a/jscomp/test/recursive_react_component.js b/jscomp/test/recursive_react_component.js index f444a034db..b8e5845630 100644 --- a/jscomp/test/recursive_react_component.js +++ b/jscomp/test/recursive_react_component.js @@ -6,8 +6,8 @@ var React = require("react"); function make(Props) { var foo = Props.foo; return React.createElement(make, { - foo: foo - }); + foo: foo + }); } exports.make = make; diff --git a/jscomp/test/recursive_records_test.js b/jscomp/test/recursive_records_test.js index bf595643a4..45121866dc 100644 --- a/jscomp/test/recursive_records_test.js +++ b/jscomp/test/recursive_records_test.js @@ -26,9 +26,9 @@ rec_cell.next = rec_cell; function f0(x) { var rec_cell = {}; Caml_obj.update_dummy(rec_cell, { - content: Math.imul(x, x) - 6 | 0, - next: rec_cell - }); + content: Math.imul(x, x) - 6 | 0, + next: rec_cell + }); return rec_cell; } @@ -49,10 +49,10 @@ rec_cell2.next = rec_cell2; function f2(x) { var rec_cell2 = {}; Caml_obj.update_dummy(rec_cell2, { - TAG: "Cons", - content: Math.imul(x, x) - 6 | 0, - next: rec_cell2 - }); + TAG: "Cons", + content: Math.imul(x, x) - 6 | 0, + next: rec_cell2 + }); return rec_cell2; } @@ -94,9 +94,9 @@ rec_cell3.tl = rec_cell3; function f3(x) { var rec_cell3 = {}; Caml_obj.update_dummy(rec_cell3, { - hd: Math.imul(x, x) - 6 | 0, - tl: rec_cell3 - }); + hd: Math.imul(x, x) - 6 | 0, + tl: rec_cell3 + }); return rec_cell3; } diff --git a/jscomp/test/recursive_unbound_module_test.js b/jscomp/test/recursive_unbound_module_test.js index 8121c7cad7..48df7db9c3 100644 --- a/jscomp/test/recursive_unbound_module_test.js +++ b/jscomp/test/recursive_unbound_module_test.js @@ -16,22 +16,22 @@ function Make(X) { } var B = Caml_module.init_mod([ - "recursive_unbound_module_test.res", - 14, - 11 - ], { - TAG: "Module", - _0: [[ - { - TAG: "Module", - _0: [[ - "Function", - "f" - ]] - }, - "M" - ]] - }); + "recursive_unbound_module_test.res", + 14, + 11 +], { + TAG: "Module", + _0: [[ + { + TAG: "Module", + _0: [[ + "Function", + "f" + ]] + }, + "M" + ]] +}); function f(param) { @@ -42,20 +42,20 @@ var M = { }; Caml_module.update_mod({ - TAG: "Module", - _0: [[ - { - TAG: "Module", - _0: [[ - "Function", - "f" - ]] - }, - "M" - ]] - }, B, { - M: M - }); + TAG: "Module", + _0: [[ + { + TAG: "Module", + _0: [[ + "Function", + "f" + ]] + }, + "M" + ]] +}, B, { + M: M +}); var A; diff --git a/jscomp/test/res_debug.js b/jscomp/test/res_debug.js index f826b71df4..3787871d02 100644 --- a/jscomp/test/res_debug.js +++ b/jscomp/test/res_debug.js @@ -35,16 +35,16 @@ function optionMap(x, f) { } var ok_name = optionMap(undefined, (function (x) { - return x; - })); + return x; +})); var ok = { name: ok_name }; var bad_name = optionMap(undefined, (function (x) { - return x; - })); + return x; +})); var bad = { name: bad_name diff --git a/jscomp/test/sexp.js b/jscomp/test/sexp.js index 2f80fed91e..309983f2a1 100644 --- a/jscomp/test/sexp.js +++ b/jscomp/test/sexp.js @@ -138,8 +138,8 @@ function of_record(l) { return { NAME: "List", VAL: List.map((function (param) { - return of_field(param[0], param[1]); - }), l) + return of_field(param[0], param[1]); + }), l) }; } @@ -256,8 +256,8 @@ function to_float(e) { function to_string(e) { return _try_atom(e, (function (x) { - return x; - })); + return x; + })); } function to_pair(e) { @@ -283,16 +283,16 @@ function to_pair(e) { function to_pair_with(f1, f2, e) { return $great$great$eq(to_pair(e), (function (param) { - var y = param[1]; - return $great$great$eq(Curry._1(f1, param[0]), (function (x) { - return $great$great$eq(Curry._1(f2, y), (function (y) { - return [ - x, - y - ]; - })); - })); - })); + var y = param[1]; + return $great$great$eq(Curry._1(f1, param[0]), (function (x) { + return $great$great$eq(Curry._1(f2, y), (function (y) { + return [ + x, + y + ]; + })); + })); + })); } function to_triple(e) { @@ -323,20 +323,20 @@ function to_triple(e) { function to_triple_with(f1, f2, f3, e) { return $great$great$eq(to_triple(e), (function (param) { - var z = param[2]; - var y = param[1]; - return $great$great$eq(Curry._1(f1, param[0]), (function (x) { - return $great$great$eq(Curry._1(f2, y), (function (y) { - return $great$great$eq(Curry._1(f3, z), (function (z) { - return [ - x, - y, - z - ]; - })); - })); - })); + var z = param[2]; + var y = param[1]; + return $great$great$eq(Curry._1(f1, param[0]), (function (x) { + return $great$great$eq(Curry._1(f2, y), (function (y) { + return $great$great$eq(Curry._1(f3, z), (function (z) { + return [ + x, + y, + z + ]; })); + })); + })); + })); } function to_list(e) { diff --git a/jscomp/test/sexpm.js b/jscomp/test/sexpm.js index 560a00743e..56c8fdc150 100644 --- a/jscomp/test/sexpm.js +++ b/jscomp/test/sexpm.js @@ -93,11 +93,11 @@ function to_buf(b, t) { if (l.tl) { $$Buffer.add_char(b, /* '(' */40); List.iteri((function (i, t$p) { - if (i > 0) { - $$Buffer.add_char(b, /* ' ' */32); - } - to_buf(b, t$p); - }), l); + if (i > 0) { + $$Buffer.add_char(b, /* ' ' */32); + } + to_buf(b, t$p); + }), l); return $$Buffer.add_char(b, /* ')' */41); } else { $$Buffer.add_string(b, "("); @@ -201,8 +201,8 @@ function expr(k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return expr(k, param); - }), _error_eof); + return expr(k, param); + }), _error_eof); } var c = _get(t); if (c >= 11) { @@ -222,8 +222,8 @@ function expr_starting_with(c, k, t) { if (c >= 42) { if (c === 59) { return skip_comment((function (param, param$1) { - return expr(k, t); - }), t); + return expr(k, t); + }), t); } if (c === 92) { return _error(t)("unexpected '\\'"); @@ -278,53 +278,53 @@ function expr_list(acc, k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return expr_list(acc, k, param); - }), _error_eof); + return expr_list(acc, k, param); + }), _error_eof); } var c = _get(t); if (c > 32 || c < 9) { if (c === 41) { return Curry._2(k, undefined, { - NAME: "List", - VAL: List.rev(acc) - }); + NAME: "List", + VAL: List.rev(acc) + }); } } else if (c > 31 || c < 11) { continue ; } return expr_starting_with(c, (function (last, e) { - if (last !== undefined) { - if (last !== 40) { - if (last !== 41) { - return expr_list({ - hd: e, - tl: acc - }, k, t); - } else { - return Curry._2(k, undefined, { - NAME: "List", - VAL: List.rev({ - hd: e, - tl: acc - }) - }); - } - } else { - return expr_list(/* [] */0, (function (param, l) { - return expr_list({ - hd: l, - tl: acc - }, k, t); - }), t); - } - } else { - return expr_list({ - hd: e, - tl: acc - }, k, t); - } + if (last !== undefined) { + if (last !== 40) { + if (last !== 41) { + return expr_list({ + hd: e, + tl: acc + }, k, t); + } else { + return Curry._2(k, undefined, { + NAME: "List", + VAL: List.rev({ + hd: e, + tl: acc + }) + }); + } + } else { + return expr_list(/* [] */0, (function (param, l) { + return expr_list({ + hd: l, + tl: acc + }, k, t); }), t); + } + } else { + return expr_list({ + hd: e, + tl: acc + }, k, t); + } + }), t); }; } @@ -332,19 +332,19 @@ function _return_atom(last, k, t) { var s = $$Buffer.contents(t.atom); t.atom.position = 0; return Curry._2(k, last, { - NAME: "Atom", - VAL: s - }); + NAME: "Atom", + VAL: s + }); } function atom(k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return atom(k, param); - }), (function (param) { - return _return_atom(undefined, k, param); - })); + return atom(k, param); + }), (function (param) { + return _return_atom(undefined, k, param); + })); } var c = _get(t); var exit = 0; @@ -391,8 +391,8 @@ function quoted(k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return quoted(k, param); - }), _error_eof); + return quoted(k, param); + }), _error_eof); } var c = _get(t); if (c === 34) { @@ -400,9 +400,9 @@ function quoted(k, t) { } if (c === 92) { return escaped((function (c) { - $$Buffer.add_char(t.atom, c); - return quoted(k, t); - }), t); + $$Buffer.add_char(t.atom, c); + return quoted(k, t); + }), t); } $$Buffer.add_char(t.atom, c); continue ; @@ -412,8 +412,8 @@ function quoted(k, t) { function escaped(k, t) { if (t.i === t.len) { return _refill(t, (function (param) { - return escaped(k, param); - }), _error_eof); + return escaped(k, param); + }), _error_eof); } var c = _get(t); if (c >= 92) { @@ -459,8 +459,8 @@ function escaped(k, t) { } if (_is_digit(c)) { return read2int(c - /* '0' */48 | 0, (function (n) { - return Curry._1(k, Char.chr(n)); - }), t); + return Curry._1(k, Char.chr(n)); + }), t); } else { return _error(t)("unexpected escaped char '" + (c + "'")); } @@ -469,8 +469,8 @@ function escaped(k, t) { function read2int(i, k, t) { if (t.i === t.len) { return _refill(t, (function (param) { - return read2int(i, k, param); - }), _error_eof); + return read2int(i, k, param); + }), _error_eof); } var c = _get(t); if (_is_digit(c)) { @@ -483,8 +483,8 @@ function read2int(i, k, t) { function read1int(i, k, t) { if (t.i === t.len) { return _refill(t, (function (param) { - return read1int(i, k, param); - }), _error_eof); + return read1int(i, k, param); + }), _error_eof); } var c = _get(t); if (_is_digit(c)) { @@ -498,8 +498,8 @@ function skip_comment(k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return skip_comment(k, param); - }), _error_eof); + return skip_comment(k, param); + }), _error_eof); } var match = _get(t); if (match === 10) { @@ -513,10 +513,10 @@ function expr_or_end(k, t) { while(true) { if (t.i === t.len) { return _refill(t, (function (param) { - return expr_or_end(k, param); - }), (function (param) { - return "End"; - })); + return expr_or_end(k, param); + }), (function (param) { + return "End"; + })); } var c = _get(t); if (c >= 11) { @@ -534,11 +534,11 @@ function expr_or_end(k, t) { function next(t) { return expr_or_end((function (param, x) { - return { - NAME: "Ok", - VAL: x - }; - }), t); + return { + NAME: "Ok", + VAL: x + }; + }), t); } function parse_string(s) { diff --git a/jscomp/test/sexpm_test.js b/jscomp/test/sexpm_test.js index 2a49758dbb..18b7b4b3a3 100644 --- a/jscomp/test/sexpm_test.js +++ b/jscomp/test/sexpm_test.js @@ -20,12 +20,12 @@ function eq(loc, param) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -42,50 +42,50 @@ function print_or_error(x) { var a = Sexpm.parse_string("(x x gh 3 3)"); eq("File \"sexpm_test.res\", line 17, characters 5-12", [ - { - NAME: "Ok", - VAL: { - NAME: "List", - VAL: { + { + NAME: "Ok", + VAL: { + NAME: "List", + VAL: { + hd: { + NAME: "Atom", + VAL: "x" + }, + tl: { + hd: { + NAME: "Atom", + VAL: "x" + }, + tl: { hd: { NAME: "Atom", - VAL: "x" + VAL: "gh" }, tl: { hd: { NAME: "Atom", - VAL: "x" + VAL: "3" }, tl: { hd: { NAME: "Atom", - VAL: "gh" + VAL: "3" }, - tl: { - hd: { - NAME: "Atom", - VAL: "3" - }, - tl: { - hd: { - NAME: "Atom", - VAL: "3" - }, - tl: /* [] */0 - } - } + tl: /* [] */0 } } } } - }, - a - ]); + } + } + }, + a +]); eq("File \"sexpm_test.res\", line 18, characters 5-12", [ - print_or_error(a).trim(), - "Ok:(x x gh 3 3)\n".trim() - ]); + print_or_error(a).trim(), + "Ok:(x x gh 3 3)\n".trim() +]); Mt.from_pair_suites("Sexpm_test", suites.contents); diff --git a/jscomp/test/side_effect2.js b/jscomp/test/side_effect2.js index da6ef1f323..8f205815ab 100644 --- a/jscomp/test/side_effect2.js +++ b/jscomp/test/side_effect2.js @@ -4,8 +4,8 @@ var Belt_Array = require("../../lib/js/belt_Array.js"); var a = Belt_Array.map([1], (function (x) { - return x; - })); + return x; +})); exports.a = a; /* a Not a pure module */ diff --git a/jscomp/test/splice_test.js b/jscomp/test/splice_test.js index d359dcd116..4d9551e0c4 100644 --- a/jscomp/test/splice_test.js +++ b/jscomp/test/splice_test.js @@ -30,79 +30,79 @@ var a = []; a.push(1, 2, 3, 4); eq("File \"splice_test.res\", line 23, characters 5-12", a, [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); function dynamic(arr) { var a = []; Caml_splice_call.spliceObjApply(a, "push", [ - 1, - arr - ]); + 1, + arr + ]); eq("File \"splice_test.res\", line 29, characters 5-12", a, Caml_array.concat({ - hd: [1], - tl: { - hd: arr, - tl: /* [] */0 - } - })); + hd: [1], + tl: { + hd: arr, + tl: /* [] */0 + } + })); } dynamic([ - 2, - 3, - 4 - ]); + 2, + 3, + 4 +]); dynamic([]); dynamic([ - 1, - 1, - 3 - ]); + 1, + 1, + 3 +]); var a$1 = new Array(1, 2, 3, 4); eq("File \"splice_test.res\", line 44, characters 5-12", a$1, [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); function dynamicNew(arr) { var a = Caml_splice_call.spliceNewApply(Array, [ - 1, - 2, - arr - ]); + 1, + 2, + arr + ]); eq("File \"splice_test.res\", line 49, characters 5-12", a, Caml_array.concat({ - hd: [ - 1, - 2 - ], - tl: { - hd: arr, - tl: /* [] */0 - } - })); + hd: [ + 1, + 2 + ], + tl: { + hd: arr, + tl: /* [] */0 + } + })); } dynamicNew([ - 3, - 4 - ]); + 3, + 4 +]); dynamicNew([]); dynamicNew([ - 1, - 3 - ]); + 1, + 3 +]); class Foo { constructor(...names) { @@ -114,10 +114,10 @@ class Foo { var f = new Foo("a", "b", "c"); eq("File \"splice_test.res\", line 71, characters 5-12", f.names, [ - "a", - "b", - "c" - ]); + "a", + "b", + "c" +]); function dynamicFoo(arr) { var f = Caml_splice_call.spliceNewApply(Foo, [arr]); @@ -129,50 +129,50 @@ dynamicFoo([]); dynamicFoo(["a"]); dynamicFoo([ - "a", - "b", - "c" - ]); + "a", + "b", + "c" +]); var a$2 = []; a$2.push(1, 2, 3, 4); eq("File \"splice_test.res\", line 93, characters 7-14", a$2, [ - 1, - 2, - 3, - 4 - ]); + 1, + 2, + 3, + 4 +]); function dynamic$1(arr) { var a = []; Caml_splice_call.spliceObjApply(a, "push", [ - 1, - arr - ]); + 1, + arr + ]); eq("File \"splice_test.res\", line 99, characters 7-14", a, Caml_array.concat({ - hd: [1], - tl: { - hd: arr, - tl: /* [] */0 - } - })); + hd: [1], + tl: { + hd: arr, + tl: /* [] */0 + } + })); } dynamic$1([ - 2, - 3, - 4 - ]); + 2, + 3, + 4 +]); dynamic$1([]); dynamic$1([ - 1, - 1, - 3 - ]); + 1, + 1, + 3 +]); var Pipe = { dynamic: dynamic$1 @@ -180,9 +180,9 @@ var Pipe = { function f1(c) { return Caml_splice_call.spliceApply(Math.max, [ - 1, - c - ]); + 1, + c + ]); } eq("File \"splice_test.res\", line 109, characters 3-10", Math.max(1, 2, 3), 3); diff --git a/jscomp/test/stack_comp_test.js b/jscomp/test/stack_comp_test.js index 65dadf2497..39bc2a58eb 100644 --- a/jscomp/test/stack_comp_test.js +++ b/jscomp/test/stack_comp_test.js @@ -23,9 +23,9 @@ function eq(f, param) { function assert_(loc, v) { eq(loc, [ - v, - true - ]); + v, + true + ]); } function to_list(s) { @@ -33,11 +33,11 @@ function to_list(s) { contents: /* [] */0 }; List.iter((function (x) { - l.contents = { - hd: x, - tl: l.contents - }; - }), s.c); + l.contents = { + hd: x, + tl: l.contents + }; + }), s.c); return l.contents; } @@ -80,78 +80,78 @@ assert_("File \"stack_comp_test.res\", line 39, characters 10-17", to_list(s) == Stack.push(1, s); assert_("File \"stack_comp_test.res\", line 41, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: /* [] */0 - }) && s.len === 1); + hd: 1, + tl: /* [] */0 +}) && s.len === 1); Stack.push(2, s); assert_("File \"stack_comp_test.res\", line 43, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) && s.len === 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) && s.len === 2); Stack.push(3, s); assert_("File \"stack_comp_test.res\", line 45, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) && s.len === 3); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}) && s.len === 3); Stack.push(4, s); assert_("File \"stack_comp_test.res\", line 47, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - }) && s.len === 4); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +}) && s.len === 4); assert_("File \"stack_comp_test.res\", line 48, characters 10-17", Stack.pop(s) === 4); assert_("File \"stack_comp_test.res\", line 49, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } - } - }) && s.len === 3); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: /* [] */0 + } + } +}) && s.len === 3); assert_("File \"stack_comp_test.res\", line 50, characters 10-17", Stack.pop(s) === 3); assert_("File \"stack_comp_test.res\", line 51, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }) && s.len === 2); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}) && s.len === 2); assert_("File \"stack_comp_test.res\", line 52, characters 10-17", Stack.pop(s) === 2); assert_("File \"stack_comp_test.res\", line 53, characters 10-17", Caml_obj.equal(to_list(s), { - hd: 1, - tl: /* [] */0 - }) && s.len === 1); + hd: 1, + tl: /* [] */0 +}) && s.len === 1); assert_("File \"stack_comp_test.res\", line 54, characters 10-17", Stack.pop(s) === 1); @@ -227,9 +227,9 @@ assert_("File \"stack_comp_test.res\", line 94, characters 10-17", s$3.len === 0 assert_("File \"stack_comp_test.res\", line 95, characters 10-17", does_raise(Stack.pop, s$3)); assert_("File \"stack_comp_test.res\", line 96, characters 10-17", Caml_obj.equal(s$3, { - c: /* [] */0, - len: 0 - })); + c: /* [] */0, + len: 0 +})); Stack.push(42, s$3); @@ -247,68 +247,68 @@ for(var i$1 = 1; i$1 <= 10; ++i$1){ var s2 = Stack.copy(s1); assert_("File \"stack_comp_test.res\", line 107, characters 10-17", Caml_obj.equal(to_list(s1), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, + hd: 7, tl: { - hd: 4, + hd: 8, tl: { - hd: 5, + hd: 9, tl: { - hd: 6, - tl: { - hd: 7, - tl: { - hd: 8, - tl: { - hd: 9, - tl: { - hd: 10, - tl: /* [] */0 - } - } - } - } + hd: 10, + tl: /* [] */0 } } } } } - })); + } + } + } + } +})); assert_("File \"stack_comp_test.res\", line 108, characters 10-17", Caml_obj.equal(to_list(s2), { - hd: 1, + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: { + hd: 5, tl: { - hd: 2, + hd: 6, tl: { - hd: 3, + hd: 7, tl: { - hd: 4, + hd: 8, tl: { - hd: 5, + hd: 9, tl: { - hd: 6, - tl: { - hd: 7, - tl: { - hd: 8, - tl: { - hd: 9, - tl: { - hd: 10, - tl: /* [] */0 - } - } - } - } + hd: 10, + tl: /* [] */0 } } } } } - })); + } + } + } + } +})); assert_("File \"stack_comp_test.res\", line 109, characters 10-17", s1.len === 10); @@ -359,9 +359,9 @@ var i$7 = { }; List.iter((function (j) { - assert_("File \"stack_comp_test.res\", line 143, characters 12-19", i$7.contents === j); - i$7.contents = i$7.contents + 1 | 0; - }), s$5.c); + assert_("File \"stack_comp_test.res\", line 143, characters 12-19", i$7.contents === j); + i$7.contents = i$7.contents + 1 | 0; +}), s$5.c); var s1$1 = { c: /* [] */0, @@ -394,52 +394,52 @@ for(var i$8 = 1; i$8 <= 4; ++i$8){ assert_("File \"stack_comp_test.res\", line 165, characters 10-17", s1$2.len === 4); assert_("File \"stack_comp_test.res\", line 166, characters 10-17", Caml_obj.equal(to_list(s1$2), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +})); var s2$2 = Stack.copy(s1$2); assert_("File \"stack_comp_test.res\", line 168, characters 10-17", s1$2.len === 4); assert_("File \"stack_comp_test.res\", line 169, characters 10-17", Caml_obj.equal(to_list(s1$2), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +})); assert_("File \"stack_comp_test.res\", line 170, characters 10-17", s2$2.len === 4); assert_("File \"stack_comp_test.res\", line 171, characters 10-17", Caml_obj.equal(to_list(s2$2), { - hd: 1, - tl: { - hd: 2, - tl: { - hd: 3, - tl: { - hd: 4, - tl: /* [] */0 - } - } - } - })); + hd: 1, + tl: { + hd: 2, + tl: { + hd: 3, + tl: { + hd: 4, + tl: /* [] */0 + } + } + } +})); Mt.from_pair_suites("Stack_comp_test", suites.contents); diff --git a/jscomp/test/stack_test.js b/jscomp/test/stack_test.js index ddb7a34f97..57d9d46d62 100644 --- a/jscomp/test/stack_test.js +++ b/jscomp/test/stack_test.js @@ -30,21 +30,21 @@ function v(param) { var suites_0 = [ "push_test", (function (param) { - return { - TAG: "Eq", - _0: { - hd: 1, + return { + TAG: "Eq", + _0: { + hd: 1, + tl: { + hd: 4, tl: { - hd: 4, - tl: { - hd: 3, - tl: /* [] */0 - } + hd: 3, + tl: /* [] */0 } - }, - _1: v() - }; - }) + } + }, + _1: v() + }; + }) ]; var suites = { diff --git a/jscomp/test/stream_parser_test.js b/jscomp/test/stream_parser_test.js index 958d579ce2..eba8437b6b 100644 --- a/jscomp/test/stream_parser_test.js +++ b/jscomp/test/stream_parser_test.js @@ -109,33 +109,33 @@ function parse(token) { return [ r, Queue.fold((function (acc, x) { - return { - hd: x, - tl: acc - }; - }), /* [] */0, look_ahead) + return { + hd: x, + tl: acc + }; + }), /* [] */0, look_ahead) ]; } var lexer = Genlex.make_lexer({ - hd: "(", + hd: "(", + tl: { + hd: "*", + tl: { + hd: "/", tl: { - hd: "*", + hd: "+", tl: { - hd: "/", + hd: "-", tl: { - hd: "+", - tl: { - hd: "-", - tl: { - hd: ")", - tl: /* [] */0 - } - } + hd: ")", + tl: /* [] */0 } } } - }); + } + } +}); function token(chars) { var strm = lexer(chars); @@ -250,11 +250,11 @@ function l_parse(token) { return [ r, Queue.fold((function (acc, x) { - return { - hd: x, - tl: acc - }; - }), /* [] */0, look_ahead) + return { + hd: x, + tl: acc + }; + }), /* [] */0, look_ahead) ]; } @@ -272,12 +272,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -286,40 +286,40 @@ function eq(loc, x, y) { var match = parse(token(Stream.of_string("1 + 2 + (3 - 2) * 3 * 3 - 2 a"))); eq("File \"stream_parser_test.res\", line 141, characters 5-12", [ - match[0], - match[1] - ], [ - 10, - { - hd: { - TAG: "Ident", - _0: "a" - }, - tl: /* [] */0 - } - ]); + match[0], + match[1] +], [ + 10, + { + hd: { + TAG: "Ident", + _0: "a" + }, + tl: /* [] */0 + } +]); eq("File \"stream_parser_test.res\", line 142, characters 5-12", [ - 2, - { - hd: { - TAG: "Kwd", - _0: "==" - }, - tl: /* [] */0 - } - ], parse(token(Stream.of_string("3 - 2 - 1")))); + 2, + { + hd: { + TAG: "Kwd", + _0: "==" + }, + tl: /* [] */0 + } +], parse(token(Stream.of_string("3 - 2 - 1")))); eq("File \"stream_parser_test.res\", line 143, characters 5-12", [ - 0, - { - hd: { - TAG: "Kwd", - _0: "==" - }, - tl: /* [] */0 - } - ], l_parse(token(Stream.of_string("3 - 2 - 1")))); + 0, + { + hd: { + TAG: "Kwd", + _0: "==" + }, + tl: /* [] */0 + } +], l_parse(token(Stream.of_string("3 - 2 - 1")))); Mt.from_pair_suites("Stream_parser_test", suites.contents); diff --git a/jscomp/test/string_get_set_test.js b/jscomp/test/string_get_set_test.js index abe0db83a2..673e49e9b0 100644 --- a/jscomp/test/string_get_set_test.js +++ b/jscomp/test/string_get_set_test.js @@ -5,17 +5,17 @@ var Mt = require("./mt.js"); var Caml_string = require("../../lib/js/caml_string.js"); Mt.from_pair_suites("string_get_set_test.res", { - hd: [ - "File \"string_get_set_test.res\", line 4, characters 36-43", - (function (param) { - return { - TAG: "Eq", - _0: Caml_string.get("h", 0), - _1: /* 'h' */104 - }; - }) - ], - tl: /* [] */0 - }); + hd: [ + "File \"string_get_set_test.res\", line 4, characters 36-43", + (function (param) { + return { + TAG: "Eq", + _0: Caml_string.get("h", 0), + _1: /* 'h' */104 + }; + }) + ], + tl: /* [] */0 +}); /* Not a pure module */ diff --git a/jscomp/test/string_runtime_test.js b/jscomp/test/string_runtime_test.js index e417bdbe88..74a0534644 100644 --- a/jscomp/test/string_runtime_test.js +++ b/jscomp/test/string_runtime_test.js @@ -10,55 +10,55 @@ var Caml_bytes = require("../../lib/js/caml_bytes.js"); var suites_0 = [ "?is_printable", (function (param) { - return { - TAG: "Eq", - _0: Test_char.caml_is_printable(/* 'a' */97), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Test_char.caml_is_printable(/* 'a' */97), + _1: true + }; + }) ]; var suites_1 = { hd: [ "?string_of_bytes", (function (param) { - var match = List.split(List.map((function (x) { - var b = Caml_bytes.create(x); - Bytes.fill(b, 0, x, /* 'c' */99); - return [ - Bytes.to_string(b), - Bytes.unsafe_to_string(Bytes.init(x, (function (param) { - return /* 'c' */99; - }))) - ]; - }), { - hd: 1000, + var match = List.split(List.map((function (x) { + var b = Caml_bytes.create(x); + Bytes.fill(b, 0, x, /* 'c' */99); + return [ + Bytes.to_string(b), + Bytes.unsafe_to_string(Bytes.init(x, (function (param) { + return /* 'c' */99; + }))) + ]; + }), { + hd: 1000, + tl: { + hd: 1024, + tl: { + hd: 1025, + tl: { + hd: 4095, + tl: { + hd: 4096, + tl: { + hd: 5000, tl: { - hd: 1024, - tl: { - hd: 1025, - tl: { - hd: 4095, - tl: { - hd: 4096, - tl: { - hd: 5000, - tl: { - hd: 10000, - tl: /* [] */0 - } - } - } - } - } + hd: 10000, + tl: /* [] */0 } - })); - return { - TAG: "Eq", - _0: match[0], - _1: match[1] - }; - }) + } + } + } + } + } + })); + return { + TAG: "Eq", + _0: match[0], + _1: match[1] + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/string_set.js b/jscomp/test/string_set.js index 1b25c909bd..b5f0e6b551 100644 --- a/jscomp/test/string_set.js +++ b/jscomp/test/string_set.js @@ -194,24 +194,24 @@ function subset(_s1, _s2) { } if (c < 0) { if (!subset({ - TAG: "Node", - _0: l1, - _1: v1, - _2: "Empty", - _3: 0 - }, l2)) { + TAG: "Node", + _0: l1, + _1: v1, + _2: "Empty", + _3: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - _0: "Empty", - _1: v1, - _2: r1, - _3: 0 - }, r2)) { + TAG: "Node", + _0: "Empty", + _1: v1, + _2: r1, + _3: 0 + }, r2)) { return false; } _s1 = l1; @@ -272,8 +272,8 @@ function of_list(l) { function of_array(l) { return $$Array.fold_left((function (acc, x) { - return add(x, acc); - }), "Empty", l); + return add(x, acc); + }), "Empty", l); } function invariant(t) { diff --git a/jscomp/test/string_set_test.js b/jscomp/test/string_set_test.js index 8329723484..4c9c8c70b1 100644 --- a/jscomp/test/string_set_test.js +++ b/jscomp/test/string_set_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/string_test.js b/jscomp/test/string_test.js index 71fbb1f1a8..63813ea131 100644 --- a/jscomp/test/string_test.js +++ b/jscomp/test/string_test.js @@ -61,9 +61,9 @@ function rev_split_by_char(c, s) { var i$p = $$String.index_from(s, i, c); var s$p = $$String.sub(s, i, i$p - i | 0); return loop(i$p + 1 | 0, s$p === "" ? l : ({ - hd: s$p, - tl: l - })); + hd: s$p, + tl: l + })); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); @@ -124,245 +124,243 @@ function xsplit(delim, s) { function string_of_chars(x) { var xs = List.map((function (prim) { - return String.fromCharCode(prim); - }), x); + return String.fromCharCode(prim); + }), x); return $$Array.of_list(xs).join(""); } Mt.from_pair_suites("String_test", { + hd: [ + "mutliple switch", + (function (param) { + return { + TAG: "Eq", + _0: 9, + _1: ff("4") + }; + }) + ], + tl: { + hd: [ + "int switch", + (function (param) { + return { + TAG: "Eq", + _0: 9, + _1: gg(4) + }; + }) + ], + tl: { hd: [ - "mutliple switch", + "escape_normal", (function (param) { - return { - TAG: "Eq", - _0: 9, - _1: ff("4") - }; - }) + return { + TAG: "Eq", + _0: "haha", + _1: $$String.escaped("haha") + }; + }) ], tl: { hd: [ - "int switch", + "escape_bytes", (function (param) { - return { - TAG: "Eq", - _0: 9, - _1: gg(4) - }; - }) + return { + TAG: "Eq", + _0: Bytes.of_string("haha"), + _1: Bytes.escaped(Bytes.of_string("haha")) + }; + }) ], tl: { hd: [ - "escape_normal", + "escape_quote", (function (param) { - return { - TAG: "Eq", - _0: "haha", - _1: $$String.escaped("haha") - }; - }) + return { + TAG: "Eq", + _0: "\\\"\\\"", + _1: $$String.escaped("\"\"") + }; + }) ], tl: { hd: [ - "escape_bytes", + "rev_split_by_char", (function (param) { - return { - TAG: "Eq", - _0: Bytes.of_string("haha"), - _1: Bytes.escaped(Bytes.of_string("haha")) - }; - }) + return { + TAG: "Eq", + _0: { + hd: "", + tl: { + hd: "bbbb", + tl: { + hd: "bbbb", + tl: /* [] */0 + } + } + }, + _1: rev_split_by_char(/* 'a' */97, "bbbbabbbba") + }; + }) ], tl: { hd: [ - "escape_quote", + "File \"string_test.res\", line 86, characters 5-12", (function (param) { - return { - TAG: "Eq", - _0: "\\\"\\\"", - _1: $$String.escaped("\"\"") - }; - }) + return { + TAG: "Eq", + _0: { + hd: "aaaa", + tl: /* [] */0 + }, + _1: rev_split_by_char(/* ',' */44, "aaaa") + }; + }) ], tl: { hd: [ - "rev_split_by_char", + "xsplit", (function (param) { - return { - TAG: "Eq", - _0: { - hd: "", + return { + TAG: "Eq", + _0: { + hd: "a", + tl: { + hd: "b", tl: { - hd: "bbbb", - tl: { - hd: "bbbb", - tl: /* [] */0 - } + hd: "c", + tl: /* [] */0 } - }, - _1: rev_split_by_char(/* 'a' */97, "bbbbabbbba") - }; - }) + } + }, + _1: xsplit(/* '.' */46, "a.b.c") + }; + }) ], tl: { hd: [ - "File \"string_test.res\", line 86, characters 5-12", + "split_empty", (function (param) { + return { + TAG: "Eq", + _0: /* [] */0, + _1: Ext_string_test.split(undefined, "", /* '_' */95) + }; + }) + ], + tl: { + hd: [ + "split_empty2", + (function (param) { return { TAG: "Eq", _0: { - hd: "aaaa", + hd: "test_unsafe_obj_ffi_ppx.cmi", tl: /* [] */0 }, - _1: rev_split_by_char(/* ',' */44, "aaaa") + _1: Ext_string_test.split(false, " test_unsafe_obj_ffi_ppx.cmi", /* ' ' */32) }; }) - ], - tl: { - hd: [ - "xsplit", - (function (param) { - return { - TAG: "Eq", - _0: { - hd: "a", - tl: { - hd: "b", - tl: { - hd: "c", - tl: /* [] */0 - } - } - }, - _1: xsplit(/* '.' */46, "a.b.c") - }; - }) ], tl: { hd: [ - "split_empty", + "rfind", (function (param) { - return { - TAG: "Eq", - _0: /* [] */0, - _1: Ext_string_test.split(undefined, "", /* '_' */95) - }; - }) + return { + TAG: "Eq", + _0: 7, + _1: Ext_string_test.rfind("__", "__index__js") + }; + }) ], tl: { hd: [ - "split_empty2", + "rfind_2", (function (param) { - return { - TAG: "Eq", - _0: { - hd: "test_unsafe_obj_ffi_ppx.cmi", - tl: /* [] */0 - }, - _1: Ext_string_test.split(false, " test_unsafe_obj_ffi_ppx.cmi", /* ' ' */32) - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Ext_string_test.rfind("__", "__index_js") + }; + }) ], tl: { hd: [ - "rfind", + "rfind_3", (function (param) { - return { - TAG: "Eq", - _0: 7, - _1: Ext_string_test.rfind("__", "__index__js") - }; - }) + return { + TAG: "Eq", + _0: -1, + _1: Ext_string_test.rfind("__", "_index_js") + }; + }) ], tl: { hd: [ - "rfind_2", + "find", (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Ext_string_test.rfind("__", "__index_js") - }; - }) + return { + TAG: "Eq", + _0: 0, + _1: Ext_string_test.find(undefined, "__", "__index__js") + }; + }) ], tl: { hd: [ - "rfind_3", + "find_2", (function (param) { + return { + TAG: "Eq", + _0: 6, + _1: Ext_string_test.find(undefined, "__", "_index__js") + }; + }) + ], + tl: { + hd: [ + "find_3", + (function (param) { return { TAG: "Eq", _0: -1, - _1: Ext_string_test.rfind("__", "_index_js") + _1: Ext_string_test.find(undefined, "__", "_index_js") }; }) - ], - tl: { - hd: [ - "find", - (function (param) { - return { - TAG: "Eq", - _0: 0, - _1: Ext_string_test.find(undefined, "__", "__index__js") - }; - }) ], tl: { hd: [ - "find_2", + "of_char", (function (param) { - return { - TAG: "Eq", - _0: 6, - _1: Ext_string_test.find(undefined, "__", "_index__js") - }; - }) + return { + TAG: "Eq", + _0: String.fromCharCode(/* '0' */48), + _1: "0" + }; + }) ], tl: { hd: [ - "find_3", + "of_chars", (function (param) { - return { - TAG: "Eq", - _0: -1, - _1: Ext_string_test.find(undefined, "__", "_index_js") - }; - }) + return { + TAG: "Eq", + _0: string_of_chars({ + hd: /* '0' */48, + tl: { + hd: /* '1' */49, + tl: { + hd: /* '2' */50, + tl: /* [] */0 + } + } + }), + _1: "012" + }; + }) ], - tl: { - hd: [ - "of_char", - (function (param) { - return { - TAG: "Eq", - _0: String.fromCharCode(/* '0' */48), - _1: "0" - }; - }) - ], - tl: { - hd: [ - "of_chars", - (function (param) { - return { - TAG: "Eq", - _0: string_of_chars({ - hd: /* '0' */48, - tl: { - hd: /* '1' */49, - tl: { - hd: /* '2' */50, - tl: /* [] */0 - } - } - }), - _1: "012" - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } } @@ -378,7 +376,9 @@ Mt.from_pair_suites("String_test", { } } } - }); + } + } +}); exports.ff = ff; exports.gg = gg; diff --git a/jscomp/test/string_unicode_test.js b/jscomp/test/string_unicode_test.js index dae9934e58..151705c23f 100644 --- a/jscomp/test/string_unicode_test.js +++ b/jscomp/test/string_unicode_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/switch_case_test.js b/jscomp/test/switch_case_test.js index 2fc6955c00..b794501e3a 100644 --- a/jscomp/test/switch_case_test.js +++ b/jscomp/test/switch_case_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/tagged_template_test.js b/jscomp/test/tagged_template_test.js index 81fc8f6771..d4b445c3d9 100644 --- a/jscomp/test/tagged_template_test.js +++ b/jscomp/test/tagged_template_test.js @@ -8,9 +8,9 @@ var Tagged_template_libJs = require("./tagged_template_lib.js"); function sql(prim0, prim1) { return Caml_splice_call.spliceApply(Tagged_template_libJs.sql, [ - prim0, - prim1 - ]); + prim0, + prim1 + ]); } var Pg = { @@ -37,71 +37,71 @@ function foo(strings, values) { } var res = foo([ - "| 5 * 10 = ", - " |" - ], [5]); + "| 5 * 10 = ", + " |" +], [5]); Mt.from_pair_suites("tagged templates", { + hd: [ + "with externals, it should return a string with the correct interpolations", + (function (param) { + return { + TAG: "Eq", + _0: query, + _1: "SELECT * FROM 'users' WHERE id = '5'" + }; + }) + ], + tl: { + hd: [ + "with module scoped externals, it should also return a string with the correct interpolations", + (function (param) { + return { + TAG: "Eq", + _0: queryWithModule, + _1: "SELECT * FROM 'users' WHERE id = '5'" + }; + }) + ], + tl: { hd: [ - "with externals, it should return a string with the correct interpolations", + "with externals, it should return the result of the function", (function (param) { - return { - TAG: "Eq", - _0: query, - _1: "SELECT * FROM 'users' WHERE id = '5'" - }; - }) + return { + TAG: "Eq", + _0: length, + _1: 52 + }; + }) ], tl: { hd: [ - "with module scoped externals, it should also return a string with the correct interpolations", + "with rescript function, it should return a string with the correct interpolations", (function (param) { - return { - TAG: "Eq", - _0: queryWithModule, - _1: "SELECT * FROM 'users' WHERE id = '5'" - }; - }) + return { + TAG: "Eq", + _0: res, + _1: "| 5 * 10 = 50 |" + }; + }) ], tl: { hd: [ - "with externals, it should return the result of the function", + "a template literal tagged with json should generate a regular string interpolation for now", (function (param) { - return { - TAG: "Eq", - _0: length, - _1: 52 - }; - }) + return { + TAG: "Eq", + _0: "some random " + "string", + _1: "some random string" + }; + }) ], - tl: { - hd: [ - "with rescript function, it should return a string with the correct interpolations", - (function (param) { - return { - TAG: "Eq", - _0: res, - _1: "| 5 * 10 = 50 |" - }; - }) - ], - tl: { - hd: [ - "a template literal tagged with json should generate a regular string interpolation for now", - (function (param) { - return { - TAG: "Eq", - _0: "some random " + "string", - _1: "some random string" - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } } - }); + } + } +}); var extraLength = 10; diff --git a/jscomp/test/tailcall_inline_test.js b/jscomp/test/tailcall_inline_test.js index 1353158616..ecdce79014 100644 --- a/jscomp/test/tailcall_inline_test.js +++ b/jscomp/test/tailcall_inline_test.js @@ -28,48 +28,48 @@ function f(param) { var suites_0 = [ "acc", (function (param) { - return { - TAG: "Eq", - _0: f(), - _1: [ - 0, - 1, - 3, - 6, - 10, - 15, - 21, - 28, - 36, - 45 - ] - }; - }) + return { + TAG: "Eq", + _0: f(), + _1: [ + 0, + 1, + 3, + 6, + 10, + 15, + 21, + 28, + 36, + 45 + ] + }; + }) ]; var suites_1 = { hd: [ "array_to_list", (function (param) { - return { - TAG: "Eq", - _0: { - hd: 1, + return { + TAG: "Eq", + _0: { + hd: 1, + tl: { + hd: 2, tl: { - hd: 2, - tl: { - hd: 3, - tl: /* [] */0 - } + hd: 3, + tl: /* [] */0 } - }, - _1: $$Array.to_list([ - 1, - 2, - 3 - ]) - }; - }) + } + }, + _1: $$Array.to_list([ + 1, + 2, + 3 + ]) + }; + }) ], tl: /* [] */0 }; diff --git a/jscomp/test/test_array.js b/jscomp/test/test_array.js index 2d020e45f9..20c1364c35 100644 --- a/jscomp/test/test_array.js +++ b/jscomp/test/test_array.js @@ -11,36 +11,36 @@ Caml_array.make_float(30); var h = $$Array.sub(v, 0, 2); var hhh = $$Array.append([ - 1, - 2, - 3, - 4 - ], [ - 1, - 2, - 3, - 5 - ]); + 1, + 2, + 3, + 4 +], [ + 1, + 2, + 3, + 5 +]); var u = Caml_array.concat({ + hd: [ + 1, + 2 + ], + tl: { + hd: [ + 2, + 3 + ], + tl: { hd: [ - 1, - 2 + 3, + 4 ], - tl: { - hd: [ - 2, - 3 - ], - tl: { - hd: [ - 3, - 4 - ], - tl: /* [] */0 - } - } - }); + tl: /* [] */0 + } + } +}); var hh = $$Array.blit; diff --git a/jscomp/test/test_array_append.js b/jscomp/test/test_array_append.js index 32b5953310..df19098d62 100644 --- a/jscomp/test/test_array_append.js +++ b/jscomp/test/test_array_append.js @@ -4,9 +4,9 @@ var $$Array = require("../../lib/js/array.js"); var const_v = $$Array.append([ - 1, - 2 - ], [3]); + 1, + 2 +], [3]); exports.const_v = const_v; /* const_v Not a pure module */ diff --git a/jscomp/test/test_bs_this.js b/jscomp/test/test_bs_this.js index 0551e666ee..f16501eb5f 100644 --- a/jscomp/test/test_bs_this.js +++ b/jscomp/test/test_bs_this.js @@ -17,33 +17,33 @@ function bark(param) { return function (x, y) { var o = this ; console.log([ - o.length, - o.x, - o.y, - x, - y - ]); + o.length, + o.x, + o.y, + x, + y + ]); return x + y | 0; }; } var js_obj = { bark: (function (x, y) { - var o = this ; - console.log(o); - return x + y | 0; - }) + var o = this ; + console.log(o); + return x + y | 0; + }) }; function f(x) { x.onload = (function () { - var o = this ; - console.log(o); - }); + var o = this ; + console.log(o); + }); return Curry._2(x.addEventListener, "onload", (function () { - var o = this ; - console.log(o.response); - })); + var o = this ; + console.log(o.response); + })); } function u(x) { diff --git a/jscomp/test/test_closure.js b/jscomp/test/test_closure.js index 848e9bec56..d19efb60e1 100644 --- a/jscomp/test/test_closure.js +++ b/jscomp/test/test_closure.js @@ -11,14 +11,14 @@ var v = { function f(param) { var arr = Caml_array.make(10, (function (param) { - - })); + + })); for(var i = 0; i <= 9; ++i){ Caml_array.set(arr, i, (function(i){ - return function (param) { - v.contents = v.contents + i | 0; - } - }(i))); + return function (param) { + v.contents = v.contents + i | 0; + } + }(i))); } return arr; } @@ -26,8 +26,8 @@ function f(param) { var u = f(); $$Array.iter((function (x) { - Curry._1(x, undefined); - }), u); + Curry._1(x, undefined); +}), u); if (v.contents !== 45) { throw { diff --git a/jscomp/test/test_cps.js b/jscomp/test/test_cps.js index d5b7fd5ecd..63661c7f50 100644 --- a/jscomp/test/test_cps.js +++ b/jscomp/test/test_cps.js @@ -24,21 +24,21 @@ function f(_n, _acc) { function test_closure(param) { var arr = Caml_array.make(6, (function (x) { - return x; - })); + return x; + })); for(var i = 0; i <= 6; ++i){ Caml_array.set(arr, i, (function(i){ - return function (param) { - return i; - } - }(i))); + return function (param) { + return i; + } + }(i))); } return arr; } f(10, (function (param) { - - })); + +})); exports.f = f; exports.test_closure = test_closure; diff --git a/jscomp/test/test_for_loop.js b/jscomp/test/test_for_loop.js index b870467f46..9f942ca9cb 100644 --- a/jscomp/test/test_for_loop.js +++ b/jscomp/test/test_for_loop.js @@ -22,19 +22,19 @@ function for_3(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i <= i_finish; ++i){ var j = (i << 1); Caml_array.set(arr, i, (function(j){ - return function (param) { - v.contents = v.contents + j | 0; - } - }(j))); + return function (param) { + v.contents = v.contents + j | 0; + } + }(j))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -43,20 +43,20 @@ function for_4(x) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i <= i_finish; ++i){ var j = (i << 1); var k = (j << 1); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -65,19 +65,19 @@ function for_5(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); for(var i = 0 ,i_finish = x.length; i <= i_finish; ++i){ var k = Math.imul((u << 1), u); Caml_array.set(arr, i, (function(k){ - return function (param) { - v.contents = v.contents + k | 0; - } - }(k))); + return function (param) { + v.contents = v.contents + k | 0; + } + }(k))); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } @@ -86,8 +86,8 @@ function for_6(x, u) { contents: 0 }; var arr = $$Array.map((function (param, param$1) { - - }), x); + + }), x); var v4 = { contents: 0 }; @@ -106,16 +106,16 @@ function for_6(x, u) { var h = (v5.contents << 1); v2.contents = v2.contents + 1 | 0; Caml_array.set(arr, i, (function(k,h){ - return function (param) { - v.contents = (((((v.contents + k | 0) + v2.contents | 0) + u | 0) + v4.contents | 0) + v5.contents | 0) + h | 0; - } - }(k,h))); + return function (param) { + v.contents = (((((v.contents + k | 0) + v2.contents | 0) + u | 0) + v4.contents | 0) + v5.contents | 0) + h | 0; + } + }(k,h))); } }(v2)); } $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); + }), arr); return v.contents; } diff --git a/jscomp/test/test_google_closure.js b/jscomp/test/test_google_closure.js index 3fa12e30da..bd144a4517 100644 --- a/jscomp/test/test_google_closure.js +++ b/jscomp/test/test_google_closure.js @@ -19,18 +19,18 @@ var a = String(3); var b = 101; var arr = $$Array.init(2, (function (param) { - return 0; - })); + return 0; +})); for(var i = 0; i <= 1; ++i){ Caml_array.set(arr, i, i + 1 | 0); } console.log([ - a, - b, - arr - ]); + a, + b, + arr +]); var c = arr; diff --git a/jscomp/test/test_int_map_find.js b/jscomp/test/test_int_map_find.js index 218099ab77..73474c7326 100644 --- a/jscomp/test/test_int_map_find.js +++ b/jscomp/test/test_int_map_find.js @@ -135,31 +135,31 @@ function add(x, data, param) { } List.fold_left((function (acc, param) { - return add(param[0], param[1], acc); - }), "Empty", { + return add(param[0], param[1], acc); +}), "Empty", { + hd: [ + 10, + /* 'a' */97 + ], + tl: { + hd: [ + 3, + /* 'b' */98 + ], + tl: { hd: [ - 10, - /* 'a' */97 + 7, + /* 'c' */99 ], tl: { hd: [ - 3, - /* 'b' */98 + 20, + /* 'd' */100 ], - tl: { - hd: [ - 7, - /* 'c' */99 - ], - tl: { - hd: [ - 20, - /* 'd' */100 - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); /* Not a pure module */ diff --git a/jscomp/test/test_js_ffi.js b/jscomp/test/test_js_ffi.js index 290254de54..15ce496181 100644 --- a/jscomp/test/test_js_ffi.js +++ b/jscomp/test/test_js_ffi.js @@ -5,8 +5,8 @@ var $$String = require("../../lib/js/string.js"); function v(u) { t({ - compare: $$String.compare - }); + compare: $$String.compare + }); } function u(v) { diff --git a/jscomp/test/test_per.js b/jscomp/test/test_per.js index 9e5b0fda3c..4698529b80 100644 --- a/jscomp/test/test_per.js +++ b/jscomp/test/test_per.js @@ -12,9 +12,9 @@ var Caml_exceptions = require("../../lib/js/caml_exceptions.js"); var Caml_external_polyfill = require("../../lib/js/caml_external_polyfill.js"); Caml_external_polyfill.resolve("register_named_value")("Pervasives.array_bound_error", { - RE_EXN_ID: "Invalid_argument", - _1: "index out of bounds" - }); + RE_EXN_ID: "Invalid_argument", + _1: "index out of bounds" +}); function failwith(s) { throw { @@ -65,34 +65,34 @@ function lnot(x) { var min_int = -2147483648; var infinity = Caml_int64.float_of_bits([ - 2146435072, - 0 - ]); + 2146435072, + 0 +]); var neg_infinity = Caml_int64.float_of_bits([ - -1048576, - 0 - ]); + -1048576, + 0 +]); var nan = Caml_int64.float_of_bits([ - 2146435072, - 1 - ]); + 2146435072, + 1 +]); var max_float = Caml_int64.float_of_bits([ - 2146435071, - 4294967295 - ]); + 2146435071, + 4294967295 +]); var min_float = Caml_int64.float_of_bits([ - 1048576, - 0 - ]); + 1048576, + 0 +]); var epsilon_float = Caml_int64.float_of_bits([ - 1018167296, - 0 - ]); + 1018167296, + 0 +]); function $caret(s1, s2) { var l1 = s1.length; @@ -186,34 +186,34 @@ function open_out_gen(mode, perm, name) { function open_out(name) { return open_out_gen({ - hd: "Open_wronly", + hd: "Open_wronly", + tl: { + hd: "Open_creat", + tl: { + hd: "Open_trunc", tl: { - hd: "Open_creat", - tl: { - hd: "Open_trunc", - tl: { - hd: "Open_text", - tl: /* [] */0 - } - } + hd: "Open_text", + tl: /* [] */0 } - }, 438, name); + } + } + }, 438, name); } function open_out_bin(name) { return open_out_gen({ - hd: "Open_wronly", + hd: "Open_wronly", + tl: { + hd: "Open_creat", + tl: { + hd: "Open_trunc", tl: { - hd: "Open_creat", - tl: { - hd: "Open_trunc", - tl: { - hd: "Open_binary", - tl: /* [] */0 - } - } + hd: "Open_binary", + tl: /* [] */0 } - }, 438, name); + } + } + }, 438, name); } function flush_all(param) { @@ -294,22 +294,22 @@ function open_in_gen(mode, perm, name) { function open_in(name) { return open_in_gen({ - hd: "Open_rdonly", - tl: { - hd: "Open_text", - tl: /* [] */0 - } - }, 0, name); + hd: "Open_rdonly", + tl: { + hd: "Open_text", + tl: /* [] */0 + } + }, 0, name); } function open_in_bin(name) { return open_in_gen({ - hd: "Open_rdonly", - tl: { - hd: "Open_binary", - tl: /* [] */0 - } - }, 0, name); + hd: "Open_rdonly", + tl: { + hd: "Open_binary", + tl: /* [] */0 + } + }, 0, name); } function input(ic, s, ofs, len) { @@ -400,9 +400,9 @@ function input_line(chan) { } var len$1 = (len + n | 0) - 1 | 0; return build_result(Caml_bytes.create(len$1), len$1, { - hd: res, - tl: accu - }); + hd: res, + tl: accu + }); } var beg = Caml_bytes.create(-n | 0); Caml_external_polyfill.resolve("ml_input")(chan, beg, 0, -n | 0); @@ -433,9 +433,9 @@ var exit_function = { function at_exit(f) { var g = exit_function.contents; exit_function.contents = (function (param) { - Curry._1(f, undefined); - Curry._1(g, undefined); - }); + Curry._1(f, undefined); + Curry._1(g, undefined); + }); } function do_at_exit(param) { diff --git a/jscomp/test/test_react.js b/jscomp/test/test_react.js index fccccc3143..db4ba711f3 100644 --- a/jscomp/test/test_react.js +++ b/jscomp/test/test_react.js @@ -11,12 +11,12 @@ var ReactDom = require("react-dom"); console.log(32); ReactDom.render(React.createClass({ - render: (function (param) { - return React.DOM.div({ - alt: "pic" - }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!")); - }) - }), document.getElementById("hi")); + render: (function (param) { + return React.DOM.div({ + alt: "pic" + }, React.DOM.h1(undefined, "hello react"), React.DOM.h2(undefined, "type safe!"), React.DOM.h3(undefined, "type safe!")); + }) +}), document.getElementById("hi")); function f(param) { Xxx(); diff --git a/jscomp/test/test_set.js b/jscomp/test/test_set.js index 706ef72952..2b59bb976b 100644 --- a/jscomp/test/test_set.js +++ b/jscomp/test/test_set.js @@ -416,24 +416,24 @@ function Make(Ord) { } if (c < 0) { if (!subset({ - TAG: "Node", - _0: l1, - _1: v1, - _2: "Empty", - _3: 0 - }, l2)) { + TAG: "Node", + _0: l1, + _1: v1, + _2: "Empty", + _3: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - _0: "Empty", - _1: v1, - _2: r1, - _3: 0 - }, r2)) { + TAG: "Node", + _0: "Empty", + _1: v1, + _2: r1, + _3: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/jscomp/test/test_string_map.js b/jscomp/test/test_string_map.js index 015f7ec46d..b88bd4929c 100644 --- a/jscomp/test/test_string_map.js +++ b/jscomp/test/test_string_map.js @@ -163,15 +163,15 @@ function assertion_test(param) { contents: "Empty" }; timing("building", (function (param) { - for(var i = 0; i <= 1000000; ++i){ - m.contents = add(String(i), String(i), m.contents); - } - })); + for(var i = 0; i <= 1000000; ++i){ + m.contents = add(String(i), String(i), m.contents); + } + })); timing("querying", (function (param) { - for(var i = 0; i <= 1000000; ++i){ - find(String(i), m.contents); - } - })); + for(var i = 0; i <= 1000000; ++i){ + find(String(i), m.contents); + } + })); } exports.assertion_test = assertion_test; diff --git a/jscomp/test/test_while_closure.js b/jscomp/test/test_while_closure.js index 2a2e30074a..03edb7d0ca 100644 --- a/jscomp/test/test_while_closure.js +++ b/jscomp/test/test_while_closure.js @@ -10,18 +10,18 @@ var v = { }; var arr = Caml_array.make(10, (function (param) { - - })); + +})); function f(param) { var n = 0; while(n < 10) { var j = n; Caml_array.set(arr, j, (function(j){ - return function (param) { - v.contents = v.contents + j | 0; - } - }(j))); + return function (param) { + v.contents = v.contents + j | 0; + } + }(j))); n = n + 1 | 0; }; } @@ -29,8 +29,8 @@ function f(param) { f(); $$Array.iter((function (x) { - Curry._1(x, undefined); - }), arr); + Curry._1(x, undefined); +}), arr); console.log(String(v.contents)); diff --git a/jscomp/test/test_while_side_effect.js b/jscomp/test/test_while_side_effect.js index 2539827f96..b9a2005cf7 100644 --- a/jscomp/test/test_while_side_effect.js +++ b/jscomp/test/test_while_side_effect.js @@ -23,12 +23,12 @@ var x = { }; while((function () { - var y = 3; - console.log(String(x.contents)); - y = y + 1 | 0; - x.contents = x.contents + 1 | 0; - return (fib(x.contents) + fib(x.contents) | 0) < 20; - })()) { + var y = 3; + console.log(String(x.contents)); + y = y + 1 | 0; + x.contents = x.contents + 1 | 0; + return (fib(x.contents) + fib(x.contents) | 0) < 20; + })()) { console.log(String(3)); }; diff --git a/jscomp/test/test_zero_nullable.js b/jscomp/test/test_zero_nullable.js index e0c85479cd..df9198c82a 100644 --- a/jscomp/test/test_zero_nullable.js +++ b/jscomp/test/test_zero_nullable.js @@ -19,12 +19,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/ticker.js b/jscomp/test/ticker.js index 5309f884e9..6aa53efad5 100644 --- a/jscomp/test/ticker.js +++ b/jscomp/test/ticker.js @@ -81,18 +81,18 @@ function string_of_rank(x) { function find_ticker_by_name(all_tickers, ticker) { return List.find((function (param) { - return param.ticker_name === ticker; - }), all_tickers); + return param.ticker_name === ticker; + }), all_tickers); } function print_all_composite(all_tickers) { List.iter((function (x) { - var tmp = x.type_; - if (typeof tmp !== "object") { - return; - } - console.log(x.ticker_name); - }), all_tickers); + var tmp = x.type_; + if (typeof tmp !== "object") { + return; + } + console.log(x.ticker_name); + }), all_tickers); } function height(param) { @@ -1080,133 +1080,133 @@ var Ticker_map = { function compute_update_sequences(all_tickers) { List.fold_left((function (counter, ticker) { - var loop = function (counter, ticker) { - var rank = ticker.rank; - if (typeof rank === "object") { - return counter; - } - if (rank !== "Uninitialized") { - return counter; - } - ticker.rank = "Visited"; - var match = ticker.type_; - if (typeof match !== "object") { - var counter$1 = counter + 1 | 0; - ticker.rank = { - TAG: "Ranked", - _0: counter$1 - }; - return counter$1; - } - var match$1 = match._0; - var counter$2 = loop(counter, match$1.lhs); - var counter$3 = loop(counter$2, match$1.rhs); - var counter$4 = counter$3 + 1 | 0; - ticker.rank = { - TAG: "Ranked", - _0: counter$4 - }; - return counter$4; - }; - return loop(counter, ticker); - }), 0, all_tickers); + var loop = function (counter, ticker) { + var rank = ticker.rank; + if (typeof rank === "object") { + return counter; + } + if (rank !== "Uninitialized") { + return counter; + } + ticker.rank = "Visited"; + var match = ticker.type_; + if (typeof match !== "object") { + var counter$1 = counter + 1 | 0; + ticker.rank = { + TAG: "Ranked", + _0: counter$1 + }; + return counter$1; + } + var match$1 = match._0; + var counter$2 = loop(counter, match$1.lhs); + var counter$3 = loop(counter$2, match$1.rhs); + var counter$4 = counter$3 + 1 | 0; + ticker.rank = { + TAG: "Ranked", + _0: counter$4 + }; + return counter$4; + }; + return loop(counter, ticker); + }), 0, all_tickers); var map = List.fold_left((function (map, ticker) { - var tmp = ticker.type_; - if (typeof tmp !== "object") { - return add(ticker.ticker_name, { - hd: ticker, - tl: /* [] */0 - }, map); - } - var loop = function (_up, _map, _ticker) { - while(true) { - var ticker = _ticker; - var map = _map; - var up = _up; - var type_ = ticker.type_; - var ticker_name = ticker.ticker_name; - if (typeof type_ !== "object") { - var l = find(ticker_name, map); - return add(ticker_name, Pervasives.$at(up, l), map); - } - var match = type_._0; - var map$1 = loop({ - hd: ticker, - tl: up - }, map, match.lhs); - _ticker = match.rhs; - _map = map$1; - _up = { - hd: ticker, - tl: up - }; - continue ; - }; - }; - return loop(/* [] */0, map, ticker); - }), "Empty", List.rev(all_tickers)); + var tmp = ticker.type_; + if (typeof tmp !== "object") { + return add(ticker.ticker_name, { + hd: ticker, + tl: /* [] */0 + }, map); + } + var loop = function (_up, _map, _ticker) { + while(true) { + var ticker = _ticker; + var map = _map; + var up = _up; + var type_ = ticker.type_; + var ticker_name = ticker.ticker_name; + if (typeof type_ !== "object") { + var l = find(ticker_name, map); + return add(ticker_name, Pervasives.$at(up, l), map); + } + var match = type_._0; + var map$1 = loop({ + hd: ticker, + tl: up + }, map, match.lhs); + _ticker = match.rhs; + _map = map$1; + _up = { + hd: ticker, + tl: up + }; + continue ; + }; + }; + return loop(/* [] */0, map, ticker); + }), "Empty", List.rev(all_tickers)); return fold((function (k, l, map) { - var l$1 = List.sort_uniq((function (lhs, rhs) { - var x = lhs.rank; - if (typeof x !== "object") { - if (x === "Uninitialized") { - throw { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked", - Error: new Error() - }; - } - throw { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked", - Error: new Error() - }; - } else { - var y = rhs.rank; - if (typeof y === "object") { - return Caml.int_compare(x._0, y._0); - } - if (y === "Uninitialized") { - throw { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked", - Error: new Error() - }; - } - throw { - RE_EXN_ID: "Failure", - _1: "All nodes should be ranked", - Error: new Error() - }; - } - }), l); - return add(k, l$1, map); - }), map, map); + var l$1 = List.sort_uniq((function (lhs, rhs) { + var x = lhs.rank; + if (typeof x !== "object") { + if (x === "Uninitialized") { + throw { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked", + Error: new Error() + }; + } + throw { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked", + Error: new Error() + }; + } else { + var y = rhs.rank; + if (typeof y === "object") { + return Caml.int_compare(x._0, y._0); + } + if (y === "Uninitialized") { + throw { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked", + Error: new Error() + }; + } + throw { + RE_EXN_ID: "Failure", + _1: "All nodes should be ranked", + Error: new Error() + }; + } + }), l); + return add(k, l$1, map); + }), map, map); } function process_quote(ticker_map, new_ticker, new_value) { var update_sequence = find(new_ticker, ticker_map); List.iter((function (ticker) { - var match = ticker.type_; - if (typeof match !== "object") { - if (ticker.ticker_name === new_ticker) { - ticker.value = new_value; - return; - } - throw { - RE_EXN_ID: "Failure", - _1: "Only single Market ticker should be udpated upon a new quote", - Error: new Error() - }; - } - var match$1 = match._0; - var match$2 = match$1.lhs.value; - var match$3 = match$1.rhs.value; - var value = match$2 !== undefined && match$3 !== undefined ? ( - match$1.op === "PLUS" ? match$2 + match$3 : match$2 - match$3 - ) : undefined; - ticker.value = value; - }), update_sequence); + var match = ticker.type_; + if (typeof match !== "object") { + if (ticker.ticker_name === new_ticker) { + ticker.value = new_value; + return; + } + throw { + RE_EXN_ID: "Failure", + _1: "Only single Market ticker should be udpated upon a new quote", + Error: new Error() + }; + } + var match$1 = match._0; + var match$2 = match$1.lhs.value; + var match$3 = match$1.rhs.value; + var value = match$2 !== undefined && match$3 !== undefined ? ( + match$1.op === "PLUS" ? match$2 + match$3 : match$2 - match$3 + ) : undefined; + ticker.value = value; + }), update_sequence); } function process_input_line(ticker_map, all_tickers, line) { diff --git a/jscomp/test/to_string_test.js b/jscomp/test/to_string_test.js index 463f606761..94fb35ac72 100644 --- a/jscomp/test/to_string_test.js +++ b/jscomp/test/to_string_test.js @@ -11,30 +11,30 @@ function f(v) { } Mt.from_pair_suites("To_string_test", { - hd: [ - "File \"to_string_test.res\", line 6, characters 8-15", - (function (param) { - return { - TAG: "Eq", - _0: Pervasives.string_of_float(Pervasives.infinity), - _1: "inf" - }; - }) - ], - tl: { - hd: [ - "File \"to_string_test.res\", line 6, characters 49-56", - (function (param) { - return { - TAG: "Eq", - _0: Pervasives.string_of_float(Pervasives.neg_infinity), - _1: "-inf" - }; - }) - ], - tl: /* [] */0 - } - }); + hd: [ + "File \"to_string_test.res\", line 6, characters 8-15", + (function (param) { + return { + TAG: "Eq", + _0: Pervasives.string_of_float(Pervasives.infinity), + _1: "inf" + }; + }) + ], + tl: { + hd: [ + "File \"to_string_test.res\", line 6, characters 49-56", + (function (param) { + return { + TAG: "Eq", + _0: Pervasives.string_of_float(Pervasives.neg_infinity), + _1: "-inf" + }; + }) + ], + tl: /* [] */0 + } +}); exports.ff = ff; exports.f = f; diff --git a/jscomp/test/topsort_test.js b/jscomp/test/topsort_test.js index 7aeedc7905..ded80b814c 100644 --- a/jscomp/test/topsort_test.js +++ b/jscomp/test/topsort_test.js @@ -63,15 +63,15 @@ var graph = { function nexts(x, g) { return List.fold_left((function (acc, param) { - if (param[0] === x) { - return { - hd: param[1], - tl: acc - }; - } else { - return acc; - } - }), /* [] */0, g); + if (param[0] === x) { + return { + hd: param[1], + tl: acc + }; + } else { + return acc; + } + }), /* [] */0, g); } function dfs1(_nodes, graph, _visited) { @@ -98,30 +98,30 @@ function dfs1(_nodes, graph, _visited) { } if (!Caml_obj.equal(dfs1({ - hd: "a", - tl: /* [] */0 - }, graph, /* [] */0), { - hd: "a", + hd: "a", + tl: /* [] */0 + }, graph, /* [] */0), { + hd: "a", + tl: { + hd: "d", + tl: { + hd: "e", tl: { - hd: "d", + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", + hd: "c", tl: { - hd: "f", - tl: { - hd: "c", - tl: { - hd: "b", - tl: /* [] */0 - } - } + hd: "b", + tl: /* [] */0 } } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -136,30 +136,30 @@ if (!Caml_obj.equal(dfs1({ console.log(""); if (!Caml_obj.equal(dfs1({ - hd: "b", - tl: /* [] */0 - }, { - hd: [ - "f", - "d" - ], - tl: graph - }, /* [] */0), { - hd: "b", + hd: "b", + tl: /* [] */0 + }, { + hd: [ + "f", + "d" + ], + tl: graph + }, /* [] */0), { + hd: "b", + tl: { + hd: "e", + tl: { + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", - tl: { - hd: "f", - tl: { - hd: "d", - tl: /* [] */0 - } - } + hd: "d", + tl: /* [] */0 } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -186,9 +186,9 @@ function dfs2(nodes, graph, visited) { continue ; } _visited = aux(nexts(x, graph), graph, { - hd: x, - tl: visited - }); + hd: x, + tl: visited + }); _nodes = xs; continue ; }; @@ -197,30 +197,30 @@ function dfs2(nodes, graph, visited) { } if (!Caml_obj.equal(dfs2({ - hd: "a", - tl: /* [] */0 - }, graph, /* [] */0), { - hd: "a", + hd: "a", + tl: /* [] */0 + }, graph, /* [] */0), { + hd: "a", + tl: { + hd: "d", + tl: { + hd: "e", tl: { - hd: "d", + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", + hd: "c", tl: { - hd: "f", - tl: { - hd: "c", - tl: { - hd: "b", - tl: /* [] */0 - } - } + hd: "b", + tl: /* [] */0 } } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -233,30 +233,30 @@ if (!Caml_obj.equal(dfs2({ } if (!Caml_obj.equal(dfs2({ - hd: "b", - tl: /* [] */0 - }, { - hd: [ - "f", - "d" - ], - tl: graph - }, /* [] */0), { - hd: "b", + hd: "b", + tl: /* [] */0 + }, { + hd: [ + "f", + "d" + ], + tl: graph + }, /* [] */0), { + hd: "b", + tl: { + hd: "e", + tl: { + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", - tl: { - hd: "f", - tl: { - hd: "d", - tl: /* [] */0 - } - } + hd: "d", + tl: /* [] */0 } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -279,42 +279,42 @@ function dfs3(nodes, graph) { tl: visited.contents }; return List.iter((function (x) { - aux(x, graph); - }), nexts(node, graph)); + aux(x, graph); + }), nexts(node, graph)); } }; List.iter((function (node) { - aux(node, graph); - }), nodes); + aux(node, graph); + }), nodes); return List.rev(visited.contents); } if (!Caml_obj.equal(dfs3({ - hd: "a", - tl: /* [] */0 - }, graph), { - hd: "a", + hd: "a", + tl: /* [] */0 + }, graph), { + hd: "a", + tl: { + hd: "d", + tl: { + hd: "e", tl: { - hd: "d", + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", + hd: "c", tl: { - hd: "f", - tl: { - hd: "c", - tl: { - hd: "b", - tl: /* [] */0 - } - } + hd: "b", + tl: /* [] */0 } } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -327,30 +327,30 @@ if (!Caml_obj.equal(dfs3({ } if (!Caml_obj.equal(dfs3({ - hd: "b", - tl: /* [] */0 - }, { - hd: [ - "f", - "d" - ], - tl: graph - }), { - hd: "b", + hd: "b", + tl: /* [] */0 + }, { + hd: [ + "f", + "d" + ], + tl: graph + }), { + hd: "b", + tl: { + hd: "e", + tl: { + hd: "g", tl: { - hd: "e", + hd: "f", tl: { - hd: "g", - tl: { - hd: "f", - tl: { - hd: "d", - tl: /* [] */0 - } - } + hd: "d", + tl: /* [] */0 } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -416,30 +416,30 @@ function unsafe_topsort(graph) { }; }; List.iter((function (param) { - sort_node(param[0]); - }), graph); + sort_node(param[0]); + }), graph); return visited.contents; } if (!Caml_obj.equal(unsafe_topsort(grwork), { - hd: "wake", + hd: "wake", + tl: { + hd: "shower", + tl: { + hd: "dress", tl: { - hd: "shower", + hd: "eat", tl: { - hd: "dress", + hd: "washup", tl: { - hd: "eat", - tl: { - hd: "washup", - tl: { - hd: "go", - tl: /* [] */0 - } - } + hd: "go", + tl: /* [] */0 } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -930,24 +930,24 @@ function subset(_s1, _s2) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; @@ -1482,8 +1482,8 @@ function pathsort(graph) { }; var sort_nodes = function (path, nodes) { List.iter((function (node) { - sort_node(path, node); - }), nodes); + sort_node(path, node); + }), nodes); }; var sort_node = function (path, node) { if (!List.mem(node, visited.contents)) { @@ -1497,30 +1497,30 @@ function pathsort(graph) { }; List.iter((function (param) { - sort_node(empty_path, param[0]); - }), graph); + sort_node(empty_path, param[0]); + }), graph); return visited.contents; } if (!Caml_obj.equal(pathsort(grwork), { - hd: "wake", + hd: "wake", + tl: { + hd: "shower", + tl: { + hd: "dress", tl: { - hd: "shower", + hd: "eat", tl: { - hd: "dress", + hd: "washup", tl: { - hd: "eat", - tl: { - hd: "washup", - tl: { - hd: "go", - tl: /* [] */0 - } - } + hd: "go", + tl: /* [] */0 } } } - })) { + } + } + })) { throw { RE_EXN_ID: "Assert_failure", _1: [ @@ -1534,12 +1534,12 @@ if (!Caml_obj.equal(pathsort(grwork), { try { pathsort({ - hd: [ - "go", - "eat" - ], - tl: grwork - }); + hd: [ + "go", + "eat" + ], + tl: grwork + }); throw { RE_EXN_ID: "Assert_failure", _1: [ diff --git a/jscomp/test/tramp_fib.js b/jscomp/test/tramp_fib.js index 10ea99b2a9..549622be4b 100644 --- a/jscomp/test/tramp_fib.js +++ b/jscomp/test/tramp_fib.js @@ -22,22 +22,22 @@ function fib(n, k) { return { TAG: "Suspend", _0: (function () { - return fib(n - 1 | 0, (function (v0) { - return fib(n - 2 | 0, (function (v1) { - return k(v0 + v1 | 0); - })); - })); - }) + return fib(n - 1 | 0, (function (v0) { + return fib(n - 2 | 0, (function (v1) { + return k(v0 + v1 | 0); + })); + })); + }) }; } } var u = fib(10, (function (x) { - return { - TAG: "Continue", - _0: x - }; - })); + return { + TAG: "Continue", + _0: x + }; +})); function iter(_bounce) { while(true) { @@ -56,8 +56,8 @@ function isEven(n) { return { TAG: "Suspend", _0: (function () { - return isOdd(n - 1 | 0); - }) + return isOdd(n - 1 | 0); + }) }; } else { return { diff --git a/jscomp/test/tuple_alloc.js b/jscomp/test/tuple_alloc.js index e9acf69852..aa36c4a4cd 100644 --- a/jscomp/test/tuple_alloc.js +++ b/jscomp/test/tuple_alloc.js @@ -41,8 +41,8 @@ function kf(cb, v) { function ikf(v) { return kf((function (prim) { - - }), v); + + }), v); } exports.v = v; diff --git a/jscomp/test/typeof_test.js b/jscomp/test/typeof_test.js index cb0d6dca08..719620660a 100644 --- a/jscomp/test/typeof_test.js +++ b/jscomp/test/typeof_test.js @@ -31,140 +31,140 @@ function string_or_number(x) { var suites_0 = [ "int_type", (function (param) { - return { - TAG: "Eq", - _0: "number", - _1: "number" - }; - }) + return { + TAG: "Eq", + _0: "number", + _1: "number" + }; + }) ]; var suites_1 = { hd: [ "string_type", (function (param) { - return { - TAG: "Eq", - _0: "string", - _1: "string" - }; - }) + return { + TAG: "Eq", + _0: "string", + _1: "string" + }; + }) ], tl: { hd: [ "number_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test(3, "Number"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test(3, "Number"), + _1: true + }; + }) ], tl: { hd: [ "boolean_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test(true, "Boolean"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test(true, "Boolean"), + _1: true + }; + }) ], tl: { hd: [ "undefined_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test(undefined, "Undefined"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test(undefined, "Undefined"), + _1: true + }; + }) ], tl: { hd: [ "string_on_number1", (function (param) { - return { - TAG: "Eq", - _0: string_or_number("xx"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: string_or_number("xx"), + _1: true + }; + }) ], tl: { hd: [ "string_on_number2", (function (param) { - return { - TAG: "Eq", - _0: string_or_number(3.02), - _1: true - }; - }) + return { + TAG: "Eq", + _0: string_or_number(3.02), + _1: true + }; + }) ], tl: { hd: [ "string_on_number3", (function (param) { - return { - TAG: "Eq", - _0: string_or_number(function (x) { - return x; - }), - _1: false - }; - }) + return { + TAG: "Eq", + _0: string_or_number(function (x) { + return x; + }), + _1: false + }; + }) ], tl: { hd: [ "string_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test("3", "String"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test("3", "String"), + _1: true + }; + }) ], tl: { hd: [ "string_gadt_test_neg", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test(3, "String"), - _1: false - }; - }) + return { + TAG: "Eq", + _0: Js_types.test(3, "String"), + _1: false + }; + }) ], tl: { hd: [ "function_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test((function (x) { - return x; - }), "Function"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test((function (x) { + return x; + }), "Function"), + _1: true + }; + }) ], tl: { hd: [ "object_gadt_test", (function (param) { - return { - TAG: "Eq", - _0: Js_types.test({ - x: 3 - }, "Object"), - _1: true - }; - }) + return { + TAG: "Eq", + _0: Js_types.test({ + x: 3 + }, "Object"), + _1: true + }; + }) ], tl: /* [] */0 } diff --git a/jscomp/test/unboxed_use_case.js b/jscomp/test/unboxed_use_case.js index cb5e7e206f..bd935592f8 100644 --- a/jscomp/test/unboxed_use_case.js +++ b/jscomp/test/unboxed_use_case.js @@ -16,9 +16,9 @@ function u(x) { } map_pair(u, [ - 3, - true - ]); + 3, + true +]); var hi = [ 3, @@ -33,9 +33,9 @@ console.log("x"); var v0 = {}; Caml_obj.update_dummy(v0, { - NAME: "A", - VAL: v0 - }); + NAME: "A", + VAL: v0 +}); var v1 = { NAME: "A", diff --git a/jscomp/test/uncurried_cast.js b/jscomp/test/uncurried_cast.js index 19b4e4cb3b..983f630ba3 100644 --- a/jscomp/test/uncurried_cast.js +++ b/jscomp/test/uncurried_cast.js @@ -30,14 +30,14 @@ function testRaise(param) { } var l = Belt_List.mapU({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x) { - return x + 1 | 0; - })); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x) { + return x + 1 | 0; +})); var partial_arg = { hd: 1, @@ -52,8 +52,8 @@ function partial(param) { } var ll = partial(function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); function withOpts(xOpt, y, zOpt, w) { var x = xOpt !== undefined ? xOpt : 3; @@ -85,14 +85,14 @@ function testRaise$1() { } var l$1 = Belt_List.mapU({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }, (function (x) { - return x + 1 | 0; - })); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}, (function (x) { + return x + 1 | 0; +})); var partial_arg$1 = { hd: 1, @@ -107,8 +107,8 @@ function partial$1(param) { } var ll$1 = partial$1(function (x) { - return x + 1 | 0; - }); + return x + 1 | 0; +}); function withOpts$1(xOpt, y, zOpt, w) { var x = xOpt !== undefined ? xOpt : 3; @@ -123,8 +123,8 @@ function still2Args$1(param, param$1) { var partial_arg$2 = 3; var anInt$1 = (function (param) { - return still2Args$1(partial_arg$2, param); - })(5); + return still2Args$1(partial_arg$2, param); +})(5); exports.Uncurried = Uncurried; exports.E = E; diff --git a/jscomp/test/uncurried_default.args.js b/jscomp/test/uncurried_default.args.js index 1c24e3b6dc..2c662976a7 100644 --- a/jscomp/test/uncurried_default.args.js +++ b/jscomp/test/uncurried_default.args.js @@ -16,8 +16,8 @@ var testWithOpt = withOpt(undefined, 3)(undefined, 4); var partial_arg = 10; var partial = Curry._1((function (param) { - return withOpt(partial_arg, param); - })(3), 4)(11); + return withOpt(partial_arg, param); +})(3), 4)(11); var total = withOpt(10, 3)(4, 11); @@ -72,8 +72,8 @@ var testWithOpt$1 = withOpt$1(undefined, 3)(undefined, 4); var partial_arg$1 = 10; var partial$1 = Curry._1((function (param) { - return withOpt$1(partial_arg$1, param); - })(3), 4)(11); + return withOpt$1(partial_arg$1, param); +})(3), 4)(11); var total$1 = withOpt$1(10, 3)(4, 11); diff --git a/jscomp/test/uncurry_external_test.js b/jscomp/test/uncurry_external_test.js index 8d713d1ca6..dbbdc307ed 100644 --- a/jscomp/test/uncurry_external_test.js +++ b/jscomp/test/uncurry_external_test.js @@ -17,12 +17,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/uncurry_test.js b/jscomp/test/uncurry_test.js index 3b5f0ee846..844a4a9e23 100644 --- a/jscomp/test/uncurry_test.js +++ b/jscomp/test/uncurry_test.js @@ -22,9 +22,9 @@ console.log(0); console.log(0); console.log([ - 0, - 1 - ]); + 0, + 1 +]); function xx() { while(true) { diff --git a/jscomp/test/undef_regression2_test.js b/jscomp/test/undef_regression2_test.js index 3774e92372..cfda3dee3a 100644 --- a/jscomp/test/undef_regression2_test.js +++ b/jscomp/test/undef_regression2_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -35,11 +35,11 @@ function ok(loc, x) { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Ok", - _0: x - }; - }) + return { + TAG: "Ok", + _0: x + }; + }) ], tl: suites.contents }; diff --git a/jscomp/test/unit_undefined_test.js b/jscomp/test/unit_undefined_test.js index 87d261715c..cc4e589115 100644 --- a/jscomp/test/unit_undefined_test.js +++ b/jscomp/test/unit_undefined_test.js @@ -18,12 +18,12 @@ function eq(loc, x, y) { function f_01(param) { return hi(function (x) { - if (x === undefined) { - console.log("x"); - return; - } - - }); + if (x === undefined) { + console.log("x"); + return; + } + + }); } function u(x) { diff --git a/jscomp/test/unsafe_ppx_test.js b/jscomp/test/unsafe_ppx_test.js index 9ead28c96c..c4f2090b88 100644 --- a/jscomp/test/unsafe_ppx_test.js +++ b/jscomp/test/unsafe_ppx_test.js @@ -28,8 +28,8 @@ function g(a) { Curry._2(regression2, 3, 2); regression3(3, 2); regression4(3, (function (x) { - return x; - })); + return x; + })); } var max2 = Math.max; @@ -53,54 +53,54 @@ var empty = Object.keys(3); var v = $$test(1, 2); Mt.from_pair_suites("Unsafe_ppx_test", { + hd: [ + "unsafe_max", + (function (param) { + return { + TAG: "Eq", + _0: 2, + _1: max(1, 2) + }; + }) + ], + tl: { + hd: [ + "unsafe_test", + (function (param) { + return { + TAG: "Eq", + _0: 3, + _1: v + }; + }) + ], + tl: { hd: [ - "unsafe_max", + "unsafe_max2", (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: max(1, 2) - }; - }) + return { + TAG: "Eq", + _0: 2, + _1: Math.max(1, 2) + }; + }) ], tl: { hd: [ - "unsafe_test", + "ffi_keys", (function (param) { - return { - TAG: "Eq", - _0: 3, - _1: v - }; - }) + return { + TAG: "Eq", + _0: ["a"], + _1: Ffi_js_test.keys({a : 3}) + }; + }) ], - tl: { - hd: [ - "unsafe_max2", - (function (param) { - return { - TAG: "Eq", - _0: 2, - _1: Math.max(1, 2) - }; - }) - ], - tl: { - hd: [ - "ffi_keys", - (function (param) { - return { - TAG: "Eq", - _0: ["a"], - _1: Ffi_js_test.keys({a : 3}) - }; - }) - ], - tl: /* [] */0 - } - } + tl: /* [] */0 } - }); + } + } +}); exports.x = x; exports.max = max; diff --git a/jscomp/test/update_record_test.js b/jscomp/test/update_record_test.js index 5084a97e4a..8ba65f8dcd 100644 --- a/jscomp/test/update_record_test.js +++ b/jscomp/test/update_record_test.js @@ -14,20 +14,20 @@ var test_id = { function eq(loc, x, y) { console.log([ - x, - y - ]); + x, + y + ]); test_id.contents = test_id.contents + 1 | 0; suites.contents = { hd: [ loc + (" id " + String(test_id.contents)), (function (param) { - return { - TAG: "Eq", - _0: x, - _1: y - }; - }) + return { + TAG: "Eq", + _0: x, + _1: y + }; + }) ], tl: suites.contents }; @@ -46,13 +46,13 @@ function f(x) { } eq("File \"update_record_test.res\", line 28, characters 5-12", 1, f({ - a0: 0, - a1: 0, - a2: 0, - a3: 0, - a4: 0, - a5: 0 - }).a0); + a0: 0, + a1: 0, + a2: 0, + a3: 0, + a4: 0, + a5: 0 +}).a0); var val0 = { "invalid_js_id'": 3, diff --git a/jscomp/test/variantsMatching.js b/jscomp/test/variantsMatching.js index 7656ef95bc..ef1b48f939 100644 --- a/jscomp/test/variantsMatching.js +++ b/jscomp/test/variantsMatching.js @@ -323,12 +323,12 @@ function kind$1(x) { } var expectSeven$1 = plus$3({ - x: 4, - y: 3 - }, { - x: 3, - y: 4 - }); + x: 4, + y: 3 +}, { + x: 3, + y: 4 +}); console.log("expect {x:7, y:7}:", expectSeven$1); diff --git a/jscomp/test/webpack_config.js b/jscomp/test/webpack_config.js index 99a454d6ae..e7af3f78f3 100644 --- a/jscomp/test/webpack_config.js +++ b/jscomp/test/webpack_config.js @@ -40,29 +40,29 @@ var B = {}; function f(param) { return [ (function (prim) { - List$3.ff(); - }), + List$3.ff(); + }), (function (prim) { - List$3.ff2(); - }), + List$3.ff2(); + }), (function (prim) { - List$2.ff(); - }), + List$2.ff(); + }), (function (prim) { - List$2.ff2(); - }) + List$2.ff2(); + }) ]; } List$1.xx(); List.length({ - hd: 1, - tl: { - hd: 2, - tl: /* [] */0 - } - }); + hd: 1, + tl: { + hd: 2, + tl: /* [] */0 + } +}); List.length(/* [] */0); diff --git a/lib/es6/arg.js b/lib/es6/arg.js index 5fd6aad7af..cf1c740869 100644 --- a/lib/es6/arg.js +++ b/lib/es6/arg.js @@ -51,8 +51,8 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { return List.fold_left((function (x, y) { - return x + (sep + y); - }), prefix + l.hd, l.tl) + suffix; + return x + (sep + y); + }), prefix + l.hd, l.tl) + suffix; } else { return ""; } @@ -122,18 +122,18 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { $$Buffer.add_string(buf, errmsg + "\n"); List.iter((function (param) { - var doc = param[2]; - if (doc.length === 0) { - return; - } - var spec = param[1]; - var key = param[0]; - if (spec.TAG !== "Symbol") { - return $$Buffer.add_string(buf, " " + key + " " + doc + "\n"); - } - var sym = make_symlist("{", "|", "}", spec._0); - return $$Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); - }), add_help(speclist)); + var doc = param[2]; + if (doc.length === 0) { + return; + } + var spec = param[1]; + var key = param[0]; + if (spec.TAG !== "Symbol") { + return $$Buffer.add_string(buf, " " + key + " " + doc + "\n"); + } + var sym = make_symlist("{", "|", "}", spec._0); + return $$Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); + }), add_help(speclist)); } function usage_string(speclist, errmsg) { @@ -218,12 +218,12 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } usage_b(b, speclist.contents, errmsg); if (Caml_obj.equal(error, { - TAG: "Unknown", - _0: "-help" - }) || Caml_obj.equal(error, { - TAG: "Unknown", - _0: "--help" - })) { + TAG: "Unknown", + _0: "-help" + }) || Caml_obj.equal(error, { + TAG: "Unknown", + _0: "--help" + })) { return { RE_EXN_ID: Help, _1: $$Buffer.contents(b) @@ -471,15 +471,15 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist var before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); var 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 - } - } - }); + hd: before, + tl: { + hd: newarg, + tl: { + hd: after, + tl: /* [] */0 + } + } + }); return; } @@ -494,9 +494,9 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist var m = Caml_js_exceptions.internalToOCamlException(raw_m); if (m.RE_EXN_ID === Bad) { throw convert_error({ - TAG: "Message", - _0: m._1 - }); + TAG: "Message", + _0: m._1 + }); } if (m.RE_EXN_ID === Stop) { throw convert_error(m._1); @@ -514,15 +514,15 @@ function parse_and_expand_argv_dynamic(current, argv, speclist, anonfun, errmsg) function parse_argv_dynamic(currentOpt, argv, speclist, anonfun, errmsg) { var current$1 = currentOpt !== undefined ? currentOpt : current; parse_and_expand_argv_dynamic_aux(false, current$1, { - contents: argv - }, speclist, anonfun, errmsg); + contents: argv + }, speclist, anonfun, errmsg); } function parse_argv(currentOpt, argv, speclist, anonfun, errmsg) { var current$1 = currentOpt !== undefined ? currentOpt : current; parse_argv_dynamic(current$1, argv, { - contents: speclist - }, anonfun, errmsg); + contents: speclist + }, anonfun, errmsg); } function parse(l, f, msg) { @@ -648,13 +648,13 @@ function replace_leading_tab(s) { contents: false }; return $$String.map((function (c) { - if (c !== 9 || seen.contents) { - return c; - } else { - seen.contents = true; - return /* ' ' */32; - } - }), s); + if (c !== 9 || seen.contents) { + return c; + } else { + seen.contents = true; + return /* ' ' */32; + } + }), s); } function align(limitOpt, speclist) { @@ -663,41 +663,41 @@ function align(limitOpt, speclist) { var len = List.fold_left(max_arg_len, 0, completed); var len$1 = len < limit ? len : limit; return List.map((function (param) { - var spec = param[1]; - var kwd = param[0]; - if (param[2] === "") { - return param; - } - if (spec.TAG === "Symbol") { - var msg = param[2]; - var cutcol = second_word(msg); - var spaces = " ".repeat(Caml.int_max(0, len$1 - cutcol | 0) + 3 | 0); - return [ - kwd, - spec, - "\n" + (spaces + replace_leading_tab(msg)) - ]; - } - var msg$1 = param[2]; - var cutcol$1 = second_word(msg$1); - var kwd_len = kwd.length; - var diff = (len$1 - kwd_len | 0) - cutcol$1 | 0; - if (diff <= 0) { - return [ - kwd, - spec, - replace_leading_tab(msg$1) - ]; - } - var spaces$1 = " ".repeat(diff); - var prefix = $$String.sub(replace_leading_tab(msg$1), 0, cutcol$1); - var suffix = $$String.sub(msg$1, cutcol$1, msg$1.length - cutcol$1 | 0); - return [ - kwd, - spec, - prefix + (spaces$1 + suffix) - ]; - }), completed); + var spec = param[1]; + var kwd = param[0]; + if (param[2] === "") { + return param; + } + if (spec.TAG === "Symbol") { + var msg = param[2]; + var cutcol = second_word(msg); + var spaces = " ".repeat(Caml.int_max(0, len$1 - cutcol | 0) + 3 | 0); + return [ + kwd, + spec, + "\n" + (spaces + replace_leading_tab(msg)) + ]; + } + var msg$1 = param[2]; + var cutcol$1 = second_word(msg$1); + var kwd_len = kwd.length; + var diff = (len$1 - kwd_len | 0) - cutcol$1 | 0; + if (diff <= 0) { + return [ + kwd, + spec, + replace_leading_tab(msg$1) + ]; + } + var spaces$1 = " ".repeat(diff); + var prefix = $$String.sub(replace_leading_tab(msg$1), 0, cutcol$1); + var suffix = $$String.sub(msg$1, cutcol$1, msg$1.length - cutcol$1 | 0); + return [ + kwd, + spec, + prefix + (spaces$1 + suffix) + ]; + }), completed); } export { diff --git a/lib/es6/belt_MapDict.js b/lib/es6/belt_MapDict.js index 434cda87cd..78813d5390 100644 --- a/lib/es6/belt_MapDict.js +++ b/lib/es6/belt_MapDict.js @@ -202,16 +202,16 @@ function mergeU(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { return Belt_internalAVLtree.keepMapU(s2, (function (k, v) { - return f(k, undefined, Caml_option.some(v)); - })); + return f(k, undefined, Caml_option.some(v)); + })); } else { return; } } if (s2 === undefined) { return Belt_internalAVLtree.keepMapU(s1, (function (k, v) { - return f(k, Caml_option.some(v), undefined); - })); + return f(k, Caml_option.some(v), undefined); + })); } if (s1.h >= s2.h) { var v1 = s1.k; diff --git a/lib/es6/belt_internalAVLset.js b/lib/es6/belt_internalAVLset.js index 29541baeb5..55916ff19d 100644 --- a/lib/es6/belt_internalAVLset.js +++ b/lib/es6/belt_internalAVLset.js @@ -859,8 +859,8 @@ function fromArray(xs, cmp) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (x, y) { - return cmp(x, y) < 0; - })); + return cmp(x, y) < 0; + })); var result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalAVLtree.js b/lib/es6/belt_internalAVLtree.js index 93ff8403ff..0e7e8205e8 100644 --- a/lib/es6/belt_internalAVLtree.js +++ b/lib/es6/belt_internalAVLtree.js @@ -1049,8 +1049,8 @@ function fromArray(xs, cmp) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return cmp(param[0], param$1[0]) < 0; - })); + return cmp(param[0], param$1[0]) < 0; + })); var result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalBuckets.js b/lib/es6/belt_internalBuckets.js index 008cd74a0b..68cdc5f858 100644 --- a/lib/es6/belt_internalBuckets.js +++ b/lib/es6/belt_internalBuckets.js @@ -118,34 +118,34 @@ function reduce(h, init, f) { function getMaxBucketLength(h) { return Belt_Array.reduceU(h.buckets, 0, (function (m, b) { - var len = bucketLength(0, b); - if (m > len) { - return m; - } else { - return len; - } - })); + var len = bucketLength(0, b); + if (m > len) { + return m; + } else { + return len; + } + })); } function getBucketHistogram(h) { var mbl = getMaxBucketLength(h); var histo = Belt_Array.makeByU(mbl + 1 | 0, (function (param) { - return 0; - })); + return 0; + })); Belt_Array.forEachU(h.buckets, (function (b) { - var l = bucketLength(0, b); - histo[l] = histo[l] + 1 | 0; - })); + var l = bucketLength(0, b); + histo[l] = histo[l] + 1 | 0; + })); return histo; } function logStats(h) { var histogram = getBucketHistogram(h); console.log({ - bindings: h.size, - buckets: h.buckets.length, - histogram: histogram - }); + bindings: h.size, + buckets: h.buckets.length, + histogram: histogram + }); } function filterMapInplaceBucket(f, h, i, _prec, _cell) { @@ -247,23 +247,23 @@ function linear(h, f) { function keysToArray(h) { return linear(h, (function (x) { - return x.key; - })); + return x.key; + })); } function valuesToArray(h) { return linear(h, (function (x) { - return x.value; - })); + return x.value; + })); } function toArray(h) { return linear(h, (function (x) { - return [ - x.key, - x.value - ]; - })); + return [ + x.key, + x.value + ]; + })); } var C; diff --git a/lib/es6/belt_internalMapInt.js b/lib/es6/belt_internalMapInt.js index 9c1c664d11..5d6bef8e8c 100644 --- a/lib/es6/belt_internalMapInt.js +++ b/lib/es6/belt_internalMapInt.js @@ -316,8 +316,8 @@ function fromArray(xs) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return param[0] < param$1[0]; - })); + return param[0] < param$1[0]; + })); var result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalMapString.js b/lib/es6/belt_internalMapString.js index f0ea125663..52bdf6be10 100644 --- a/lib/es6/belt_internalMapString.js +++ b/lib/es6/belt_internalMapString.js @@ -316,8 +316,8 @@ function fromArray(xs) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return param[0] < param$1[0]; - })); + return param[0] < param$1[0]; + })); var result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/es6/belt_internalSetBuckets.js b/lib/es6/belt_internalSetBuckets.js index 7f795bf85d..b0078ca30a 100644 --- a/lib/es6/belt_internalSetBuckets.js +++ b/lib/es6/belt_internalSetBuckets.js @@ -144,34 +144,34 @@ function reduce(h, init, f) { function getMaxBucketLength(h) { return Belt_Array.reduceU(h.buckets, 0, (function (m, b) { - var len = bucketLength(0, b); - if (m > len) { - return m; - } else { - return len; - } - })); + var len = bucketLength(0, b); + if (m > len) { + return m; + } else { + return len; + } + })); } function getBucketHistogram(h) { var mbl = getMaxBucketLength(h); var histo = Belt_Array.makeByU(mbl + 1 | 0, (function (param) { - return 0; - })); + return 0; + })); Belt_Array.forEachU(h.buckets, (function (b) { - var l = bucketLength(0, b); - histo[l] = histo[l] + 1 | 0; - })); + var l = bucketLength(0, b); + histo[l] = histo[l] + 1 | 0; + })); return histo; } function logStats(h) { var histogram = getBucketHistogram(h); console.log({ - bindings: h.size, - buckets: h.buckets.length, - histogram: histogram - }); + bindings: h.size, + buckets: h.buckets.length, + histogram: histogram + }); } var C; diff --git a/lib/es6/caml_format.js b/lib/es6/caml_format.js index b69b3c5a86..14bb6bb2cf 100644 --- a/lib/es6/caml_format.js +++ b/lib/es6/caml_format.js @@ -255,9 +255,9 @@ function int64_of_string(s) { var res = Caml_int64.mul(sign, aux(d, i + 1 | 0)); var or_res = Caml_int64.or_(res, Caml_int64.zero); if (Caml.i64_eq(base, [ - 0, - 10 - ]) && Caml.i64_neq(res, or_res)) { + 0, + 10 + ]) && Caml.i64_neq(res, or_res)) { throw { RE_EXN_ID: "Failure", _1: "int64_of_string", @@ -405,11 +405,11 @@ function parse_format(fmt) { f.prec = 0; var j = i + 1 | 0; while((function(j){ - return function () { - var w = fmt.codePointAt(j) - /* '0' */48 | 0; - return w >= 0 && w <= 9; - } - }(j))()) { + return function () { + var w = fmt.codePointAt(j) - /* '0' */48 | 0; + return w >= 0 && w <= 9; + } + }(j))()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - /* '0' */48 | 0; j = j + 1 | 0; }; @@ -446,11 +446,11 @@ function parse_format(fmt) { f.width = 0; var j$1 = i; while((function(j$1){ - return function () { - var w = fmt.codePointAt(j$1) - /* '0' */48 | 0; - return w >= 0 && w <= 9; - } - }(j$1))()) { + return function () { + var w = fmt.codePointAt(j$1) - /* '0' */48 | 0; + return w >= 0 && w <= 9; + } + }(j$1))()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - /* '0' */48 | 0; j$1 = j$1 + 1 | 0; }; @@ -558,13 +558,13 @@ function dec_of_pos_int64(x) { var y = Caml_int64.discard_sign(x); var match = Caml_int64.div_mod(y, wbase); var match$1 = Caml_int64.div_mod(Caml_int64.add([ - 0, - 8 - ], match[1]), wbase); + 0, + 8 + ], match[1]), wbase); var quotient = Caml_int64.add(Caml_int64.add([ - 214748364, - 3435973836 - ], match[0]), match$1[0]); + 214748364, + 3435973836 + ], match[0]), match$1[0]); return Caml_int64.to_string(quotient) + "0123456789"[Caml_int64.to_int32(match$1[1])]; } @@ -579,9 +579,9 @@ function oct_of_int64(x) { var y = Caml_int64.discard_sign(x); var match = Caml_int64.div_mod(y, wbase); var quotient = Caml_int64.add([ - 268435456, - 0 - ], match[0]); + 268435456, + 0 + ], match[0]); var modulus = match[1]; s = cvtbl[Caml_int64.to_int32(modulus)] + s; while(Caml.i64_neq(quotient, Caml_int64.zero)) { @@ -683,9 +683,9 @@ function format_float(fmt, x) { s = x$1.toFixed(p); } else { while((function () { - s = x$1.toFixed(p); - return s.length > (prec$1 + 1 | 0); - })()) { + s = x$1.toFixed(p); + return s.length > (prec$1 + 1 | 0); + })()) { p = p - 1 | 0; }; } @@ -786,9 +786,9 @@ var float_of_string = (function(s,exn){ function float_of_string$1(s) { return float_of_string(s, { - RE_EXN_ID: "Failure", - _1: "float_of_string" - }); + RE_EXN_ID: "Failure", + _1: "float_of_string" + }); } export { diff --git a/lib/es6/caml_hash.js b/lib/es6/caml_hash.js index 3e1d49695a..d6f3c1e4a7 100644 --- a/lib/es6/caml_hash.js +++ b/lib/es6/caml_hash.js @@ -85,8 +85,8 @@ function hash(count, _limit, seed, obj) { } return size })(obj$1, (function (v) { - push_back(queue, v); - })); + push_back(queue, v); + })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/es6/caml_lexer.js b/lib/es6/caml_lexer.js index 019412debf..8b13ace897 100644 --- a/lib/es6/caml_lexer.js +++ b/lib/es6/caml_lexer.js @@ -105,9 +105,9 @@ var empty_token_lit = "lexing: empty token"; function lex_engine(tbls, i, buf) { return caml_lex_engine_aux(tbls, i, buf, { - RE_EXN_ID: "Failure", - _1: empty_token_lit - }); + RE_EXN_ID: "Failure", + _1: empty_token_lit + }); } /***********************************************/ @@ -246,9 +246,9 @@ var caml_new_lex_engine_aux = (function (tbl, start_state, lexbuf, exn) { function new_lex_engine(tbl, i, buf) { return caml_new_lex_engine_aux(tbl, i, buf, { - RE_EXN_ID: "Failure", - _1: empty_token_lit - }); + RE_EXN_ID: "Failure", + _1: empty_token_lit + }); } export { diff --git a/lib/es6/camlinternalLazy.js b/lib/es6/camlinternalLazy.js index b9c502817a..3c7711e561 100644 --- a/lib/es6/camlinternalLazy.js +++ b/lib/es6/camlinternalLazy.js @@ -33,8 +33,8 @@ function force(lzv) { } catch (e){ lzv.VAL = (function () { - throw e; - }); + throw e; + }); throw e; } } diff --git a/lib/es6/curry.js b/lib/es6/curry.js index 426fd466c4..f2bdc0bc61 100644 --- a/lib/es6/curry.js +++ b/lib/es6/curry.js @@ -107,9 +107,9 @@ function _2(o, a0, a1) { }; default: return app(o, [ - a0, - a1 - ]); + a0, + a1 + ]); } } } @@ -133,9 +133,9 @@ function _3(o, a0, a1, a2) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2 - ]); + a1, + a2 + ]); case 2 : return app(o(a0, a1), [a2]); case 3 : @@ -158,10 +158,10 @@ function _3(o, a0, a1, a2) { }; default: return app(o, [ - a0, - a1, - a2 - ]); + a0, + a1, + a2 + ]); } } } @@ -185,15 +185,15 @@ function _4(o, a0, a1, a2, a3) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3 - ]); + a1, + a2, + a3 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3 - ]); + a2, + a3 + ]); case 3 : return app(o(a0, a1, a2), [a3]); case 4 : @@ -212,11 +212,11 @@ function _4(o, a0, a1, a2, a3) { }; default: return app(o, [ - a0, - a1, - a2, - a3 - ]); + a0, + a1, + a2, + a3 + ]); } } } @@ -240,22 +240,22 @@ function _5(o, a0, a1, a2, a3, a4) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4 - ]); + a1, + a2, + a3, + a4 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4 - ]); + a2, + a3, + a4 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4 - ]); + a3, + a4 + ]); case 4 : return app(o(a0, a1, a2, a3), [a4]); case 5 : @@ -270,12 +270,12 @@ function _5(o, a0, a1, a2, a3, a4) { }; default: return app(o, [ - a0, - a1, - a2, - a3, - a4 - ]); + a0, + a1, + a2, + a3, + a4 + ]); } } } @@ -299,30 +299,30 @@ function _6(o, a0, a1, a2, a3, a4, a5) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5 - ]); + a1, + a2, + a3, + a4, + a5 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5 - ]); + a2, + a3, + a4, + a5 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5 - ]); + a3, + a4, + a5 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5 - ]); + a4, + a5 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [a5]); case 6 : @@ -333,13 +333,13 @@ function _6(o, a0, a1, a2, a3, a4, a5) { }; default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5 - ]); + a0, + a1, + a2, + a3, + a4, + a5 + ]); } } } @@ -363,53 +363,53 @@ function _7(o, a0, a1, a2, a3, a4, a5, a6) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6 - ]); + a1, + a2, + a3, + a4, + a5, + a6 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6 - ]); + a2, + a3, + a4, + a5, + a6 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6 - ]); + a3, + a4, + a5, + a6 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6 - ]); + a4, + a5, + a6 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [ - a5, - a6 - ]); + a5, + a6 + ]); case 6 : return app(o(a0, a1, a2, a3, a4, a5), [a6]); case 7 : return o(a0, a1, a2, a3, a4, a5, a6); default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6 + ]); } } } @@ -433,62 +433,62 @@ function _8(o, a0, a1, a2, a3, a4, a5, a6, a7) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6, - a7 - ]); + a3, + a4, + a5, + a6, + a7 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6, - a7 - ]); + a4, + a5, + a6, + a7 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [ - a5, - a6, - a7 - ]); + a5, + a6, + a7 + ]); case 6 : return app(o(a0, a1, a2, a3, a4, a5), [ - a6, - a7 - ]); + a6, + a7 + ]); case 7 : return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); } } } diff --git a/lib/es6/genlex.js b/lib/es6/genlex.js index 8d5669107f..4fa9f26e39 100644 --- a/lib/es6/genlex.js +++ b/lib/es6/genlex.js @@ -44,11 +44,11 @@ function get_string(param) { function make_lexer(keywords) { var kwd_table = Hashtbl.create(undefined, 17); List.iter((function (s) { - Hashtbl.add(kwd_table, s, { - TAG: "Kwd", - _0: s - }); - }), keywords); + Hashtbl.add(kwd_table, s, { + TAG: "Kwd", + _0: s + }); + }), keywords); var ident_or_keyword = function (id) { try { return Hashtbl.find(kwd_table, id); @@ -643,8 +643,8 @@ function make_lexer(keywords) { }; return function (input) { return Stream.from(function (_count) { - return next_token(input); - }); + return next_token(input); + }); }; } diff --git a/lib/es6/hashtbl.js b/lib/es6/hashtbl.js index e77c838bba..be49f01828 100644 --- a/lib/es6/hashtbl.js +++ b/lib/es6/hashtbl.js @@ -40,8 +40,8 @@ function is_randomized(param) { } var prng = CamlinternalLazy.from_fun(function () { - return Random.State.make_self_init(); - }); + return Random.State.make_self_init(); +}); function power_2_above(_x, n) { while(true) { @@ -403,11 +403,11 @@ function replace(h, key, data) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); @@ -584,13 +584,13 @@ function bucket_length(_accu, _param) { function stats(h) { var mbl = $$Array.fold_left((function (m, b) { - return Caml.int_max(m, bucket_length(0, b)); - }), 0, h.data); + return Caml.int_max(m, bucket_length(0, b)); + }), 0, h.data); var histo = Caml_array.make(mbl + 1 | 0, 0); $$Array.iter((function (b) { - var l = bucket_length(0, b); - Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); - }), h.data); + var l = bucket_length(0, b); + Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); + }), h.data); return { num_bindings: h.size, num_buckets: h.data.length, @@ -792,11 +792,11 @@ function MakeSeeded(H) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); @@ -1036,11 +1036,11 @@ function Make(H) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); diff --git a/lib/es6/js_array.js b/lib/es6/js_array.js index 681986ffa4..9a90149cb2 100644 --- a/lib/es6/js_array.js +++ b/lib/es6/js_array.js @@ -42,10 +42,10 @@ function sortInPlaceWith(arg1, obj) { function spliceInPlace(pos, remove, add, obj) { return Caml_splice_call.spliceObjApply(obj, "splice", [ - pos, - remove, - add - ]); + pos, + remove, + add + ]); } function removeFromInPlace(pos, obj) { diff --git a/lib/es6/jsxPPXReactSupportC.js b/lib/es6/jsxPPXReactSupportC.js index db1a5c6030..3261f13de6 100644 --- a/lib/es6/jsxPPXReactSupportC.js +++ b/lib/es6/jsxPPXReactSupportC.js @@ -5,18 +5,18 @@ import * as Caml_splice_call from "./caml_splice_call.js"; function createElementWithKey(key, component, props) { return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); + key: key + }, props) : props); } function createElementVariadicWithKey(key, component, props, elements) { return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); + component, + key !== undefined ? Object.assign({ + key: key + }, props) : props, + elements + ]); } var Jsx; diff --git a/lib/es6/jsxPPXReactSupportU.js b/lib/es6/jsxPPXReactSupportU.js index db1a5c6030..3261f13de6 100644 --- a/lib/es6/jsxPPXReactSupportU.js +++ b/lib/es6/jsxPPXReactSupportU.js @@ -5,18 +5,18 @@ import * as Caml_splice_call from "./caml_splice_call.js"; function createElementWithKey(key, component, props) { return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); + key: key + }, props) : props); } function createElementVariadicWithKey(key, component, props, elements) { return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); + component, + key !== undefined ? Object.assign({ + key: key + }, props) : props, + elements + ]); } var Jsx; diff --git a/lib/es6/lazy.js b/lib/es6/lazy.js index 39526c5968..a25ad4e183 100644 --- a/lib/es6/lazy.js +++ b/lib/es6/lazy.js @@ -5,8 +5,8 @@ import * as CamlinternalLazy from "./camlinternalLazy.js"; function from_fun(f) { return CamlinternalLazy.from_fun(function () { - return Curry._1(f, undefined); - }); + return Curry._1(f, undefined); + }); } var from_val = CamlinternalLazy.from_val; diff --git a/lib/es6/lexing.js b/lib/es6/lexing.js index 56c4f12da2..d34084845c 100644 --- a/lib/es6/lexing.js +++ b/lib/es6/lexing.js @@ -47,42 +47,42 @@ function from_function(f) { var partial_arg = Caml_bytes.create(512); return { refill_buff: (function (param) { - var read = Curry._2(f, partial_arg, partial_arg.length); - var n = read > 0 ? read : (param.lex_eof_reached = true, 0); - if ((param.lex_buffer_len + n | 0) > param.lex_buffer.length) { - if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) <= param.lex_buffer.length) { - Bytes.blit(param.lex_buffer, param.lex_start_pos, param.lex_buffer, 0, param.lex_buffer_len - param.lex_start_pos | 0); - } else { - var newlen = (param.lex_buffer.length << 1); - if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) > newlen) { - throw { - RE_EXN_ID: "Failure", - _1: "Lexing.lex_refill: cannot grow buffer", - Error: new Error() - }; - } - var newbuf = Caml_bytes.create(newlen); - Bytes.blit(param.lex_buffer, param.lex_start_pos, newbuf, 0, param.lex_buffer_len - param.lex_start_pos | 0); - param.lex_buffer = newbuf; + var read = Curry._2(f, partial_arg, partial_arg.length); + var n = read > 0 ? read : (param.lex_eof_reached = true, 0); + if ((param.lex_buffer_len + n | 0) > param.lex_buffer.length) { + if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) <= param.lex_buffer.length) { + Bytes.blit(param.lex_buffer, param.lex_start_pos, param.lex_buffer, 0, param.lex_buffer_len - param.lex_start_pos | 0); + } else { + var newlen = (param.lex_buffer.length << 1); + if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) > newlen) { + throw { + RE_EXN_ID: "Failure", + _1: "Lexing.lex_refill: cannot grow buffer", + Error: new Error() + }; } - var s = param.lex_start_pos; - param.lex_abs_pos = param.lex_abs_pos + s | 0; - param.lex_curr_pos = param.lex_curr_pos - s | 0; - param.lex_start_pos = 0; - param.lex_last_pos = param.lex_last_pos - s | 0; - param.lex_buffer_len = param.lex_buffer_len - s | 0; - var t = param.lex_mem; - for(var i = 0 ,i_finish = t.length; i < i_finish; ++i){ - var v = Caml_array.get(t, i); - if (v >= 0) { - Caml_array.set(t, i, v - s | 0); - } - + var newbuf = Caml_bytes.create(newlen); + Bytes.blit(param.lex_buffer, param.lex_start_pos, newbuf, 0, param.lex_buffer_len - param.lex_start_pos | 0); + param.lex_buffer = newbuf; + } + var s = param.lex_start_pos; + param.lex_abs_pos = param.lex_abs_pos + s | 0; + param.lex_curr_pos = param.lex_curr_pos - s | 0; + param.lex_start_pos = 0; + param.lex_last_pos = param.lex_last_pos - s | 0; + param.lex_buffer_len = param.lex_buffer_len - s | 0; + var t = param.lex_mem; + for(var i = 0 ,i_finish = t.length; i < i_finish; ++i){ + var v = Caml_array.get(t, i); + if (v >= 0) { + Caml_array.set(t, i, v - s | 0); } + } - Bytes.blit(partial_arg, 0, param.lex_buffer, param.lex_buffer_len, n); - param.lex_buffer_len = param.lex_buffer_len + n | 0; - }), + } + Bytes.blit(partial_arg, 0, param.lex_buffer, param.lex_buffer_len, n); + param.lex_buffer_len = param.lex_buffer_len + n | 0; + }), lex_buffer: Caml_bytes.create(1024), lex_buffer_len: 0, lex_abs_pos: 0, @@ -100,8 +100,8 @@ function from_function(f) { function from_string(s) { return { refill_buff: (function (lexbuf) { - lexbuf.lex_eof_reached = true; - }), + lexbuf.lex_eof_reached = true; + }), lex_buffer: Bytes.of_string(s), lex_buffer_len: s.length, lex_abs_pos: 0, diff --git a/lib/es6/moreLabels.js b/lib/es6/moreLabels.js index 05af6cd5cc..014883343f 100644 --- a/lib/es6/moreLabels.js +++ b/lib/es6/moreLabels.js @@ -34,16 +34,65 @@ var Hashtbl = { var $$Map = { Make: (function (funarg) { - var height = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return param.h; + var height = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return param.h; + } + }; + var create = function (l, x, d, r) { + var hl = height(l); + var hr = height(r); + return { + TAG: "Node", + l: l, + v: x, + d: d, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + }; + var singleton = function (x, d) { + return { + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }; + }; + var bal = function (l, x, d, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + if (hl > (hr + 2 | 0)) { + if (typeof l !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); + var lr = l.r; + var ld = l.d; + var lv = l.v; + var ll = l.l; + if (height(ll) >= height(lr)) { + return create(ll, lv, ld, create(lr, x, d, r)); + } + if (typeof lr === "object") { + return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + } + if (hr <= (hl + 2 | 0)) { return { TAG: "Node", l: l, @@ -52,1044 +101,964 @@ var $$Map = { r: r, h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; - }; - var singleton = function (x, d) { + } + if (typeof r !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + } + var rr = r.r; + var rd = r.d; + var rv = r.v; + var rl = r.l; + if (height(rr) >= height(rl)) { + return create(create(l, x, d, rl), rv, rd, rr); + } + if (typeof rl === "object") { + return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + }; + var is_empty = function (param) { + if (typeof param !== "object") { + return true; + } else { + return false; + } + }; + var add = function (x, data, param) { + if (typeof param !== "object") { return { TAG: "Node", l: "Empty", v: x, - d: d, + d: data, r: "Empty", h: 1 }; - }; - var bal = function (l, x, d, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - if (hl > (hr + 2 | 0)) { - if (typeof l !== "object") { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; - } - var lr = l.r; - var ld = l.d; - var lv = l.v; - var ll = l.l; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } - if (typeof lr === "object") { - return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); - } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; - } - if (hr <= (hl + 2 | 0)) { + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + if (d === data) { + return param; + } else { return { TAG: "Node", l: l, v: x, - d: d, + d: data, r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + h: param.h }; } - if (typeof r !== "object") { + } + if (c < 0) { + var ll = add(x, data, l); + if (l === ll) { + return param; + } else { + return bal(ll, v, d, r); + } + } + var rr = add(x, data, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var find = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", + RE_EXN_ID: "Not_found", Error: new Error() }; } - var rr = r.r; - var rd = r.d; - var rv = r.v; - var rl = r.l; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } - if (typeof rl === "object") { - return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return param.d; } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; + _param = c < 0 ? param.l : param.r; + continue ; }; - var is_empty = function (param) { + }; + var find_first_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; if (typeof param !== "object") { - return true; - } else { - return false; + return [ + v0, + d0 + ]; } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.l; + _d0 = param.d; + _v0 = v; + continue ; + } + _param = param.r; + continue ; }; - var add = function (x, data, param) { + }; + var find_first = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return { - TAG: "Node", - l: "Empty", - v: x, - d: data, - r: "Empty", - h: 1 + throw { + RE_EXN_ID: "Not_found", + Error: new Error() }; } - var r = param.r; - var d = param.d; var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - if (d === data) { - return param; - } else { - return { - TAG: "Node", - l: l, - v: x, - d: data, - r: r, - h: param.h - }; - } - } - if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } - } - var rr = add(x, data, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + if (Curry._1(f, v)) { + return find_first_aux(v, param.d, f, param.l); + } + _param = param.r; + continue ; + }; + }; + var find_first_opt_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; } - }; - var find = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return param.d; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var find_first_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; - }; - var find_first = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_aux(v, param.d, f, param.l); - } - _param = param.r; - continue ; - }; - }; - var find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; - }; - var find_first_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_opt_aux(v, param.d, f, param.l); - } - _param = param.r; - continue ; - }; - }; - var find_last_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_aux(v, param.d, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_opt_aux(v, param.d, f, param.r); - } + var v = param.v; + if (Curry._1(f, v)) { _param = param.l; + _d0 = param.d; + _v0 = v; continue ; - }; - }; - var find_opt = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return Caml_option.some(param.d); - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var mem = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return true; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var l = param.l; - if (typeof l !== "object") { - return [ - param.v, - param.d - ]; - } - _param = l; - continue ; - }; - }; - var min_binding_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var l = param.l; - if (typeof l !== "object") { - return [ - param.v, - param.d - ]; - } - _param = l; - continue ; - }; - }; - var max_binding = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var r = param.r; - if (typeof r !== "object") { - return [ - param.v, - param.d - ]; - } - _param = r; - continue ; - }; + } + _param = param.r; + continue ; }; - var max_binding_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var r = param.r; - if (typeof r !== "object") { - return [ - param.v, - param.d - ]; - } - _param = r; + }; + var find_first_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_opt_aux(v, param.d, f, param.l); + } + _param = param.r; + continue ; + }; + }; + var find_last_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.r; + _d0 = param.d; + _v0 = v; continue ; - }; + } + _param = param.l; + continue ; }; - var remove_min_binding = function (param) { + }; + var find_last = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt", + RE_EXN_ID: "Not_found", Error: new Error() }; } - var l = param.l; - if (typeof l !== "object") { - return param.r; - } else { - return bal(remove_min_binding(l), param.v, param.d, param.r); + var v = param.v; + if (Curry._1(f, v)) { + return find_last_aux(v, param.d, f, param.r); + } + _param = param.l; + continue ; + }; + }; + var find_last_opt_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.r; + _d0 = param.d; + _v0 = v; + continue ; } + _param = param.l; + continue ; }; - var merge = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; + }; + var find_last_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - if (typeof t2 !== "object") { - return t1; + var v = param.v; + if (Curry._1(f, v)) { + return find_last_opt_aux(v, param.d, f, param.r); } - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); + _param = param.l; + continue ; }; - var remove = function (x, param) { + }; + var find_opt = function (x, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); + var c = Curry._2(funarg.compare, x, param.v); if (c === 0) { - return merge(l, r); + return Caml_option.some(param.d); } - if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var mem = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return false; } - var rr = remove(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return true; } + _param = c < 0 ? param.l : param.r; + continue ; }; - var update = function (x, f, param) { + }; + var min_binding = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - var data = Curry._1(f, undefined); - if (data !== undefined) { - return { - TAG: "Node", - l: "Empty", - v: x, - d: Caml_option.valFromOption(data), - r: "Empty", - h: 1 - }; - } else { - return "Empty"; - } + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } - var r = param.r; - var d = param.d; - var v = param.v; var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - var data$1 = Curry._1(f, Caml_option.some(d)); - if (data$1 === undefined) { - return merge(l, r); - } - var data$2 = Caml_option.valFromOption(data$1); - if (d === data$2) { - return param; - } else { - return { - TAG: "Node", - l: l, - v: x, - d: data$2, - r: r, - h: param.h - }; - } + if (typeof l !== "object") { + return [ + param.v, + param.d + ]; } - if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } + _param = l; + continue ; + }; + }; + var min_binding_opt = function (_param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - var rr = update(x, f, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + var l = param.l; + if (typeof l !== "object") { + return [ + param.v, + param.d + ]; } + _param = l; + continue ; }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - iter(f, param.l); - Curry._2(f, param.v, param.d); - _param = param.r; - continue ; - }; - }; - var map = function (f, param) { + }; + var max_binding = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } - var l$p = map(f, param.l); - var d$p = Curry._1(f, param.d); - var r$p = map(f, param.r); - return { - TAG: "Node", - l: l$p, - v: param.v, - d: d$p, - r: r$p, - h: param.h - }; + var r = param.r; + if (typeof r !== "object") { + return [ + param.v, + param.d + ]; + } + _param = r; + continue ; }; - var mapi = function (f, param) { + }; + var max_binding_opt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var v = param.v; - var l$p = mapi(f, param.l); - var d$p = Curry._2(f, v, param.d); - var r$p = mapi(f, param.r); - return { - TAG: "Node", - l: l$p, - v: v, - d: d$p, - r: r$p, - h: param.h - }; - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (typeof m !== "object") { - return accu; - } - _accu = Curry._3(f, m.v, m.d, fold(f, m.l, accu)); - _m = m.r; - continue ; - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return true; - } - if (!Curry._2(p, param.v, param.d)) { - return false; - } - if (!for_all(p, param.l)) { - return false; - } - _param = param.r; - continue ; - }; + var r = param.r; + if (typeof r !== "object") { + return [ + param.v, + param.d + ]; + } + _param = r; + continue ; }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - if (Curry._2(p, param.v, param.d)) { - return true; - } - if (exists(p, param.l)) { - return true; - } - _param = param.r; - continue ; + }; + var remove_min_binding = function (param) { + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt", + Error: new Error() }; - }; - var add_min_binding = function (k, x, param) { - if (typeof param !== "object") { - return singleton(k, x); + } + var l = param.l; + if (typeof l !== "object") { + return param.r; + } else { + return bal(remove_min_binding(l), param.v, param.d, param.r); + } + }; + var merge = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } + if (typeof t2 !== "object") { + return t1; + } + var match = min_binding(t2); + return bal(t1, match[0], match[1], remove_min_binding(t2)); + }; + var remove = function (x, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return merge(l, r); + } + if (c < 0) { + var ll = remove(x, l); + if (l === ll) { + return param; } else { - return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); - } - }; - var add_max_binding = function (k, x, param) { - if (typeof param !== "object") { - return singleton(k, x); + return bal(ll, v, d, r); + } + } + var rr = remove(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var update = function (x, f, param) { + if (typeof param !== "object") { + var data = Curry._1(f, undefined); + if (data !== undefined) { + return { + TAG: "Node", + l: "Empty", + v: x, + d: Caml_option.valFromOption(data), + r: "Empty", + h: 1 + }; } else { - return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); - } - }; - var join = function (l, v, d, r) { - if (typeof l !== "object") { - return add_min_binding(v, d, r); + return "Empty"; } - var lh = l.h; - if (typeof r !== "object") { - return add_max_binding(v, d, l); + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + var data$1 = Curry._1(f, Caml_option.some(d)); + if (data$1 === undefined) { + return merge(l, r); } - var rh = r.h; - if (lh > (rh + 2 | 0)) { - return bal(l.l, l.v, l.d, join(l.r, v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r.l), r.v, r.d, r.r); + var data$2 = Caml_option.valFromOption(data$1); + if (d === data$2) { + return param; } else { - return create(l, v, d, r); + return { + TAG: "Node", + l: l, + v: x, + d: data$2, + r: r, + h: param.h + }; } - }; - var concat = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; + } + if (c < 0) { + var ll = update(x, f, l); + if (l === ll) { + return param; + } else { + return bal(ll, v, d, r); + } + } + var rr = update(x, f, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var iter = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + iter(f, param.l); + Curry._2(f, param.v, param.d); + _param = param.r; + continue ; + }; + }; + var map = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var l$p = map(f, param.l); + var d$p = Curry._1(f, param.d); + var r$p = map(f, param.r); + return { + TAG: "Node", + l: l$p, + v: param.v, + d: d$p, + r: r$p, + h: param.h + }; + }; + var mapi = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var v = param.v; + var l$p = mapi(f, param.l); + var d$p = Curry._2(f, v, param.d); + var r$p = mapi(f, param.r); + return { + TAG: "Node", + l: l$p, + v: v, + d: d$p, + r: r$p, + h: param.h + }; + }; + var fold = function (f, _m, _accu) { + while(true) { + var accu = _accu; + var m = _m; + if (typeof m !== "object") { + return accu; + } + _accu = Curry._3(f, m.v, m.d, fold(f, m.l, accu)); + _m = m.r; + continue ; + }; + }; + var for_all = function (p, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return true; } - if (typeof t2 !== "object") { - return t1; + if (!Curry._2(p, param.v, param.d)) { + return false; } - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); + if (!for_all(p, param.l)) { + return false; } + _param = param.r; + continue ; }; - var split = function (x, param) { + }; + var exists = function (p, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - undefined, - "Empty" - ]; + return false; } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return [ - l, - Caml_option.some(d), - r - ]; + if (Curry._2(p, param.v, param.d)) { + return true; } - if (c < 0) { - var match = split(x, l); - return [ - match[0], - match[1], - join(match[2], v, d, r) - ]; + if (exists(p, param.l)) { + return true; } - var match$1 = split(x, r); + _param = param.r; + continue ; + }; + }; + var add_min_binding = function (k, x, param) { + if (typeof param !== "object") { + return singleton(k, x); + } else { + return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); + } + }; + var add_max_binding = function (k, x, param) { + if (typeof param !== "object") { + return singleton(k, x); + } else { + return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); + } + }; + var join = function (l, v, d, r) { + if (typeof l !== "object") { + return add_min_binding(v, d, r); + } + var lh = l.h; + if (typeof r !== "object") { + return add_max_binding(v, d, l); + } + var rh = r.h; + if (lh > (rh + 2 | 0)) { + return bal(l.l, l.v, l.d, join(l.r, v, d, r)); + } else if (rh > (lh + 2 | 0)) { + return bal(join(l, v, d, r.l), r.v, r.d, r.r); + } else { + return create(l, v, d, r); + } + }; + var concat = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } + if (typeof t2 !== "object") { + return t1; + } + var match = min_binding(t2); + return join(t1, match[0], match[1], remove_min_binding(t2)); + }; + var concat_or_join = function (t1, v, d, t2) { + if (d !== undefined) { + return join(t1, v, Caml_option.valFromOption(d), t2); + } else { + return concat(t1, t2); + } + }; + var split = function (x, param) { + if (typeof param !== "object") { return [ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] + "Empty", + undefined, + "Empty" ]; - }; - var merge$1 = function (f, s1, s2) { - if (typeof s1 !== "object") { - if (typeof s2 !== "object") { - return "Empty"; - } - - } else { - var v1 = s1.v; - if (s1.h >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1.l, match[0]), v1, Curry._3(f, v1, Caml_option.some(s1.d), match[1]), merge$1(f, s1.r, match[2])); - } - - } + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return [ + l, + Caml_option.some(d), + r + ]; + } + if (c < 0) { + var match = split(x, l); + return [ + match[0], + match[1], + join(match[2], v, d, r) + ]; + } + var match$1 = split(x, r); + return [ + join(l, v, d, match$1[0]), + match$1[1], + match$1[2] + ]; + }; + var merge$1 = function (f, s1, s2) { + if (typeof s1 !== "object") { if (typeof s2 !== "object") { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ], - Error: new Error() - }; - } - var v2 = s2.v; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2.l), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); - }; - var union = function (f, s1, s2) { - if (typeof s1 !== "object") { - return s2; + return "Empty"; } - var d1 = s1.d; + + } else { var v1 = s1.v; - if (typeof s2 !== "object") { - return s1; - } - var d2 = s2.d; - var v2 = s2.v; - if (s1.h >= s2.h) { + if (s1.h >= height(s2)) { var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1.l, match[0]); - var r = union(f, s1.r, match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } + return concat_or_join(merge$1(f, s1.l, match[0]), v1, Curry._3(f, v1, Caml_option.some(s1.d), match[1]), merge$1(f, s1.r, match[2])); } - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2.l); - var r$1 = union(f, match$1[2], s2.r); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); + + } + if (typeof s2 !== "object") { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ], + Error: new Error() + }; + } + var v2 = s2.v; + var match$1 = split(v2, s1); + return concat_or_join(merge$1(f, match$1[0], s2.l), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); + }; + var union = function (f, s1, s2) { + if (typeof s1 !== "object") { + return s2; + } + var d1 = s1.d; + var v1 = s1.v; + if (typeof s2 !== "object") { + return s1; + } + var d2 = s2.d; + var v2 = s2.v; + if (s1.h >= s2.h) { + var match = split(v1, s2); + var d2$1 = match[1]; + var l = union(f, s1.l, match[0]); + var r = union(f, s1.r, match[2]); + if (d2$1 !== undefined) { + return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); } else { - return join(l$1, v2, d2, r$1); - } - }; - var filter = function (p, param) { - if (typeof param !== "object") { - return "Empty"; - } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var l$p = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$p = filter(p, r); - if (pvd) { - if (l === l$p && r === r$p) { - return param; + return join(l, v1, d1, r); + } + } + var match$1 = split(v2, s1); + var d1$1 = match$1[1]; + var l$1 = union(f, match$1[0], s2.l); + var r$1 = union(f, match$1[2], s2.r); + if (d1$1 !== undefined) { + return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); + } else { + return join(l$1, v2, d2, r$1); + } + }; + var filter = function (p, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var l$p = filter(p, l); + var pvd = Curry._2(p, v, d); + var r$p = filter(p, r); + if (pvd) { + if (l === l$p && r === r$p) { + return param; + } else { + return join(l$p, v, d, r$p); + } + } else { + return concat(l$p, r$p); + } + }; + var partition = function (p, param) { + if (typeof param !== "object") { + return [ + "Empty", + "Empty" + ]; + } + var d = param.d; + var v = param.v; + var match = partition(p, param.l); + var lf = match[1]; + var lt = match[0]; + var pvd = Curry._2(p, v, d); + var match$1 = partition(p, param.r); + var rf = match$1[1]; + var rt = match$1[0]; + if (pvd) { + return [ + join(lt, v, d, rt), + concat(lf, rf) + ]; + } else { + return [ + concat(lt, rt), + join(lf, v, d, rf) + ]; + } + }; + var cons_enum = function (_m, _e) { + while(true) { + var e = _e; + var m = _m; + if (typeof m !== "object") { + return e; + } + _e = { + TAG: "More", + _0: m.v, + _1: m.d, + _2: m.r, + _3: e + }; + _m = m.l; + continue ; + }; + }; + var compare = function (cmp, m1, m2) { + var _e1 = cons_enum(m1, "End"); + var _e2 = cons_enum(m2, "End"); + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { + if (typeof e2 !== "object") { + return 0; } else { - return join(l$p, v, d, r$p); + return -1; } - } else { - return concat(l$p, r$p); } - }; - var partition = function (p, param) { - if (typeof param !== "object") { - return [ - "Empty", - "Empty" - ]; + if (typeof e2 !== "object") { + return 1; } - var d = param.d; - var v = param.v; - var match = partition(p, param.l); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param.r); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return [ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return [ - concat(lt, rt), - join(lf, v, d, rf) - ]; + var c = Curry._2(funarg.compare, e1._0, e2._0); + if (c !== 0) { + return c; } + var c$1 = Curry._2(cmp, e1._1, e2._1); + if (c$1 !== 0) { + return c$1; + } + _e2 = cons_enum(e2._2, e2._3); + _e1 = cons_enum(e1._2, e1._3); + continue ; }; - var cons_enum = function (_m, _e) { - while(true) { - var e = _e; - var m = _m; - if (typeof m !== "object") { - return e; - } - _e = { - TAG: "More", - _0: m.v, - _1: m.d, - _2: m.r, - _3: e - }; - _m = m.l; - continue ; - }; - }; - var compare = function (cmp, m1, m2) { - var _e1 = cons_enum(m1, "End"); - var _e2 = cons_enum(m2, "End"); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return 0; - } else { - return -1; - } - } - if (typeof e2 !== "object") { - return 1; - } - var c = Curry._2(funarg.compare, e1._0, e2._0); - if (c !== 0) { - return c; - } - var c$1 = Curry._2(cmp, e1._1, e2._1); - if (c$1 !== 0) { - return c$1; - } - _e2 = cons_enum(e2._2, e2._3); - _e1 = cons_enum(e1._2, e1._3); - continue ; - }; - }; - var equal = function (cmp, m1, m2) { - var _e1 = cons_enum(m1, "End"); - var _e2 = cons_enum(m2, "End"); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return true; - } else { - return false; - } - } + }; + var equal = function (cmp, m1, m2) { + var _e1 = cons_enum(m1, "End"); + var _e2 = cons_enum(m2, "End"); + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { if (typeof e2 !== "object") { + return true; + } else { return false; } - if (Curry._2(funarg.compare, e1._0, e2._0) !== 0) { - return false; - } - if (!Curry._2(cmp, e1._1, e2._1)) { - return false; - } - _e2 = cons_enum(e2._2, e2._3); - _e1 = cons_enum(e1._2, e1._3); - continue ; - }; - }; - var cardinal = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (typeof param !== "object") { - return accu; - } - _param = param.l; - _accu = { - hd: [ - param.v, - param.d - ], - tl: bindings_aux(accu, param.r) - }; - continue ; + if (typeof e2 !== "object") { + return false; + } + if (Curry._2(funarg.compare, e1._0, e2._0) !== 0) { + return false; + } + if (!Curry._2(cmp, e1._1, e2._1)) { + return false; + } + _e2 = cons_enum(e2._2, e2._3); + _e1 = cons_enum(e1._2, e1._3); + continue ; + }; + }; + var cardinal = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + } + }; + var bindings_aux = function (_accu, _param) { + while(true) { + var param = _param; + var accu = _accu; + if (typeof param !== "object") { + return accu; + } + _param = param.l; + _accu = { + hd: [ + param.v, + param.d + ], + tl: bindings_aux(accu, param.r) }; - }; - var bindings = function (s) { - return bindings_aux(/* [] */0, s); - }; - return { - empty: "Empty", - is_empty: is_empty, - mem: mem, - add: add, - update: update, - singleton: singleton, - remove: remove, - merge: merge$1, - union: union, - compare: compare, - equal: equal, - iter: iter, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - bindings: bindings, - min_binding: min_binding, - min_binding_opt: min_binding_opt, - max_binding: max_binding, - max_binding_opt: max_binding_opt, - choose: min_binding, - choose_opt: min_binding_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - map: map, - mapi: mapi - }; - }) + continue ; + }; + }; + var bindings = function (s) { + return bindings_aux(/* [] */0, s); + }; + return { + empty: "Empty", + is_empty: is_empty, + mem: mem, + add: add, + update: update, + singleton: singleton, + remove: remove, + merge: merge$1, + union: union, + compare: compare, + equal: equal, + iter: iter, + fold: fold, + for_all: for_all, + exists: exists, + filter: filter, + partition: partition, + cardinal: cardinal, + bindings: bindings, + min_binding: min_binding, + min_binding_opt: min_binding_opt, + max_binding: max_binding, + max_binding_opt: max_binding_opt, + choose: min_binding, + choose_opt: min_binding_opt, + split: split, + find: find, + find_opt: find_opt, + find_first: find_first, + find_first_opt: find_first_opt, + find_last: find_last, + find_last_opt: find_last_opt, + map: map, + mapi: mapi + }; + }) }; var $$Set = { Make: (function (funarg) { - var height = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return param.h; - } - }; - var create = function (l, v, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - return { - TAG: "Node", - l: l, - v: v, - r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - }; - }; - var bal = function (l, v, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - if (hl > (hr + 2 | 0)) { - if (typeof l !== "object") { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal", - Error: new Error() - }; - } - var lr = l.r; - var lv = l.v; - var ll = l.l; - if (height(ll) >= height(lr)) { - return create(ll, lv, create(lr, v, r)); - } - if (typeof lr === "object") { - return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); - } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal", - Error: new Error() - }; - } - if (hr <= (hl + 2 | 0)) { - return { - TAG: "Node", - l: l, - v: v, - r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - }; - } - if (typeof r !== "object") { + var height = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return param.h; + } + }; + var create = function (l, v, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + return { + TAG: "Node", + l: l, + v: v, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + }; + var bal = function (l, v, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + if (hl > (hr + 2 | 0)) { + if (typeof l !== "object") { throw { RE_EXN_ID: "Invalid_argument", _1: "Set.bal", Error: new Error() }; } - var rr = r.r; - var rv = r.v; - var rl = r.l; - if (height(rr) >= height(rl)) { - return create(create(l, v, rl), rv, rr); + var lr = l.r; + var lv = l.v; + var ll = l.l; + if (height(ll) >= height(lr)) { + return create(ll, lv, create(lr, v, r)); } - if (typeof rl === "object") { - return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); + if (typeof lr === "object") { + return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw { RE_EXN_ID: "Invalid_argument", _1: "Set.bal", Error: new Error() }; - }; - var add = function (x, param) { - if (typeof param !== "object") { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - } - var r = param.r; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return param; - } - if (c < 0) { - var ll = add(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, r); - } - } - var rr = add(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, rr); - } - }; - var singleton = function (x) { + } + if (hr <= (hl + 2 | 0)) { + return { + TAG: "Node", + l: l, + v: v, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + } + if (typeof r !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal", + Error: new Error() + }; + } + var rr = r.r; + var rv = r.v; + var rl = r.l; + if (height(rr) >= height(rl)) { + return create(create(l, v, rl), rv, rr); + } + if (typeof rl === "object") { + return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal", + Error: new Error() + }; + }; + var add = function (x, param) { + if (typeof param !== "object") { return { TAG: "Node", l: "Empty", @@ -1097,710 +1066,767 @@ var $$Set = { r: "Empty", h: 1 }; - }; - var add_min_element = function (x, param) { - if (typeof param !== "object") { - return singleton(x); - } else { - return bal(add_min_element(x, param.l), param.v, param.r); - } - }; - var add_max_element = function (x, param) { - if (typeof param !== "object") { - return singleton(x); - } else { - return bal(param.l, param.v, add_max_element(x, param.r)); - } - }; - var join = function (l, v, r) { - if (typeof l !== "object") { - return add_min_element(v, r); - } - var lh = l.h; - if (typeof r !== "object") { - return add_max_element(v, l); - } - var rh = r.h; - if (lh > (rh + 2 | 0)) { - return bal(l.l, l.v, join(l.r, v, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, r.l), r.v, r.r); + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return param; + } + if (c < 0) { + var ll = add(x, l); + if (l === ll) { + return param; } else { - return create(l, v, r); - } - }; - var min_elt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var l = param.l; - if (typeof l !== "object") { - return param.v; - } - _param = l; - continue ; - }; - }; - var min_elt_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var l = param.l; - if (typeof l !== "object") { - return Caml_option.some(param.v); - } - _param = l; - continue ; - }; - }; - var max_elt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var r = param.r; - if (typeof r !== "object") { - return param.v; - } - _param = r; - continue ; - }; - }; - var max_elt_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var r = param.r; - if (typeof r !== "object") { - return Caml_option.some(param.v); - } - _param = r; - continue ; - }; - }; - var remove_min_elt = function (param) { + return bal(ll, v, r); + } + } + var rr = add(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, rr); + } + }; + var singleton = function (x) { + return { + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }; + }; + var add_min_element = function (x, param) { + if (typeof param !== "object") { + return singleton(x); + } else { + return bal(add_min_element(x, param.l), param.v, param.r); + } + }; + var add_max_element = function (x, param) { + if (typeof param !== "object") { + return singleton(x); + } else { + return bal(param.l, param.v, add_max_element(x, param.r)); + } + }; + var join = function (l, v, r) { + if (typeof l !== "object") { + return add_min_element(v, r); + } + var lh = l.h; + if (typeof r !== "object") { + return add_max_element(v, l); + } + var rh = r.h; + if (lh > (rh + 2 | 0)) { + return bal(l.l, l.v, join(l.r, v, r)); + } else if (rh > (lh + 2 | 0)) { + return bal(join(l, v, r.l), r.v, r.r); + } else { + return create(l, v, r); + } + }; + var min_elt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt", + RE_EXN_ID: "Not_found", Error: new Error() }; } var l = param.l; if (typeof l !== "object") { - return param.r; - } else { - return bal(remove_min_elt(l), param.v, param.r); - } - }; - var merge = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; - } else if (typeof t2 !== "object") { - return t1; - } else { - return bal(t1, min_elt(t2), remove_min_elt(t2)); - } - }; - var concat = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; - } else if (typeof t2 !== "object") { - return t1; - } else { - return join(t1, min_elt(t2), remove_min_elt(t2)); + return param.v; } + _param = l; + continue ; }; - var split = function (x, param) { + }; + var min_elt_opt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - false, - "Empty" - ]; + return; } - var r = param.r; - var v = param.v; var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return [ - l, - true, - r - ]; - } - if (c < 0) { - var match = split(x, l); - return [ - match[0], - match[1], - join(match[2], v, r) - ]; + if (typeof l !== "object") { + return Caml_option.some(param.v); } - var match$1 = split(x, r); - return [ - join(l, v, match$1[0]), - match$1[1], - match$1[2] - ]; + _param = l; + continue ; }; - var is_empty = function (param) { + }; + var max_elt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return true; - } else { - return false; - } - }; - var mem = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return true; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var remove = function (x, param) { - if (typeof param !== "object") { - return "Empty"; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } var r = param.r; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return merge(l, r); - } - if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, r); - } - } - var rr = remove(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, rr); + if (typeof r !== "object") { + return param.v; } + _param = r; + continue ; }; - var union = function (s1, s2) { - if (typeof s1 !== "object") { - return s2; - } - var h1 = s1.h; - var v1 = s1.v; - if (typeof s2 !== "object") { - return s1; - } - var h2 = s2.h; - var v2 = s2.v; - if (h1 >= h2) { - if (h2 === 1) { - return add(v2, s1); - } - var match = split(v1, s2); - return join(union(s1.l, match[0]), v1, union(s1.r, match[2])); + }; + var max_elt_opt = function (_param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - if (h1 === 1) { - return add(v1, s2); + var r = param.r; + if (typeof r !== "object") { + return Caml_option.some(param.v); } - var match$1 = split(v2, s1); - return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); + _param = r; + continue ; }; - var inter = function (s1, s2) { - if (typeof s1 !== "object") { - return "Empty"; + }; + var remove_min_elt = function (param) { + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt", + Error: new Error() + }; + } + var l = param.l; + if (typeof l !== "object") { + return param.r; + } else { + return bal(remove_min_elt(l), param.v, param.r); + } + }; + var merge = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } else if (typeof t2 !== "object") { + return t1; + } else { + return bal(t1, min_elt(t2), remove_min_elt(t2)); + } + }; + var concat = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } else if (typeof t2 !== "object") { + return t1; + } else { + return join(t1, min_elt(t2), remove_min_elt(t2)); + } + }; + var split = function (x, param) { + if (typeof param !== "object") { + return [ + "Empty", + false, + "Empty" + ]; + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return [ + l, + true, + r + ]; + } + if (c < 0) { + var match = split(x, l); + return [ + match[0], + match[1], + join(match[2], v, r) + ]; + } + var match$1 = split(x, r); + return [ + join(l, v, match$1[0]), + match$1[1], + match$1[2] + ]; + }; + var is_empty = function (param) { + if (typeof param !== "object") { + return true; + } else { + return false; + } + }; + var mem = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return false; } - if (typeof s2 !== "object") { - return "Empty"; + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return true; } - var r1 = s1.r; - var v1 = s1.v; - var l1 = s1.l; - var match = split(v1, s2); - var l2 = match[0]; - if (match[1]) { - return join(inter(l1, l2), v1, inter(r1, match[2])); + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var remove = function (x, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return merge(l, r); + } + if (c < 0) { + var ll = remove(x, l); + if (l === ll) { + return param; } else { - return concat(inter(l1, l2), inter(r1, match[2])); + return bal(ll, v, r); + } + } + var rr = remove(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, rr); + } + }; + var union = function (s1, s2) { + if (typeof s1 !== "object") { + return s2; + } + var h1 = s1.h; + var v1 = s1.v; + if (typeof s2 !== "object") { + return s1; + } + var h2 = s2.h; + var v2 = s2.v; + if (h1 >= h2) { + if (h2 === 1) { + return add(v2, s1); } - }; - var diff = function (s1, s2) { + var match = split(v1, s2); + return join(union(s1.l, match[0]), v1, union(s1.r, match[2])); + } + if (h1 === 1) { + return add(v1, s2); + } + var match$1 = split(v2, s1); + return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); + }; + var inter = function (s1, s2) { + if (typeof s1 !== "object") { + return "Empty"; + } + if (typeof s2 !== "object") { + return "Empty"; + } + var r1 = s1.r; + var v1 = s1.v; + var l1 = s1.l; + var match = split(v1, s2); + var l2 = match[0]; + if (match[1]) { + return join(inter(l1, l2), v1, inter(r1, match[2])); + } else { + return concat(inter(l1, l2), inter(r1, match[2])); + } + }; + var diff = function (s1, s2) { + if (typeof s1 !== "object") { + return "Empty"; + } + if (typeof s2 !== "object") { + return s1; + } + var r1 = s1.r; + var v1 = s1.v; + var l1 = s1.l; + var match = split(v1, s2); + var l2 = match[0]; + if (match[1]) { + return concat(diff(l1, l2), diff(r1, match[2])); + } else { + return join(diff(l1, l2), v1, diff(r1, match[2])); + } + }; + var cons_enum = function (_s, _e) { + while(true) { + var e = _e; + var s = _s; + if (typeof s !== "object") { + return e; + } + _e = { + TAG: "More", + _0: s.v, + _1: s.r, + _2: e + }; + _s = s.l; + continue ; + }; + }; + var compare_aux = function (_e1, _e2) { + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { + if (typeof e2 !== "object") { + return 0; + } else { + return -1; + } + } + if (typeof e2 !== "object") { + return 1; + } + var c = Curry._2(funarg.compare, e1._0, e2._0); + if (c !== 0) { + return c; + } + _e2 = cons_enum(e2._1, e2._2); + _e1 = cons_enum(e1._1, e1._2); + continue ; + }; + }; + var compare = function (s1, s2) { + return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + }; + var equal = function (s1, s2) { + return compare(s1, s2) === 0; + }; + var subset = function (_s1, _s2) { + while(true) { + var s2 = _s2; + var s1 = _s1; if (typeof s1 !== "object") { - return "Empty"; - } - if (typeof s2 !== "object") { - return s1; + return true; } var r1 = s1.r; var v1 = s1.v; var l1 = s1.l; - var match = split(v1, s2); - var l2 = match[0]; - if (match[1]) { - return concat(diff(l1, l2), diff(r1, match[2])); - } else { - return join(diff(l1, l2), v1, diff(r1, match[2])); + if (typeof s2 !== "object") { + return false; } - }; - var cons_enum = function (_s, _e) { - while(true) { - var e = _e; - var s = _s; - if (typeof s !== "object") { - return e; - } - _e = { - TAG: "More", - _0: s.v, - _1: s.r, - _2: e - }; - _s = s.l; - continue ; - }; - }; - var compare_aux = function (_e1, _e2) { - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return 0; - } else { - return -1; - } - } - if (typeof e2 !== "object") { - return 1; - } - var c = Curry._2(funarg.compare, e1._0, e2._0); - if (c !== 0) { - return c; - } - _e2 = cons_enum(e2._1, e2._2); - _e1 = cons_enum(e1._1, e1._2); - continue ; - }; - }; - var compare = function (s1, s2) { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - var equal = function (s1, s2) { - return compare(s1, s2) === 0; - }; - var subset = function (_s1, _s2) { - while(true) { - var s2 = _s2; - var s1 = _s1; - if (typeof s1 !== "object") { - return true; - } - var r1 = s1.r; - var v1 = s1.v; - var l1 = s1.l; - if (typeof s2 !== "object") { - return false; - } - var r2 = s2.r; - var l2 = s2.l; - var c = Curry._2(funarg.compare, v1, s2.v); - if (c === 0) { - if (!subset(l1, l2)) { - return false; - } - _s2 = r2; - _s1 = r1; - continue ; - } - if (c < 0) { - if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { - return false; - } - _s1 = r1; - continue ; - } - if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + var r2 = s2.r; + var l2 = s2.l; + var c = Curry._2(funarg.compare, v1, s2.v); + if (c === 0) { + if (!subset(l1, l2)) { return false; } - _s1 = l1; + _s2 = r2; + _s1 = r1; continue ; - }; - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - iter(f, param.l); - Curry._1(f, param.v); - _param = param.r; - continue ; - }; - }; - var fold = function (f, _s, _accu) { - while(true) { - var accu = _accu; - var s = _s; - if (typeof s !== "object") { - return accu; - } - _accu = Curry._2(f, s.v, fold(f, s.l, accu)); - _s = s.r; - continue ; - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return true; - } - if (!Curry._1(p, param.v)) { - return false; - } - if (!for_all(p, param.l)) { + } + if (c < 0) { + if (!subset({ + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } - _param = param.r; + _s1 = r1; continue ; - }; + } + if (!subset({ + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { + return false; + } + _s1 = l1; + continue ; }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - if (Curry._1(p, param.v)) { - return true; - } - if (exists(p, param.l)) { - return true; - } - _param = param.r; - continue ; - }; + }; + var iter = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + iter(f, param.l); + Curry._1(f, param.v); + _param = param.r; + continue ; + }; + }; + var fold = function (f, _s, _accu) { + while(true) { + var accu = _accu; + var s = _s; + if (typeof s !== "object") { + return accu; + } + _accu = Curry._2(f, s.v, fold(f, s.l, accu)); + _s = s.r; + continue ; + }; + }; + var for_all = function (p, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return true; + } + if (!Curry._1(p, param.v)) { + return false; + } + if (!for_all(p, param.l)) { + return false; + } + _param = param.r; + continue ; }; - var filter = function (p, param) { + }; + var exists = function (p, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return false; } - var r = param.r; - var v = param.v; - var l = param.l; - var l$p = filter(p, l); - var pv = Curry._1(p, v); - var r$p = filter(p, r); - if (pv) { - if (l === l$p && r === r$p) { - return param; - } else { - return join(l$p, v, r$p); - } + if (Curry._1(p, param.v)) { + return true; + } + if (exists(p, param.l)) { + return true; + } + _param = param.r; + continue ; + }; + }; + var filter = function (p, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var l$p = filter(p, l); + var pv = Curry._1(p, v); + var r$p = filter(p, r); + if (pv) { + if (l === l$p && r === r$p) { + return param; } else { - return concat(l$p, r$p); + return join(l$p, v, r$p); + } + } else { + return concat(l$p, r$p); + } + }; + var partition = function (p, param) { + if (typeof param !== "object") { + return [ + "Empty", + "Empty" + ]; + } + var v = param.v; + var match = partition(p, param.l); + var lf = match[1]; + var lt = match[0]; + var pv = Curry._1(p, v); + var match$1 = partition(p, param.r); + var rf = match$1[1]; + var rt = match$1[0]; + if (pv) { + return [ + join(lt, v, rt), + concat(lf, rf) + ]; + } else { + return [ + concat(lt, rt), + join(lf, v, rf) + ]; + } + }; + var cardinal = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + } + }; + var elements_aux = function (_accu, _param) { + while(true) { + var param = _param; + var accu = _accu; + if (typeof param !== "object") { + return accu; } - }; - var partition = function (p, param) { + _param = param.l; + _accu = { + hd: param.v, + tl: elements_aux(accu, param.r) + }; + continue ; + }; + }; + var elements = function (s) { + return elements_aux(/* [] */0, s); + }; + var find = function (x, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - "Empty" - ]; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } var v = param.v; - var match = partition(p, param.l); - var lf = match[1]; - var lt = match[0]; - var pv = Curry._1(p, v); - var match$1 = partition(p, param.r); - var rf = match$1[1]; - var rt = match$1[0]; - if (pv) { - return [ - join(lt, v, rt), - concat(lf, rf) - ]; - } else { - return [ - concat(lt, rt), - join(lf, v, rf) - ]; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return v; } + _param = c < 0 ? param.l : param.r; + continue ; }; - var cardinal = function (param) { + }; + var find_first_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; if (typeof param !== "object") { - return 0; - } else { - return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + return v0; } - }; - var elements_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (typeof param !== "object") { - return accu; - } + var v = param.v; + if (Curry._1(f, v)) { _param = param.l; - _accu = { - hd: param.v, - tl: elements_aux(accu, param.r) - }; + _v0 = v; continue ; - }; + } + _param = param.r; + continue ; }; - var elements = function (s) { - return elements_aux(/* [] */0, s); + }; + var find_first = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_aux(v, f, param.l); + } + _param = param.r; + continue ; }; - var find = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return v; - } - _param = c < 0 ? param.l : param.r; + }; + var find_first_opt_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return Caml_option.some(v0); + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.l; + _v0 = v; continue ; - }; + } + _param = param.r; + continue ; }; - var find_first_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return v0; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; + }; + var find_first_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_opt_aux(v, f, param.l); + } + _param = param.r; + continue ; }; - var find_first = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_aux(v, f, param.l); - } + }; + var find_last_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return v0; + } + var v = param.v; + if (Curry._1(f, v)) { _param = param.r; + _v0 = v; continue ; - }; + } + _param = param.l; + continue ; }; - var find_first_opt_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return Caml_option.some(v0); - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; + }; + var find_last = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_last_aux(v, f, param.r); + } + _param = param.l; + continue ; }; - var find_first_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_opt_aux(v, f, param.l); - } + }; + var find_last_opt_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return Caml_option.some(v0); + } + var v = param.v; + if (Curry._1(f, v)) { _param = param.r; + _v0 = v; continue ; - }; - }; - var find_last_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return v0; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_aux(v, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_last_opt_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return Caml_option.some(v0); - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_opt_aux(v, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_opt = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return Caml_option.some(v); - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var try_join = function (l, v, r) { - if ((l === "Empty" || Curry._2(funarg.compare, max_elt(l), v) < 0) && (r === "Empty" || Curry._2(funarg.compare, v, min_elt(r)) < 0)) { - return join(l, v, r); - } else { - return union(l, add(v, r)); } + _param = param.l; + continue ; }; - var map = function (f, param) { + }; + var find_last_opt = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var r = param.r; var v = param.v; - var l = param.l; - var l$p = map(f, l); - var v$p = Curry._1(f, v); - var r$p = map(f, r); - if (l === l$p && v === v$p && r === r$p) { - return param; - } else { - return try_join(l$p, v$p, r$p); + if (Curry._1(f, v)) { + return find_last_opt_aux(v, f, param.r); } + _param = param.l; + continue ; }; - var of_sorted_list = function (l) { - var sub = function (n, l) { - switch (n) { - case 0 : + }; + var find_opt = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return Caml_option.some(v); + } + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var try_join = function (l, v, r) { + if ((l === "Empty" || Curry._2(funarg.compare, max_elt(l), v) < 0) && (r === "Empty" || Curry._2(funarg.compare, v, min_elt(r)) < 0)) { + return join(l, v, r); + } else { + return union(l, add(v, r)); + } + }; + var map = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var l$p = map(f, l); + var v$p = Curry._1(f, v); + var r$p = map(f, r); + if (l === l$p && v === v$p && r === r$p) { + return param; + } else { + return try_join(l$p, v$p, r$p); + } + }; + var of_sorted_list = function (l) { + var 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) { + var 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) { - var match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + var match$1 = l.tl; + if (match$1) { + var match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1811,144 +1837,118 @@ var $$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) { - var match$1 = l.tl; - if (match$1) { - var 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: - - } - var nl = n / 2 | 0; - var match$3 = sub(nl, l); - var l$1 = match$3[1]; - if (l$1) { - var match$4 = sub((n - nl | 0) - 1 | 0, l$1.tl); - return [ - create(match$3[0], l$1.hd, match$4[0]), - match$4[1] - ]; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ], - Error: new Error() - }; + + } + break; + default: + + } + var nl = n / 2 | 0; + var match$3 = sub(nl, l); + var l$1 = match$3[1]; + if (l$1) { + var match$4 = sub((n - nl | 0) - 1 | 0, l$1.tl); + return [ + create(match$3[0], l$1.hd, match$4[0]), + match$4[1] + ]; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ], + Error: new Error() }; - return sub(List.length(l), l)[0]; }; - var of_list = function (l) { - if (!l) { - return "Empty"; - } - var match = l.tl; - var x0 = l.hd; - if (!match) { - return singleton(x0); - } - var match$1 = match.tl; - var x1 = match.hd; - if (!match$1) { - return add(x1, singleton(x0)); - } - var match$2 = match$1.tl; - var x2 = match$1.hd; - if (!match$2) { - return add(x2, add(x1, singleton(x0))); - } - var match$3 = match$2.tl; - var x3 = match$2.hd; - if (match$3) { - if (match$3.tl) { - return of_sorted_list(List.sort_uniq(funarg.compare, l)); - } else { - return add(match$3.hd, add(x3, add(x2, add(x1, singleton(x0))))); - } + return sub(List.length(l), l)[0]; + }; + var of_list = function (l) { + if (!l) { + return "Empty"; + } + var match = l.tl; + var x0 = l.hd; + if (!match) { + return singleton(x0); + } + var match$1 = match.tl; + var x1 = match.hd; + if (!match$1) { + return add(x1, singleton(x0)); + } + var match$2 = match$1.tl; + var x2 = match$1.hd; + if (!match$2) { + return add(x2, add(x1, singleton(x0))); + } + var match$3 = match$2.tl; + var x3 = match$2.hd; + if (match$3) { + if (match$3.tl) { + return of_sorted_list(List.sort_uniq(funarg.compare, l)); } else { - return add(x3, add(x2, add(x1, singleton(x0)))); - } - }; - return { - empty: "Empty", - is_empty: is_empty, - mem: mem, - add: add, - singleton: singleton, - remove: remove, - union: union, - inter: inter, - diff: diff, - compare: compare, - equal: equal, - subset: subset, - iter: iter, - map: map, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - elements: elements, - min_elt: min_elt, - min_elt_opt: min_elt_opt, - max_elt: max_elt, - max_elt_opt: max_elt_opt, - choose: min_elt, - choose_opt: min_elt_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - of_list: of_list - }; - }) + return add(match$3.hd, add(x3, add(x2, add(x1, singleton(x0))))); + } + } else { + return add(x3, add(x2, add(x1, singleton(x0)))); + } + }; + return { + empty: "Empty", + is_empty: is_empty, + mem: mem, + add: add, + singleton: singleton, + remove: remove, + union: union, + inter: inter, + diff: diff, + compare: compare, + equal: equal, + subset: subset, + iter: iter, + map: map, + fold: fold, + for_all: for_all, + exists: exists, + filter: filter, + partition: partition, + cardinal: cardinal, + elements: elements, + min_elt: min_elt, + min_elt_opt: min_elt_opt, + max_elt: max_elt, + max_elt_opt: max_elt_opt, + choose: min_elt, + choose_opt: min_elt_opt, + split: split, + find: find, + find_opt: find_opt, + find_first: find_first, + find_first_opt: find_first_opt, + find_last: find_last, + find_last_opt: find_last_opt, + of_list: of_list + }; + }) }; export { diff --git a/lib/es6/parsing.js b/lib/es6/parsing.js index f491b008dc..2042aca072 100644 --- a/lib/es6/parsing.js +++ b/lib/es6/parsing.js @@ -57,8 +57,8 @@ function clear_parser(param) { var current_lookahead_fun = { contents: (function (param) { - return false; - }) + return false; + }) }; function yyparse(tables, start, lexer, lexbuf) { @@ -147,12 +147,12 @@ function yyparse(tables, start, lexer, lexbuf) { return exn$1._1; } current_lookahead_fun.contents = (function (tok) { - if (typeof tok !== "number") { - return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; - } else { - return Caml_array.get(tables.transl_const, tok) === curr_char; - } - }); + if (typeof tok !== "number") { + return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; + } else { + return Caml_array.get(tables.transl_const, tok) === curr_char; + } + }); throw exn$1; } } diff --git a/lib/es6/pervasives.js b/lib/es6/pervasives.js index c0424139a1..9ebc7cac57 100644 --- a/lib/es6/pervasives.js +++ b/lib/es6/pervasives.js @@ -193,16 +193,16 @@ function print_string(prim) { var exit_function = { contents: (function (prim) { - - }) + + }) }; function at_exit(f) { var g = exit_function.contents; exit_function.contents = (function (param) { - Curry._1(f, undefined); - Curry._1(g, undefined); - }); + Curry._1(f, undefined); + Curry._1(g, undefined); + }); } function exit(retcode) { diff --git a/lib/es6/pervasivesU.js b/lib/es6/pervasivesU.js index 76997d849f..89c397588d 100644 --- a/lib/es6/pervasivesU.js +++ b/lib/es6/pervasivesU.js @@ -192,16 +192,16 @@ function print_string(prim) { var exit_function = { contents: (function (prim) { - - }) + + }) }; function at_exit(f) { var g = exit_function.contents; exit_function.contents = (function () { - f(); - g(); - }); + f(); + g(); + }); } function exit(retcode) { diff --git a/lib/es6/set.js b/lib/es6/set.js index 0606e04494..912700c621 100644 --- a/lib/es6/set.js +++ b/lib/es6/set.js @@ -460,24 +460,24 @@ function Make(funarg) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/lib/es6/setLabels.js b/lib/es6/setLabels.js index 121ae00fa5..86e0bd0cb9 100644 --- a/lib/es6/setLabels.js +++ b/lib/es6/setLabels.js @@ -464,24 +464,24 @@ function Make(Ord) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/lib/es6/stream.js b/lib/es6/stream.js index 0ee28752e0..885f829168 100644 --- a/lib/es6/stream.js +++ b/lib/es6/stream.js @@ -285,12 +285,12 @@ function of_list(l) { return { count: 0, data: List.fold_right((function (x, l) { - return { - TAG: "Scons", - _0: x, - _1: l - }; - }), l, "Sempty") + return { + TAG: "Scons", + _0: x, + _1: l + }; + }), l, "Sempty") }; } @@ -299,13 +299,13 @@ function of_string(s) { contents: 0 }; return from(function (param) { - var c = count.contents; - if (c < s.length) { - count.contents = count.contents + 1 | 0; - return Caml_string.get(s, c); - } - - }); + var c = count.contents; + if (c < s.length) { + count.contents = count.contents + 1 | 0; + return Caml_string.get(s, c); + } + + }); } function of_bytes(s) { @@ -313,13 +313,13 @@ function of_bytes(s) { contents: 0 }; return from(function (param) { - var c = count.contents; - if (c < s.length) { - count.contents = count.contents + 1 | 0; - return Caml_bytes.get(s, c); - } - - }); + var c = count.contents; + if (c < s.length) { + count.contents = count.contents + 1 | 0; + return Caml_bytes.get(s, c); + } + + }); } function iapp(i, s) { @@ -361,12 +361,12 @@ function lapp(f, s) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Sapp", - _0: data(Curry._1(f, undefined)), - _1: data(s) - }; - }) + return { + TAG: "Sapp", + _0: data(Curry._1(f, undefined)), + _1: data(s) + }; + }) } }; } @@ -377,12 +377,12 @@ function lcons(f, s) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Scons", - _0: Curry._1(f, undefined), - _1: data(s) - }; - }) + return { + TAG: "Scons", + _0: Curry._1(f, undefined), + _1: data(s) + }; + }) } }; } @@ -393,12 +393,12 @@ function lsing(f) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Scons", - _0: Curry._1(f, undefined), - _1: "Sempty" - }; - }) + return { + TAG: "Scons", + _0: Curry._1(f, undefined), + _1: "Sempty" + }; + }) } }; } @@ -409,8 +409,8 @@ function slazy(f) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return data(Curry._1(f, undefined)); - }) + return data(Curry._1(f, undefined)); + }) } }; } diff --git a/lib/js/arg.js b/lib/js/arg.js index 1b0771070e..1d38f756af 100644 --- a/lib/js/arg.js +++ b/lib/js/arg.js @@ -51,8 +51,8 @@ function split(s) { function make_symlist(prefix, sep, suffix, l) { if (l) { return List.fold_left((function (x, y) { - return x + (sep + y); - }), prefix + l.hd, l.tl) + suffix; + return x + (sep + y); + }), prefix + l.hd, l.tl) + suffix; } else { return ""; } @@ -122,18 +122,18 @@ function add_help(speclist) { function usage_b(buf, speclist, errmsg) { $$Buffer.add_string(buf, errmsg + "\n"); List.iter((function (param) { - var doc = param[2]; - if (doc.length === 0) { - return; - } - var spec = param[1]; - var key = param[0]; - if (spec.TAG !== "Symbol") { - return $$Buffer.add_string(buf, " " + key + " " + doc + "\n"); - } - var sym = make_symlist("{", "|", "}", spec._0); - return $$Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); - }), add_help(speclist)); + var doc = param[2]; + if (doc.length === 0) { + return; + } + var spec = param[1]; + var key = param[0]; + if (spec.TAG !== "Symbol") { + return $$Buffer.add_string(buf, " " + key + " " + doc + "\n"); + } + var sym = make_symlist("{", "|", "}", spec._0); + return $$Buffer.add_string(buf, " " + key + " " + sym + doc + "\n"); + }), add_help(speclist)); } function usage_string(speclist, errmsg) { @@ -218,12 +218,12 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist } usage_b(b, speclist.contents, errmsg); if (Caml_obj.equal(error, { - TAG: "Unknown", - _0: "-help" - }) || Caml_obj.equal(error, { - TAG: "Unknown", - _0: "--help" - })) { + TAG: "Unknown", + _0: "-help" + }) || Caml_obj.equal(error, { + TAG: "Unknown", + _0: "--help" + })) { return { RE_EXN_ID: Help, _1: $$Buffer.contents(b) @@ -471,15 +471,15 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist var before = $$Array.sub(argv.contents, 0, current.contents + 1 | 0); var 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 - } - } - }); + hd: before, + tl: { + hd: newarg, + tl: { + hd: after, + tl: /* [] */0 + } + } + }); return; } @@ -494,9 +494,9 @@ function parse_and_expand_argv_dynamic_aux(allow_expand, current, argv, speclist var m = Caml_js_exceptions.internalToOCamlException(raw_m); if (m.RE_EXN_ID === Bad) { throw convert_error({ - TAG: "Message", - _0: m._1 - }); + TAG: "Message", + _0: m._1 + }); } if (m.RE_EXN_ID === Stop) { throw convert_error(m._1); @@ -514,15 +514,15 @@ function parse_and_expand_argv_dynamic(current, argv, speclist, anonfun, errmsg) function parse_argv_dynamic(currentOpt, argv, speclist, anonfun, errmsg) { var current$1 = currentOpt !== undefined ? currentOpt : current; parse_and_expand_argv_dynamic_aux(false, current$1, { - contents: argv - }, speclist, anonfun, errmsg); + contents: argv + }, speclist, anonfun, errmsg); } function parse_argv(currentOpt, argv, speclist, anonfun, errmsg) { var current$1 = currentOpt !== undefined ? currentOpt : current; parse_argv_dynamic(current$1, argv, { - contents: speclist - }, anonfun, errmsg); + contents: speclist + }, anonfun, errmsg); } function parse(l, f, msg) { @@ -648,13 +648,13 @@ function replace_leading_tab(s) { contents: false }; return $$String.map((function (c) { - if (c !== 9 || seen.contents) { - return c; - } else { - seen.contents = true; - return /* ' ' */32; - } - }), s); + if (c !== 9 || seen.contents) { + return c; + } else { + seen.contents = true; + return /* ' ' */32; + } + }), s); } function align(limitOpt, speclist) { @@ -663,41 +663,41 @@ function align(limitOpt, speclist) { var len = List.fold_left(max_arg_len, 0, completed); var len$1 = len < limit ? len : limit; return List.map((function (param) { - var spec = param[1]; - var kwd = param[0]; - if (param[2] === "") { - return param; - } - if (spec.TAG === "Symbol") { - var msg = param[2]; - var cutcol = second_word(msg); - var spaces = " ".repeat(Caml.int_max(0, len$1 - cutcol | 0) + 3 | 0); - return [ - kwd, - spec, - "\n" + (spaces + replace_leading_tab(msg)) - ]; - } - var msg$1 = param[2]; - var cutcol$1 = second_word(msg$1); - var kwd_len = kwd.length; - var diff = (len$1 - kwd_len | 0) - cutcol$1 | 0; - if (diff <= 0) { - return [ - kwd, - spec, - replace_leading_tab(msg$1) - ]; - } - var spaces$1 = " ".repeat(diff); - var prefix = $$String.sub(replace_leading_tab(msg$1), 0, cutcol$1); - var suffix = $$String.sub(msg$1, cutcol$1, msg$1.length - cutcol$1 | 0); - return [ - kwd, - spec, - prefix + (spaces$1 + suffix) - ]; - }), completed); + var spec = param[1]; + var kwd = param[0]; + if (param[2] === "") { + return param; + } + if (spec.TAG === "Symbol") { + var msg = param[2]; + var cutcol = second_word(msg); + var spaces = " ".repeat(Caml.int_max(0, len$1 - cutcol | 0) + 3 | 0); + return [ + kwd, + spec, + "\n" + (spaces + replace_leading_tab(msg)) + ]; + } + var msg$1 = param[2]; + var cutcol$1 = second_word(msg$1); + var kwd_len = kwd.length; + var diff = (len$1 - kwd_len | 0) - cutcol$1 | 0; + if (diff <= 0) { + return [ + kwd, + spec, + replace_leading_tab(msg$1) + ]; + } + var spaces$1 = " ".repeat(diff); + var prefix = $$String.sub(replace_leading_tab(msg$1), 0, cutcol$1); + var suffix = $$String.sub(msg$1, cutcol$1, msg$1.length - cutcol$1 | 0); + return [ + kwd, + spec, + prefix + (spaces$1 + suffix) + ]; + }), completed); } exports.parse = parse; diff --git a/lib/js/belt_MapDict.js b/lib/js/belt_MapDict.js index 4dabcbc04c..b49b728613 100644 --- a/lib/js/belt_MapDict.js +++ b/lib/js/belt_MapDict.js @@ -202,16 +202,16 @@ function mergeU(s1, s2, f, cmp) { if (s1 === undefined) { if (s2 !== undefined) { return Belt_internalAVLtree.keepMapU(s2, (function (k, v) { - return f(k, undefined, Caml_option.some(v)); - })); + return f(k, undefined, Caml_option.some(v)); + })); } else { return; } } if (s2 === undefined) { return Belt_internalAVLtree.keepMapU(s1, (function (k, v) { - return f(k, Caml_option.some(v), undefined); - })); + return f(k, Caml_option.some(v), undefined); + })); } if (s1.h >= s2.h) { var v1 = s1.k; diff --git a/lib/js/belt_internalAVLset.js b/lib/js/belt_internalAVLset.js index b253dada64..073b6e6349 100644 --- a/lib/js/belt_internalAVLset.js +++ b/lib/js/belt_internalAVLset.js @@ -859,8 +859,8 @@ function fromArray(xs, cmp) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (x, y) { - return cmp(x, y) < 0; - })); + return cmp(x, y) < 0; + })); var result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalAVLtree.js b/lib/js/belt_internalAVLtree.js index b83ebb1bc4..fdee8b51d3 100644 --- a/lib/js/belt_internalAVLtree.js +++ b/lib/js/belt_internalAVLtree.js @@ -1049,8 +1049,8 @@ function fromArray(xs, cmp) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return cmp(param[0], param$1[0]) < 0; - })); + return cmp(param[0], param$1[0]) < 0; + })); var result; if (next >= 0) { result = fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalBuckets.js b/lib/js/belt_internalBuckets.js index d32d87e893..1bf7c26494 100644 --- a/lib/js/belt_internalBuckets.js +++ b/lib/js/belt_internalBuckets.js @@ -118,34 +118,34 @@ function reduce(h, init, f) { function getMaxBucketLength(h) { return Belt_Array.reduceU(h.buckets, 0, (function (m, b) { - var len = bucketLength(0, b); - if (m > len) { - return m; - } else { - return len; - } - })); + var len = bucketLength(0, b); + if (m > len) { + return m; + } else { + return len; + } + })); } function getBucketHistogram(h) { var mbl = getMaxBucketLength(h); var histo = Belt_Array.makeByU(mbl + 1 | 0, (function (param) { - return 0; - })); + return 0; + })); Belt_Array.forEachU(h.buckets, (function (b) { - var l = bucketLength(0, b); - histo[l] = histo[l] + 1 | 0; - })); + var l = bucketLength(0, b); + histo[l] = histo[l] + 1 | 0; + })); return histo; } function logStats(h) { var histogram = getBucketHistogram(h); console.log({ - bindings: h.size, - buckets: h.buckets.length, - histogram: histogram - }); + bindings: h.size, + buckets: h.buckets.length, + histogram: histogram + }); } function filterMapInplaceBucket(f, h, i, _prec, _cell) { @@ -247,23 +247,23 @@ function linear(h, f) { function keysToArray(h) { return linear(h, (function (x) { - return x.key; - })); + return x.key; + })); } function valuesToArray(h) { return linear(h, (function (x) { - return x.value; - })); + return x.value; + })); } function toArray(h) { return linear(h, (function (x) { - return [ - x.key, - x.value - ]; - })); + return [ + x.key, + x.value + ]; + })); } var C; diff --git a/lib/js/belt_internalMapInt.js b/lib/js/belt_internalMapInt.js index 2eb83fc735..0855581670 100644 --- a/lib/js/belt_internalMapInt.js +++ b/lib/js/belt_internalMapInt.js @@ -316,8 +316,8 @@ function fromArray(xs) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return param[0] < param$1[0]; - })); + return param[0] < param$1[0]; + })); var result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalMapString.js b/lib/js/belt_internalMapString.js index 3ea09cad74..955464e46a 100644 --- a/lib/js/belt_internalMapString.js +++ b/lib/js/belt_internalMapString.js @@ -316,8 +316,8 @@ function fromArray(xs) { return; } var next = Belt_SortArray.strictlySortedLengthU(xs, (function (param, param$1) { - return param[0] < param$1[0]; - })); + return param[0] < param$1[0]; + })); var result; if (next >= 0) { result = Belt_internalAVLtree.fromSortedArrayAux(xs, 0, next); diff --git a/lib/js/belt_internalSetBuckets.js b/lib/js/belt_internalSetBuckets.js index b397538c1a..a4b4c74929 100644 --- a/lib/js/belt_internalSetBuckets.js +++ b/lib/js/belt_internalSetBuckets.js @@ -144,34 +144,34 @@ function reduce(h, init, f) { function getMaxBucketLength(h) { return Belt_Array.reduceU(h.buckets, 0, (function (m, b) { - var len = bucketLength(0, b); - if (m > len) { - return m; - } else { - return len; - } - })); + var len = bucketLength(0, b); + if (m > len) { + return m; + } else { + return len; + } + })); } function getBucketHistogram(h) { var mbl = getMaxBucketLength(h); var histo = Belt_Array.makeByU(mbl + 1 | 0, (function (param) { - return 0; - })); + return 0; + })); Belt_Array.forEachU(h.buckets, (function (b) { - var l = bucketLength(0, b); - histo[l] = histo[l] + 1 | 0; - })); + var l = bucketLength(0, b); + histo[l] = histo[l] + 1 | 0; + })); return histo; } function logStats(h) { var histogram = getBucketHistogram(h); console.log({ - bindings: h.size, - buckets: h.buckets.length, - histogram: histogram - }); + bindings: h.size, + buckets: h.buckets.length, + histogram: histogram + }); } var C; diff --git a/lib/js/caml_format.js b/lib/js/caml_format.js index b6d6dbe95e..7108fd6fdc 100644 --- a/lib/js/caml_format.js +++ b/lib/js/caml_format.js @@ -255,9 +255,9 @@ function int64_of_string(s) { var res = Caml_int64.mul(sign, aux(d, i + 1 | 0)); var or_res = Caml_int64.or_(res, Caml_int64.zero); if (Caml.i64_eq(base, [ - 0, - 10 - ]) && Caml.i64_neq(res, or_res)) { + 0, + 10 + ]) && Caml.i64_neq(res, or_res)) { throw { RE_EXN_ID: "Failure", _1: "int64_of_string", @@ -405,11 +405,11 @@ function parse_format(fmt) { f.prec = 0; var j = i + 1 | 0; while((function(j){ - return function () { - var w = fmt.codePointAt(j) - /* '0' */48 | 0; - return w >= 0 && w <= 9; - } - }(j))()) { + return function () { + var w = fmt.codePointAt(j) - /* '0' */48 | 0; + return w >= 0 && w <= 9; + } + }(j))()) { f.prec = (Math.imul(f.prec, 10) + fmt.codePointAt(j) | 0) - /* '0' */48 | 0; j = j + 1 | 0; }; @@ -446,11 +446,11 @@ function parse_format(fmt) { f.width = 0; var j$1 = i; while((function(j$1){ - return function () { - var w = fmt.codePointAt(j$1) - /* '0' */48 | 0; - return w >= 0 && w <= 9; - } - }(j$1))()) { + return function () { + var w = fmt.codePointAt(j$1) - /* '0' */48 | 0; + return w >= 0 && w <= 9; + } + }(j$1))()) { f.width = (Math.imul(f.width, 10) + fmt.codePointAt(j$1) | 0) - /* '0' */48 | 0; j$1 = j$1 + 1 | 0; }; @@ -558,13 +558,13 @@ function dec_of_pos_int64(x) { var y = Caml_int64.discard_sign(x); var match = Caml_int64.div_mod(y, wbase); var match$1 = Caml_int64.div_mod(Caml_int64.add([ - 0, - 8 - ], match[1]), wbase); + 0, + 8 + ], match[1]), wbase); var quotient = Caml_int64.add(Caml_int64.add([ - 214748364, - 3435973836 - ], match[0]), match$1[0]); + 214748364, + 3435973836 + ], match[0]), match$1[0]); return Caml_int64.to_string(quotient) + "0123456789"[Caml_int64.to_int32(match$1[1])]; } @@ -579,9 +579,9 @@ function oct_of_int64(x) { var y = Caml_int64.discard_sign(x); var match = Caml_int64.div_mod(y, wbase); var quotient = Caml_int64.add([ - 268435456, - 0 - ], match[0]); + 268435456, + 0 + ], match[0]); var modulus = match[1]; s = cvtbl[Caml_int64.to_int32(modulus)] + s; while(Caml.i64_neq(quotient, Caml_int64.zero)) { @@ -683,9 +683,9 @@ function format_float(fmt, x) { s = x$1.toFixed(p); } else { while((function () { - s = x$1.toFixed(p); - return s.length > (prec$1 + 1 | 0); - })()) { + s = x$1.toFixed(p); + return s.length > (prec$1 + 1 | 0); + })()) { p = p - 1 | 0; }; } @@ -786,9 +786,9 @@ var float_of_string = (function(s,exn){ function float_of_string$1(s) { return float_of_string(s, { - RE_EXN_ID: "Failure", - _1: "float_of_string" - }); + RE_EXN_ID: "Failure", + _1: "float_of_string" + }); } exports.format_float = format_float; diff --git a/lib/js/caml_hash.js b/lib/js/caml_hash.js index e92babfc6d..c643a095ff 100644 --- a/lib/js/caml_hash.js +++ b/lib/js/caml_hash.js @@ -85,8 +85,8 @@ function hash(count, _limit, seed, obj) { } return size })(obj$1, (function (v) { - push_back(queue, v); - })); + push_back(queue, v); + })); s = Caml_hash_primitive.hash_mix_int(s, (size$1 << 10) | 0); } } diff --git a/lib/js/caml_lexer.js b/lib/js/caml_lexer.js index f0b4e2adee..f1b9d95ed6 100644 --- a/lib/js/caml_lexer.js +++ b/lib/js/caml_lexer.js @@ -105,9 +105,9 @@ var empty_token_lit = "lexing: empty token"; function lex_engine(tbls, i, buf) { return caml_lex_engine_aux(tbls, i, buf, { - RE_EXN_ID: "Failure", - _1: empty_token_lit - }); + RE_EXN_ID: "Failure", + _1: empty_token_lit + }); } /***********************************************/ @@ -246,9 +246,9 @@ var caml_new_lex_engine_aux = (function (tbl, start_state, lexbuf, exn) { function new_lex_engine(tbl, i, buf) { return caml_new_lex_engine_aux(tbl, i, buf, { - RE_EXN_ID: "Failure", - _1: empty_token_lit - }); + RE_EXN_ID: "Failure", + _1: empty_token_lit + }); } exports.lex_engine = lex_engine; diff --git a/lib/js/camlinternalLazy.js b/lib/js/camlinternalLazy.js index 93d85e0116..ce6273feba 100644 --- a/lib/js/camlinternalLazy.js +++ b/lib/js/camlinternalLazy.js @@ -33,8 +33,8 @@ function force(lzv) { } catch (e){ lzv.VAL = (function () { - throw e; - }); + throw e; + }); throw e; } } diff --git a/lib/js/curry.js b/lib/js/curry.js index bcca756275..ed57c348b3 100644 --- a/lib/js/curry.js +++ b/lib/js/curry.js @@ -107,9 +107,9 @@ function _2(o, a0, a1) { }; default: return app(o, [ - a0, - a1 - ]); + a0, + a1 + ]); } } } @@ -133,9 +133,9 @@ function _3(o, a0, a1, a2) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2 - ]); + a1, + a2 + ]); case 2 : return app(o(a0, a1), [a2]); case 3 : @@ -158,10 +158,10 @@ function _3(o, a0, a1, a2) { }; default: return app(o, [ - a0, - a1, - a2 - ]); + a0, + a1, + a2 + ]); } } } @@ -185,15 +185,15 @@ function _4(o, a0, a1, a2, a3) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3 - ]); + a1, + a2, + a3 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3 - ]); + a2, + a3 + ]); case 3 : return app(o(a0, a1, a2), [a3]); case 4 : @@ -212,11 +212,11 @@ function _4(o, a0, a1, a2, a3) { }; default: return app(o, [ - a0, - a1, - a2, - a3 - ]); + a0, + a1, + a2, + a3 + ]); } } } @@ -240,22 +240,22 @@ function _5(o, a0, a1, a2, a3, a4) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4 - ]); + a1, + a2, + a3, + a4 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4 - ]); + a2, + a3, + a4 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4 - ]); + a3, + a4 + ]); case 4 : return app(o(a0, a1, a2, a3), [a4]); case 5 : @@ -270,12 +270,12 @@ function _5(o, a0, a1, a2, a3, a4) { }; default: return app(o, [ - a0, - a1, - a2, - a3, - a4 - ]); + a0, + a1, + a2, + a3, + a4 + ]); } } } @@ -299,30 +299,30 @@ function _6(o, a0, a1, a2, a3, a4, a5) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5 - ]); + a1, + a2, + a3, + a4, + a5 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5 - ]); + a2, + a3, + a4, + a5 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5 - ]); + a3, + a4, + a5 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5 - ]); + a4, + a5 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [a5]); case 6 : @@ -333,13 +333,13 @@ function _6(o, a0, a1, a2, a3, a4, a5) { }; default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5 - ]); + a0, + a1, + a2, + a3, + a4, + a5 + ]); } } } @@ -363,53 +363,53 @@ function _7(o, a0, a1, a2, a3, a4, a5, a6) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6 - ]); + a1, + a2, + a3, + a4, + a5, + a6 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6 - ]); + a2, + a3, + a4, + a5, + a6 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6 - ]); + a3, + a4, + a5, + a6 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6 - ]); + a4, + a5, + a6 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [ - a5, - a6 - ]); + a5, + a6 + ]); case 6 : return app(o(a0, a1, a2, a3, a4, a5), [a6]); case 7 : return o(a0, a1, a2, a3, a4, a5, a6); default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6 + ]); } } } @@ -433,62 +433,62 @@ function _8(o, a0, a1, a2, a3, a4, a5, a6, a7) { switch (arity) { case 1 : return app(o(a0), [ - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 2 : return app(o(a0, a1), [ - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a2, + a3, + a4, + a5, + a6, + a7 + ]); case 3 : return app(o(a0, a1, a2), [ - a3, - a4, - a5, - a6, - a7 - ]); + a3, + a4, + a5, + a6, + a7 + ]); case 4 : return app(o(a0, a1, a2, a3), [ - a4, - a5, - a6, - a7 - ]); + a4, + a5, + a6, + a7 + ]); case 5 : return app(o(a0, a1, a2, a3, a4), [ - a5, - a6, - a7 - ]); + a5, + a6, + a7 + ]); case 6 : return app(o(a0, a1, a2, a3, a4, a5), [ - a6, - a7 - ]); + a6, + a7 + ]); case 7 : return app(o(a0, a1, a2, a3, a4, a5, a6), [a7]); default: return app(o, [ - a0, - a1, - a2, - a3, - a4, - a5, - a6, - a7 - ]); + a0, + a1, + a2, + a3, + a4, + a5, + a6, + a7 + ]); } } } diff --git a/lib/js/genlex.js b/lib/js/genlex.js index e47cffb846..de38b40b7f 100644 --- a/lib/js/genlex.js +++ b/lib/js/genlex.js @@ -44,11 +44,11 @@ function get_string(param) { function make_lexer(keywords) { var kwd_table = Hashtbl.create(undefined, 17); List.iter((function (s) { - Hashtbl.add(kwd_table, s, { - TAG: "Kwd", - _0: s - }); - }), keywords); + Hashtbl.add(kwd_table, s, { + TAG: "Kwd", + _0: s + }); + }), keywords); var ident_or_keyword = function (id) { try { return Hashtbl.find(kwd_table, id); @@ -643,8 +643,8 @@ function make_lexer(keywords) { }; return function (input) { return Stream.from(function (_count) { - return next_token(input); - }); + return next_token(input); + }); }; } diff --git a/lib/js/hashtbl.js b/lib/js/hashtbl.js index 87e78935d6..b35b3a3e86 100644 --- a/lib/js/hashtbl.js +++ b/lib/js/hashtbl.js @@ -40,8 +40,8 @@ function is_randomized(param) { } var prng = CamlinternalLazy.from_fun(function () { - return Random.State.make_self_init(); - }); + return Random.State.make_self_init(); +}); function power_2_above(_x, n) { while(true) { @@ -403,11 +403,11 @@ function replace(h, key, data) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); @@ -584,13 +584,13 @@ function bucket_length(_accu, _param) { function stats(h) { var mbl = $$Array.fold_left((function (m, b) { - return Caml.int_max(m, bucket_length(0, b)); - }), 0, h.data); + return Caml.int_max(m, bucket_length(0, b)); + }), 0, h.data); var histo = Caml_array.make(mbl + 1 | 0, 0); $$Array.iter((function (b) { - var l = bucket_length(0, b); - Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); - }), h.data); + var l = bucket_length(0, b); + Caml_array.set(histo, l, Caml_array.get(histo, l) + 1 | 0); + }), h.data); return { num_bindings: h.size, num_buckets: h.data.length, @@ -792,11 +792,11 @@ function MakeSeeded(H) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); @@ -1036,11 +1036,11 @@ function Make(H) { var l = Caml_array.get(h.data, i); if (replace_bucket(key, data, l)) { Caml_array.set(h.data, i, { - TAG: "Cons", - key: key, - data: data, - next: l - }); + TAG: "Cons", + key: key, + data: data, + next: l + }); h.size = h.size + 1 | 0; if (h.size > (h.data.length << 1)) { return resize(key_index, h); diff --git a/lib/js/js_array.js b/lib/js/js_array.js index 14713ac205..345f904567 100644 --- a/lib/js/js_array.js +++ b/lib/js/js_array.js @@ -42,10 +42,10 @@ function sortInPlaceWith(arg1, obj) { function spliceInPlace(pos, remove, add, obj) { return Caml_splice_call.spliceObjApply(obj, "splice", [ - pos, - remove, - add - ]); + pos, + remove, + add + ]); } function removeFromInPlace(pos, obj) { diff --git a/lib/js/jsxPPXReactSupportC.js b/lib/js/jsxPPXReactSupportC.js index bb4242fb07..e5416381cf 100644 --- a/lib/js/jsxPPXReactSupportC.js +++ b/lib/js/jsxPPXReactSupportC.js @@ -5,18 +5,18 @@ var Caml_splice_call = require("./caml_splice_call.js"); function createElementWithKey(key, component, props) { return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); + key: key + }, props) : props); } function createElementVariadicWithKey(key, component, props, elements) { return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); + component, + key !== undefined ? Object.assign({ + key: key + }, props) : props, + elements + ]); } var Jsx; diff --git a/lib/js/jsxPPXReactSupportU.js b/lib/js/jsxPPXReactSupportU.js index bb4242fb07..e5416381cf 100644 --- a/lib/js/jsxPPXReactSupportU.js +++ b/lib/js/jsxPPXReactSupportU.js @@ -5,18 +5,18 @@ var Caml_splice_call = require("./caml_splice_call.js"); function createElementWithKey(key, component, props) { return React.createElement(component, key !== undefined ? Object.assign({ - key: key - }, props) : props); + key: key + }, props) : props); } function createElementVariadicWithKey(key, component, props, elements) { return Caml_splice_call.spliceApply(React.createElement, [ - component, - key !== undefined ? Object.assign({ - key: key - }, props) : props, - elements - ]); + component, + key !== undefined ? Object.assign({ + key: key + }, props) : props, + elements + ]); } var Jsx; diff --git a/lib/js/lazy.js b/lib/js/lazy.js index 38e71a131f..eb345670db 100644 --- a/lib/js/lazy.js +++ b/lib/js/lazy.js @@ -5,8 +5,8 @@ var CamlinternalLazy = require("./camlinternalLazy.js"); function from_fun(f) { return CamlinternalLazy.from_fun(function () { - return Curry._1(f, undefined); - }); + return Curry._1(f, undefined); + }); } var from_val = CamlinternalLazy.from_val; diff --git a/lib/js/lexing.js b/lib/js/lexing.js index b45b8675da..57d074252b 100644 --- a/lib/js/lexing.js +++ b/lib/js/lexing.js @@ -47,42 +47,42 @@ function from_function(f) { var partial_arg = Caml_bytes.create(512); return { refill_buff: (function (param) { - var read = Curry._2(f, partial_arg, partial_arg.length); - var n = read > 0 ? read : (param.lex_eof_reached = true, 0); - if ((param.lex_buffer_len + n | 0) > param.lex_buffer.length) { - if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) <= param.lex_buffer.length) { - Bytes.blit(param.lex_buffer, param.lex_start_pos, param.lex_buffer, 0, param.lex_buffer_len - param.lex_start_pos | 0); - } else { - var newlen = (param.lex_buffer.length << 1); - if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) > newlen) { - throw { - RE_EXN_ID: "Failure", - _1: "Lexing.lex_refill: cannot grow buffer", - Error: new Error() - }; - } - var newbuf = Caml_bytes.create(newlen); - Bytes.blit(param.lex_buffer, param.lex_start_pos, newbuf, 0, param.lex_buffer_len - param.lex_start_pos | 0); - param.lex_buffer = newbuf; + var read = Curry._2(f, partial_arg, partial_arg.length); + var n = read > 0 ? read : (param.lex_eof_reached = true, 0); + if ((param.lex_buffer_len + n | 0) > param.lex_buffer.length) { + if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) <= param.lex_buffer.length) { + Bytes.blit(param.lex_buffer, param.lex_start_pos, param.lex_buffer, 0, param.lex_buffer_len - param.lex_start_pos | 0); + } else { + var newlen = (param.lex_buffer.length << 1); + if (((param.lex_buffer_len - param.lex_start_pos | 0) + n | 0) > newlen) { + throw { + RE_EXN_ID: "Failure", + _1: "Lexing.lex_refill: cannot grow buffer", + Error: new Error() + }; } - var s = param.lex_start_pos; - param.lex_abs_pos = param.lex_abs_pos + s | 0; - param.lex_curr_pos = param.lex_curr_pos - s | 0; - param.lex_start_pos = 0; - param.lex_last_pos = param.lex_last_pos - s | 0; - param.lex_buffer_len = param.lex_buffer_len - s | 0; - var t = param.lex_mem; - for(var i = 0 ,i_finish = t.length; i < i_finish; ++i){ - var v = Caml_array.get(t, i); - if (v >= 0) { - Caml_array.set(t, i, v - s | 0); - } - + var newbuf = Caml_bytes.create(newlen); + Bytes.blit(param.lex_buffer, param.lex_start_pos, newbuf, 0, param.lex_buffer_len - param.lex_start_pos | 0); + param.lex_buffer = newbuf; + } + var s = param.lex_start_pos; + param.lex_abs_pos = param.lex_abs_pos + s | 0; + param.lex_curr_pos = param.lex_curr_pos - s | 0; + param.lex_start_pos = 0; + param.lex_last_pos = param.lex_last_pos - s | 0; + param.lex_buffer_len = param.lex_buffer_len - s | 0; + var t = param.lex_mem; + for(var i = 0 ,i_finish = t.length; i < i_finish; ++i){ + var v = Caml_array.get(t, i); + if (v >= 0) { + Caml_array.set(t, i, v - s | 0); } + } - Bytes.blit(partial_arg, 0, param.lex_buffer, param.lex_buffer_len, n); - param.lex_buffer_len = param.lex_buffer_len + n | 0; - }), + } + Bytes.blit(partial_arg, 0, param.lex_buffer, param.lex_buffer_len, n); + param.lex_buffer_len = param.lex_buffer_len + n | 0; + }), lex_buffer: Caml_bytes.create(1024), lex_buffer_len: 0, lex_abs_pos: 0, @@ -100,8 +100,8 @@ function from_function(f) { function from_string(s) { return { refill_buff: (function (lexbuf) { - lexbuf.lex_eof_reached = true; - }), + lexbuf.lex_eof_reached = true; + }), lex_buffer: Bytes.of_string(s), lex_buffer_len: s.length, lex_abs_pos: 0, diff --git a/lib/js/moreLabels.js b/lib/js/moreLabels.js index e9142b73f0..0926d6db97 100644 --- a/lib/js/moreLabels.js +++ b/lib/js/moreLabels.js @@ -34,16 +34,65 @@ var Hashtbl = { var $$Map = { Make: (function (funarg) { - var height = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return param.h; + var height = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return param.h; + } + }; + var create = function (l, x, d, r) { + var hl = height(l); + var hr = height(r); + return { + TAG: "Node", + l: l, + v: x, + d: d, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + }; + var singleton = function (x, d) { + return { + TAG: "Node", + l: "Empty", + v: x, + d: d, + r: "Empty", + h: 1 + }; + }; + var bal = function (l, x, d, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + if (hl > (hr + 2 | 0)) { + if (typeof l !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; } - }; - var create = function (l, x, d, r) { - var hl = height(l); - var hr = height(r); + var lr = l.r; + var ld = l.d; + var lv = l.v; + var ll = l.l; + if (height(ll) >= height(lr)) { + return create(ll, lv, ld, create(lr, x, d, r)); + } + if (typeof lr === "object") { + return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + } + if (hr <= (hl + 2 | 0)) { return { TAG: "Node", l: l, @@ -52,1044 +101,964 @@ var $$Map = { r: r, h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 }; - }; - var singleton = function (x, d) { + } + if (typeof r !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + } + var rr = r.r; + var rd = r.d; + var rv = r.v; + var rl = r.l; + if (height(rr) >= height(rl)) { + return create(create(l, x, d, rl), rv, rd, rr); + } + if (typeof rl === "object") { + return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.bal", + Error: new Error() + }; + }; + var is_empty = function (param) { + if (typeof param !== "object") { + return true; + } else { + return false; + } + }; + var add = function (x, data, param) { + if (typeof param !== "object") { return { TAG: "Node", l: "Empty", v: x, - d: d, + d: data, r: "Empty", h: 1 }; - }; - var bal = function (l, x, d, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - if (hl > (hr + 2 | 0)) { - if (typeof l !== "object") { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; - } - var lr = l.r; - var ld = l.d; - var lv = l.v; - var ll = l.l; - if (height(ll) >= height(lr)) { - return create(ll, lv, ld, create(lr, x, d, r)); - } - if (typeof lr === "object") { - return create(create(ll, lv, ld, lr.l), lr.v, lr.d, create(lr.r, x, d, r)); - } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; - } - if (hr <= (hl + 2 | 0)) { + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + if (d === data) { + return param; + } else { return { TAG: "Node", l: l, v: x, - d: d, + d: data, r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + h: param.h }; } - if (typeof r !== "object") { + } + if (c < 0) { + var ll = add(x, data, l); + if (l === ll) { + return param; + } else { + return bal(ll, v, d, r); + } + } + var rr = add(x, data, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var find = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", + RE_EXN_ID: "Not_found", Error: new Error() }; } - var rr = r.r; - var rd = r.d; - var rv = r.v; - var rl = r.l; - if (height(rr) >= height(rl)) { - return create(create(l, x, d, rl), rv, rd, rr); - } - if (typeof rl === "object") { - return create(create(l, x, d, rl.l), rl.v, rl.d, create(rl.r, rv, rd, rr)); + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return param.d; } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.bal", - Error: new Error() - }; + _param = c < 0 ? param.l : param.r; + continue ; }; - var is_empty = function (param) { + }; + var find_first_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; if (typeof param !== "object") { - return true; - } else { - return false; + return [ + v0, + d0 + ]; } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.l; + _d0 = param.d; + _v0 = v; + continue ; + } + _param = param.r; + continue ; }; - var add = function (x, data, param) { + }; + var find_first = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return { - TAG: "Node", - l: "Empty", - v: x, - d: data, - r: "Empty", - h: 1 + throw { + RE_EXN_ID: "Not_found", + Error: new Error() }; } - var r = param.r; - var d = param.d; var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - if (d === data) { - return param; - } else { - return { - TAG: "Node", - l: l, - v: x, - d: data, - r: r, - h: param.h - }; - } - } - if (c < 0) { - var ll = add(x, data, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } - } - var rr = add(x, data, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + if (Curry._1(f, v)) { + return find_first_aux(v, param.d, f, param.l); + } + _param = param.r; + continue ; + }; + }; + var find_first_opt_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; } - }; - var find = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return param.d; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var find_first_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; - }; - var find_first = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_aux(v, param.d, f, param.l); - } - _param = param.r; - continue ; - }; - }; - var find_first_opt_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; - }; - var find_first_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_opt_aux(v, param.d, f, param.l); - } - _param = param.r; - continue ; - }; - }; - var find_last_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_aux(v, param.d, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_last_opt_aux = function (_v0, _d0, f, _param) { - while(true) { - var param = _param; - var d0 = _d0; - var v0 = _v0; - if (typeof param !== "object") { - return [ - v0, - d0 - ]; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _d0 = param.d; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_opt_aux(v, param.d, f, param.r); - } + var v = param.v; + if (Curry._1(f, v)) { _param = param.l; + _d0 = param.d; + _v0 = v; continue ; - }; - }; - var find_opt = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return Caml_option.some(param.d); - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var mem = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return true; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var min_binding = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var l = param.l; - if (typeof l !== "object") { - return [ - param.v, - param.d - ]; - } - _param = l; - continue ; - }; - }; - var min_binding_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var l = param.l; - if (typeof l !== "object") { - return [ - param.v, - param.d - ]; - } - _param = l; - continue ; - }; - }; - var max_binding = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var r = param.r; - if (typeof r !== "object") { - return [ - param.v, - param.d - ]; - } - _param = r; - continue ; - }; + } + _param = param.r; + continue ; }; - var max_binding_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var r = param.r; - if (typeof r !== "object") { - return [ - param.v, - param.d - ]; - } - _param = r; + }; + var find_first_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_opt_aux(v, param.d, f, param.l); + } + _param = param.r; + continue ; + }; + }; + var find_last_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.r; + _d0 = param.d; + _v0 = v; continue ; - }; + } + _param = param.l; + continue ; }; - var remove_min_binding = function (param) { + }; + var find_last = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Map.remove_min_elt", + RE_EXN_ID: "Not_found", Error: new Error() }; } - var l = param.l; - if (typeof l !== "object") { - return param.r; - } else { - return bal(remove_min_binding(l), param.v, param.d, param.r); + var v = param.v; + if (Curry._1(f, v)) { + return find_last_aux(v, param.d, f, param.r); + } + _param = param.l; + continue ; + }; + }; + var find_last_opt_aux = function (_v0, _d0, f, _param) { + while(true) { + var param = _param; + var d0 = _d0; + var v0 = _v0; + if (typeof param !== "object") { + return [ + v0, + d0 + ]; + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.r; + _d0 = param.d; + _v0 = v; + continue ; } + _param = param.l; + continue ; }; - var merge = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; + }; + var find_last_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - if (typeof t2 !== "object") { - return t1; + var v = param.v; + if (Curry._1(f, v)) { + return find_last_opt_aux(v, param.d, f, param.r); } - var match = min_binding(t2); - return bal(t1, match[0], match[1], remove_min_binding(t2)); + _param = param.l; + continue ; }; - var remove = function (x, param) { + }; + var find_opt = function (x, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); + var c = Curry._2(funarg.compare, x, param.v); if (c === 0) { - return merge(l, r); + return Caml_option.some(param.d); } - if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var mem = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return false; } - var rr = remove(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return true; } + _param = c < 0 ? param.l : param.r; + continue ; }; - var update = function (x, f, param) { + }; + var min_binding = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - var data = Curry._1(f, undefined); - if (data !== undefined) { - return { - TAG: "Node", - l: "Empty", - v: x, - d: Caml_option.valFromOption(data), - r: "Empty", - h: 1 - }; - } else { - return "Empty"; - } + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } - var r = param.r; - var d = param.d; - var v = param.v; var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - var data$1 = Curry._1(f, Caml_option.some(d)); - if (data$1 === undefined) { - return merge(l, r); - } - var data$2 = Caml_option.valFromOption(data$1); - if (d === data$2) { - return param; - } else { - return { - TAG: "Node", - l: l, - v: x, - d: data$2, - r: r, - h: param.h - }; - } + if (typeof l !== "object") { + return [ + param.v, + param.d + ]; } - if (c < 0) { - var ll = update(x, f, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, d, r); - } + _param = l; + continue ; + }; + }; + var min_binding_opt = function (_param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - var rr = update(x, f, r); - if (r === rr) { - return param; - } else { - return bal(l, v, d, rr); + var l = param.l; + if (typeof l !== "object") { + return [ + param.v, + param.d + ]; } + _param = l; + continue ; }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - iter(f, param.l); - Curry._2(f, param.v, param.d); - _param = param.r; - continue ; - }; - }; - var map = function (f, param) { + }; + var max_binding = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } - var l$p = map(f, param.l); - var d$p = Curry._1(f, param.d); - var r$p = map(f, param.r); - return { - TAG: "Node", - l: l$p, - v: param.v, - d: d$p, - r: r$p, - h: param.h - }; + var r = param.r; + if (typeof r !== "object") { + return [ + param.v, + param.d + ]; + } + _param = r; + continue ; }; - var mapi = function (f, param) { + }; + var max_binding_opt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var v = param.v; - var l$p = mapi(f, param.l); - var d$p = Curry._2(f, v, param.d); - var r$p = mapi(f, param.r); - return { - TAG: "Node", - l: l$p, - v: v, - d: d$p, - r: r$p, - h: param.h - }; - }; - var fold = function (f, _m, _accu) { - while(true) { - var accu = _accu; - var m = _m; - if (typeof m !== "object") { - return accu; - } - _accu = Curry._3(f, m.v, m.d, fold(f, m.l, accu)); - _m = m.r; - continue ; - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return true; - } - if (!Curry._2(p, param.v, param.d)) { - return false; - } - if (!for_all(p, param.l)) { - return false; - } - _param = param.r; - continue ; - }; + var r = param.r; + if (typeof r !== "object") { + return [ + param.v, + param.d + ]; + } + _param = r; + continue ; }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - if (Curry._2(p, param.v, param.d)) { - return true; - } - if (exists(p, param.l)) { - return true; - } - _param = param.r; - continue ; + }; + var remove_min_binding = function (param) { + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Map.remove_min_elt", + Error: new Error() }; - }; - var add_min_binding = function (k, x, param) { - if (typeof param !== "object") { - return singleton(k, x); + } + var l = param.l; + if (typeof l !== "object") { + return param.r; + } else { + return bal(remove_min_binding(l), param.v, param.d, param.r); + } + }; + var merge = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } + if (typeof t2 !== "object") { + return t1; + } + var match = min_binding(t2); + return bal(t1, match[0], match[1], remove_min_binding(t2)); + }; + var remove = function (x, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return merge(l, r); + } + if (c < 0) { + var ll = remove(x, l); + if (l === ll) { + return param; } else { - return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); - } - }; - var add_max_binding = function (k, x, param) { - if (typeof param !== "object") { - return singleton(k, x); + return bal(ll, v, d, r); + } + } + var rr = remove(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var update = function (x, f, param) { + if (typeof param !== "object") { + var data = Curry._1(f, undefined); + if (data !== undefined) { + return { + TAG: "Node", + l: "Empty", + v: x, + d: Caml_option.valFromOption(data), + r: "Empty", + h: 1 + }; } else { - return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); - } - }; - var join = function (l, v, d, r) { - if (typeof l !== "object") { - return add_min_binding(v, d, r); + return "Empty"; } - var lh = l.h; - if (typeof r !== "object") { - return add_max_binding(v, d, l); + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + var data$1 = Curry._1(f, Caml_option.some(d)); + if (data$1 === undefined) { + return merge(l, r); } - var rh = r.h; - if (lh > (rh + 2 | 0)) { - return bal(l.l, l.v, l.d, join(l.r, v, d, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, d, r.l), r.v, r.d, r.r); + var data$2 = Caml_option.valFromOption(data$1); + if (d === data$2) { + return param; } else { - return create(l, v, d, r); + return { + TAG: "Node", + l: l, + v: x, + d: data$2, + r: r, + h: param.h + }; } - }; - var concat = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; + } + if (c < 0) { + var ll = update(x, f, l); + if (l === ll) { + return param; + } else { + return bal(ll, v, d, r); + } + } + var rr = update(x, f, r); + if (r === rr) { + return param; + } else { + return bal(l, v, d, rr); + } + }; + var iter = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + iter(f, param.l); + Curry._2(f, param.v, param.d); + _param = param.r; + continue ; + }; + }; + var map = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var l$p = map(f, param.l); + var d$p = Curry._1(f, param.d); + var r$p = map(f, param.r); + return { + TAG: "Node", + l: l$p, + v: param.v, + d: d$p, + r: r$p, + h: param.h + }; + }; + var mapi = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var v = param.v; + var l$p = mapi(f, param.l); + var d$p = Curry._2(f, v, param.d); + var r$p = mapi(f, param.r); + return { + TAG: "Node", + l: l$p, + v: v, + d: d$p, + r: r$p, + h: param.h + }; + }; + var fold = function (f, _m, _accu) { + while(true) { + var accu = _accu; + var m = _m; + if (typeof m !== "object") { + return accu; + } + _accu = Curry._3(f, m.v, m.d, fold(f, m.l, accu)); + _m = m.r; + continue ; + }; + }; + var for_all = function (p, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return true; } - if (typeof t2 !== "object") { - return t1; + if (!Curry._2(p, param.v, param.d)) { + return false; } - var match = min_binding(t2); - return join(t1, match[0], match[1], remove_min_binding(t2)); - }; - var concat_or_join = function (t1, v, d, t2) { - if (d !== undefined) { - return join(t1, v, Caml_option.valFromOption(d), t2); - } else { - return concat(t1, t2); + if (!for_all(p, param.l)) { + return false; } + _param = param.r; + continue ; }; - var split = function (x, param) { + }; + var exists = function (p, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - undefined, - "Empty" - ]; + return false; } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return [ - l, - Caml_option.some(d), - r - ]; + if (Curry._2(p, param.v, param.d)) { + return true; } - if (c < 0) { - var match = split(x, l); - return [ - match[0], - match[1], - join(match[2], v, d, r) - ]; + if (exists(p, param.l)) { + return true; } - var match$1 = split(x, r); + _param = param.r; + continue ; + }; + }; + var add_min_binding = function (k, x, param) { + if (typeof param !== "object") { + return singleton(k, x); + } else { + return bal(add_min_binding(k, x, param.l), param.v, param.d, param.r); + } + }; + var add_max_binding = function (k, x, param) { + if (typeof param !== "object") { + return singleton(k, x); + } else { + return bal(param.l, param.v, param.d, add_max_binding(k, x, param.r)); + } + }; + var join = function (l, v, d, r) { + if (typeof l !== "object") { + return add_min_binding(v, d, r); + } + var lh = l.h; + if (typeof r !== "object") { + return add_max_binding(v, d, l); + } + var rh = r.h; + if (lh > (rh + 2 | 0)) { + return bal(l.l, l.v, l.d, join(l.r, v, d, r)); + } else if (rh > (lh + 2 | 0)) { + return bal(join(l, v, d, r.l), r.v, r.d, r.r); + } else { + return create(l, v, d, r); + } + }; + var concat = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } + if (typeof t2 !== "object") { + return t1; + } + var match = min_binding(t2); + return join(t1, match[0], match[1], remove_min_binding(t2)); + }; + var concat_or_join = function (t1, v, d, t2) { + if (d !== undefined) { + return join(t1, v, Caml_option.valFromOption(d), t2); + } else { + return concat(t1, t2); + } + }; + var split = function (x, param) { + if (typeof param !== "object") { return [ - join(l, v, d, match$1[0]), - match$1[1], - match$1[2] + "Empty", + undefined, + "Empty" ]; - }; - var merge$1 = function (f, s1, s2) { - if (typeof s1 !== "object") { - if (typeof s2 !== "object") { - return "Empty"; - } - - } else { - var v1 = s1.v; - if (s1.h >= height(s2)) { - var match = split(v1, s2); - return concat_or_join(merge$1(f, s1.l, match[0]), v1, Curry._3(f, v1, Caml_option.some(s1.d), match[1]), merge$1(f, s1.r, match[2])); - } - - } + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return [ + l, + Caml_option.some(d), + r + ]; + } + if (c < 0) { + var match = split(x, l); + return [ + match[0], + match[1], + join(match[2], v, d, r) + ]; + } + var match$1 = split(x, r); + return [ + join(l, v, d, match$1[0]), + match$1[1], + match$1[2] + ]; + }; + var merge$1 = function (f, s1, s2) { + if (typeof s1 !== "object") { if (typeof s2 !== "object") { - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "mapLabels.res", - 552, - 11 - ], - Error: new Error() - }; - } - var v2 = s2.v; - var match$1 = split(v2, s1); - return concat_or_join(merge$1(f, match$1[0], s2.l), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); - }; - var union = function (f, s1, s2) { - if (typeof s1 !== "object") { - return s2; + return "Empty"; } - var d1 = s1.d; + + } else { var v1 = s1.v; - if (typeof s2 !== "object") { - return s1; - } - var d2 = s2.d; - var v2 = s2.v; - if (s1.h >= s2.h) { + if (s1.h >= height(s2)) { var match = split(v1, s2); - var d2$1 = match[1]; - var l = union(f, s1.l, match[0]); - var r = union(f, s1.r, match[2]); - if (d2$1 !== undefined) { - return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); - } else { - return join(l, v1, d1, r); - } + return concat_or_join(merge$1(f, s1.l, match[0]), v1, Curry._3(f, v1, Caml_option.some(s1.d), match[1]), merge$1(f, s1.r, match[2])); } - var match$1 = split(v2, s1); - var d1$1 = match$1[1]; - var l$1 = union(f, match$1[0], s2.l); - var r$1 = union(f, match$1[2], s2.r); - if (d1$1 !== undefined) { - return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); + + } + if (typeof s2 !== "object") { + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "mapLabels.res", + 552, + 11 + ], + Error: new Error() + }; + } + var v2 = s2.v; + var match$1 = split(v2, s1); + return concat_or_join(merge$1(f, match$1[0], s2.l), v2, Curry._3(f, v2, match$1[1], Caml_option.some(s2.d)), merge$1(f, match$1[2], s2.r)); + }; + var union = function (f, s1, s2) { + if (typeof s1 !== "object") { + return s2; + } + var d1 = s1.d; + var v1 = s1.v; + if (typeof s2 !== "object") { + return s1; + } + var d2 = s2.d; + var v2 = s2.v; + if (s1.h >= s2.h) { + var match = split(v1, s2); + var d2$1 = match[1]; + var l = union(f, s1.l, match[0]); + var r = union(f, s1.r, match[2]); + if (d2$1 !== undefined) { + return concat_or_join(l, v1, Curry._3(f, v1, d1, Caml_option.valFromOption(d2$1)), r); } else { - return join(l$1, v2, d2, r$1); - } - }; - var filter = function (p, param) { - if (typeof param !== "object") { - return "Empty"; - } - var r = param.r; - var d = param.d; - var v = param.v; - var l = param.l; - var l$p = filter(p, l); - var pvd = Curry._2(p, v, d); - var r$p = filter(p, r); - if (pvd) { - if (l === l$p && r === r$p) { - return param; + return join(l, v1, d1, r); + } + } + var match$1 = split(v2, s1); + var d1$1 = match$1[1]; + var l$1 = union(f, match$1[0], s2.l); + var r$1 = union(f, match$1[2], s2.r); + if (d1$1 !== undefined) { + return concat_or_join(l$1, v2, Curry._3(f, v2, Caml_option.valFromOption(d1$1), d2), r$1); + } else { + return join(l$1, v2, d2, r$1); + } + }; + var filter = function (p, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var d = param.d; + var v = param.v; + var l = param.l; + var l$p = filter(p, l); + var pvd = Curry._2(p, v, d); + var r$p = filter(p, r); + if (pvd) { + if (l === l$p && r === r$p) { + return param; + } else { + return join(l$p, v, d, r$p); + } + } else { + return concat(l$p, r$p); + } + }; + var partition = function (p, param) { + if (typeof param !== "object") { + return [ + "Empty", + "Empty" + ]; + } + var d = param.d; + var v = param.v; + var match = partition(p, param.l); + var lf = match[1]; + var lt = match[0]; + var pvd = Curry._2(p, v, d); + var match$1 = partition(p, param.r); + var rf = match$1[1]; + var rt = match$1[0]; + if (pvd) { + return [ + join(lt, v, d, rt), + concat(lf, rf) + ]; + } else { + return [ + concat(lt, rt), + join(lf, v, d, rf) + ]; + } + }; + var cons_enum = function (_m, _e) { + while(true) { + var e = _e; + var m = _m; + if (typeof m !== "object") { + return e; + } + _e = { + TAG: "More", + _0: m.v, + _1: m.d, + _2: m.r, + _3: e + }; + _m = m.l; + continue ; + }; + }; + var compare = function (cmp, m1, m2) { + var _e1 = cons_enum(m1, "End"); + var _e2 = cons_enum(m2, "End"); + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { + if (typeof e2 !== "object") { + return 0; } else { - return join(l$p, v, d, r$p); + return -1; } - } else { - return concat(l$p, r$p); } - }; - var partition = function (p, param) { - if (typeof param !== "object") { - return [ - "Empty", - "Empty" - ]; + if (typeof e2 !== "object") { + return 1; } - var d = param.d; - var v = param.v; - var match = partition(p, param.l); - var lf = match[1]; - var lt = match[0]; - var pvd = Curry._2(p, v, d); - var match$1 = partition(p, param.r); - var rf = match$1[1]; - var rt = match$1[0]; - if (pvd) { - return [ - join(lt, v, d, rt), - concat(lf, rf) - ]; - } else { - return [ - concat(lt, rt), - join(lf, v, d, rf) - ]; + var c = Curry._2(funarg.compare, e1._0, e2._0); + if (c !== 0) { + return c; } + var c$1 = Curry._2(cmp, e1._1, e2._1); + if (c$1 !== 0) { + return c$1; + } + _e2 = cons_enum(e2._2, e2._3); + _e1 = cons_enum(e1._2, e1._3); + continue ; }; - var cons_enum = function (_m, _e) { - while(true) { - var e = _e; - var m = _m; - if (typeof m !== "object") { - return e; - } - _e = { - TAG: "More", - _0: m.v, - _1: m.d, - _2: m.r, - _3: e - }; - _m = m.l; - continue ; - }; - }; - var compare = function (cmp, m1, m2) { - var _e1 = cons_enum(m1, "End"); - var _e2 = cons_enum(m2, "End"); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return 0; - } else { - return -1; - } - } - if (typeof e2 !== "object") { - return 1; - } - var c = Curry._2(funarg.compare, e1._0, e2._0); - if (c !== 0) { - return c; - } - var c$1 = Curry._2(cmp, e1._1, e2._1); - if (c$1 !== 0) { - return c$1; - } - _e2 = cons_enum(e2._2, e2._3); - _e1 = cons_enum(e1._2, e1._3); - continue ; - }; - }; - var equal = function (cmp, m1, m2) { - var _e1 = cons_enum(m1, "End"); - var _e2 = cons_enum(m2, "End"); - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return true; - } else { - return false; - } - } + }; + var equal = function (cmp, m1, m2) { + var _e1 = cons_enum(m1, "End"); + var _e2 = cons_enum(m2, "End"); + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { if (typeof e2 !== "object") { + return true; + } else { return false; } - if (Curry._2(funarg.compare, e1._0, e2._0) !== 0) { - return false; - } - if (!Curry._2(cmp, e1._1, e2._1)) { - return false; - } - _e2 = cons_enum(e2._2, e2._3); - _e1 = cons_enum(e1._2, e1._3); - continue ; - }; - }; - var cardinal = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; } - }; - var bindings_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (typeof param !== "object") { - return accu; - } - _param = param.l; - _accu = { - hd: [ - param.v, - param.d - ], - tl: bindings_aux(accu, param.r) - }; - continue ; + if (typeof e2 !== "object") { + return false; + } + if (Curry._2(funarg.compare, e1._0, e2._0) !== 0) { + return false; + } + if (!Curry._2(cmp, e1._1, e2._1)) { + return false; + } + _e2 = cons_enum(e2._2, e2._3); + _e1 = cons_enum(e1._2, e1._3); + continue ; + }; + }; + var cardinal = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + } + }; + var bindings_aux = function (_accu, _param) { + while(true) { + var param = _param; + var accu = _accu; + if (typeof param !== "object") { + return accu; + } + _param = param.l; + _accu = { + hd: [ + param.v, + param.d + ], + tl: bindings_aux(accu, param.r) }; - }; - var bindings = function (s) { - return bindings_aux(/* [] */0, s); - }; - return { - empty: "Empty", - is_empty: is_empty, - mem: mem, - add: add, - update: update, - singleton: singleton, - remove: remove, - merge: merge$1, - union: union, - compare: compare, - equal: equal, - iter: iter, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - bindings: bindings, - min_binding: min_binding, - min_binding_opt: min_binding_opt, - max_binding: max_binding, - max_binding_opt: max_binding_opt, - choose: min_binding, - choose_opt: min_binding_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - map: map, - mapi: mapi - }; - }) + continue ; + }; + }; + var bindings = function (s) { + return bindings_aux(/* [] */0, s); + }; + return { + empty: "Empty", + is_empty: is_empty, + mem: mem, + add: add, + update: update, + singleton: singleton, + remove: remove, + merge: merge$1, + union: union, + compare: compare, + equal: equal, + iter: iter, + fold: fold, + for_all: for_all, + exists: exists, + filter: filter, + partition: partition, + cardinal: cardinal, + bindings: bindings, + min_binding: min_binding, + min_binding_opt: min_binding_opt, + max_binding: max_binding, + max_binding_opt: max_binding_opt, + choose: min_binding, + choose_opt: min_binding_opt, + split: split, + find: find, + find_opt: find_opt, + find_first: find_first, + find_first_opt: find_first_opt, + find_last: find_last, + find_last_opt: find_last_opt, + map: map, + mapi: mapi + }; + }) }; var $$Set = { Make: (function (funarg) { - var height = function (param) { - if (typeof param !== "object") { - return 0; - } else { - return param.h; - } - }; - var create = function (l, v, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - return { - TAG: "Node", - l: l, - v: v, - r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - }; - }; - var bal = function (l, v, r) { - var hl; - hl = typeof l !== "object" ? 0 : l.h; - var hr; - hr = typeof r !== "object" ? 0 : r.h; - if (hl > (hr + 2 | 0)) { - if (typeof l !== "object") { - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal", - Error: new Error() - }; - } - var lr = l.r; - var lv = l.v; - var ll = l.l; - if (height(ll) >= height(lr)) { - return create(ll, lv, create(lr, v, r)); - } - if (typeof lr === "object") { - return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); - } - throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.bal", - Error: new Error() - }; - } - if (hr <= (hl + 2 | 0)) { - return { - TAG: "Node", - l: l, - v: v, - r: r, - h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 - }; - } - if (typeof r !== "object") { + var height = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return param.h; + } + }; + var create = function (l, v, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + return { + TAG: "Node", + l: l, + v: v, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + }; + var bal = function (l, v, r) { + var hl; + hl = typeof l !== "object" ? 0 : l.h; + var hr; + hr = typeof r !== "object" ? 0 : r.h; + if (hl > (hr + 2 | 0)) { + if (typeof l !== "object") { throw { RE_EXN_ID: "Invalid_argument", _1: "Set.bal", Error: new Error() }; } - var rr = r.r; - var rv = r.v; - var rl = r.l; - if (height(rr) >= height(rl)) { - return create(create(l, v, rl), rv, rr); + var lr = l.r; + var lv = l.v; + var ll = l.l; + if (height(ll) >= height(lr)) { + return create(ll, lv, create(lr, v, r)); } - if (typeof rl === "object") { - return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); + if (typeof lr === "object") { + return create(create(ll, lv, lr.l), lr.v, create(lr.r, v, r)); } throw { RE_EXN_ID: "Invalid_argument", _1: "Set.bal", Error: new Error() }; - }; - var add = function (x, param) { - if (typeof param !== "object") { - return { - TAG: "Node", - l: "Empty", - v: x, - r: "Empty", - h: 1 - }; - } - var r = param.r; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return param; - } - if (c < 0) { - var ll = add(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, r); - } - } - var rr = add(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, rr); - } - }; - var singleton = function (x) { + } + if (hr <= (hl + 2 | 0)) { + return { + TAG: "Node", + l: l, + v: v, + r: r, + h: hl >= hr ? hl + 1 | 0 : hr + 1 | 0 + }; + } + if (typeof r !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal", + Error: new Error() + }; + } + var rr = r.r; + var rv = r.v; + var rl = r.l; + if (height(rr) >= height(rl)) { + return create(create(l, v, rl), rv, rr); + } + if (typeof rl === "object") { + return create(create(l, v, rl.l), rl.v, create(rl.r, rv, rr)); + } + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.bal", + Error: new Error() + }; + }; + var add = function (x, param) { + if (typeof param !== "object") { return { TAG: "Node", l: "Empty", @@ -1097,710 +1066,767 @@ var $$Set = { r: "Empty", h: 1 }; - }; - var add_min_element = function (x, param) { - if (typeof param !== "object") { - return singleton(x); - } else { - return bal(add_min_element(x, param.l), param.v, param.r); - } - }; - var add_max_element = function (x, param) { - if (typeof param !== "object") { - return singleton(x); - } else { - return bal(param.l, param.v, add_max_element(x, param.r)); - } - }; - var join = function (l, v, r) { - if (typeof l !== "object") { - return add_min_element(v, r); - } - var lh = l.h; - if (typeof r !== "object") { - return add_max_element(v, l); - } - var rh = r.h; - if (lh > (rh + 2 | 0)) { - return bal(l.l, l.v, join(l.r, v, r)); - } else if (rh > (lh + 2 | 0)) { - return bal(join(l, v, r.l), r.v, r.r); + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return param; + } + if (c < 0) { + var ll = add(x, l); + if (l === ll) { + return param; } else { - return create(l, v, r); - } - }; - var min_elt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var l = param.l; - if (typeof l !== "object") { - return param.v; - } - _param = l; - continue ; - }; - }; - var min_elt_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var l = param.l; - if (typeof l !== "object") { - return Caml_option.some(param.v); - } - _param = l; - continue ; - }; - }; - var max_elt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var r = param.r; - if (typeof r !== "object") { - return param.v; - } - _param = r; - continue ; - }; - }; - var max_elt_opt = function (_param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var r = param.r; - if (typeof r !== "object") { - return Caml_option.some(param.v); - } - _param = r; - continue ; - }; - }; - var remove_min_elt = function (param) { + return bal(ll, v, r); + } + } + var rr = add(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, rr); + } + }; + var singleton = function (x) { + return { + TAG: "Node", + l: "Empty", + v: x, + r: "Empty", + h: 1 + }; + }; + var add_min_element = function (x, param) { + if (typeof param !== "object") { + return singleton(x); + } else { + return bal(add_min_element(x, param.l), param.v, param.r); + } + }; + var add_max_element = function (x, param) { + if (typeof param !== "object") { + return singleton(x); + } else { + return bal(param.l, param.v, add_max_element(x, param.r)); + } + }; + var join = function (l, v, r) { + if (typeof l !== "object") { + return add_min_element(v, r); + } + var lh = l.h; + if (typeof r !== "object") { + return add_max_element(v, l); + } + var rh = r.h; + if (lh > (rh + 2 | 0)) { + return bal(l.l, l.v, join(l.r, v, r)); + } else if (rh > (lh + 2 | 0)) { + return bal(join(l, v, r.l), r.v, r.r); + } else { + return create(l, v, r); + } + }; + var min_elt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { throw { - RE_EXN_ID: "Invalid_argument", - _1: "Set.remove_min_elt", + RE_EXN_ID: "Not_found", Error: new Error() }; } var l = param.l; if (typeof l !== "object") { - return param.r; - } else { - return bal(remove_min_elt(l), param.v, param.r); - } - }; - var merge = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; - } else if (typeof t2 !== "object") { - return t1; - } else { - return bal(t1, min_elt(t2), remove_min_elt(t2)); - } - }; - var concat = function (t1, t2) { - if (typeof t1 !== "object") { - return t2; - } else if (typeof t2 !== "object") { - return t1; - } else { - return join(t1, min_elt(t2), remove_min_elt(t2)); + return param.v; } + _param = l; + continue ; }; - var split = function (x, param) { + }; + var min_elt_opt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - false, - "Empty" - ]; + return; } - var r = param.r; - var v = param.v; var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return [ - l, - true, - r - ]; - } - if (c < 0) { - var match = split(x, l); - return [ - match[0], - match[1], - join(match[2], v, r) - ]; + if (typeof l !== "object") { + return Caml_option.some(param.v); } - var match$1 = split(x, r); - return [ - join(l, v, match$1[0]), - match$1[1], - match$1[2] - ]; + _param = l; + continue ; }; - var is_empty = function (param) { + }; + var max_elt = function (_param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return true; - } else { - return false; - } - }; - var mem = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - var c = Curry._2(funarg.compare, x, param.v); - if (c === 0) { - return true; - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var remove = function (x, param) { - if (typeof param !== "object") { - return "Empty"; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } var r = param.r; - var v = param.v; - var l = param.l; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return merge(l, r); - } - if (c < 0) { - var ll = remove(x, l); - if (l === ll) { - return param; - } else { - return bal(ll, v, r); - } - } - var rr = remove(x, r); - if (r === rr) { - return param; - } else { - return bal(l, v, rr); + if (typeof r !== "object") { + return param.v; } + _param = r; + continue ; }; - var union = function (s1, s2) { - if (typeof s1 !== "object") { - return s2; - } - var h1 = s1.h; - var v1 = s1.v; - if (typeof s2 !== "object") { - return s1; - } - var h2 = s2.h; - var v2 = s2.v; - if (h1 >= h2) { - if (h2 === 1) { - return add(v2, s1); - } - var match = split(v1, s2); - return join(union(s1.l, match[0]), v1, union(s1.r, match[2])); + }; + var max_elt_opt = function (_param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; } - if (h1 === 1) { - return add(v1, s2); + var r = param.r; + if (typeof r !== "object") { + return Caml_option.some(param.v); } - var match$1 = split(v2, s1); - return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); + _param = r; + continue ; }; - var inter = function (s1, s2) { - if (typeof s1 !== "object") { - return "Empty"; + }; + var remove_min_elt = function (param) { + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Invalid_argument", + _1: "Set.remove_min_elt", + Error: new Error() + }; + } + var l = param.l; + if (typeof l !== "object") { + return param.r; + } else { + return bal(remove_min_elt(l), param.v, param.r); + } + }; + var merge = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } else if (typeof t2 !== "object") { + return t1; + } else { + return bal(t1, min_elt(t2), remove_min_elt(t2)); + } + }; + var concat = function (t1, t2) { + if (typeof t1 !== "object") { + return t2; + } else if (typeof t2 !== "object") { + return t1; + } else { + return join(t1, min_elt(t2), remove_min_elt(t2)); + } + }; + var split = function (x, param) { + if (typeof param !== "object") { + return [ + "Empty", + false, + "Empty" + ]; + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return [ + l, + true, + r + ]; + } + if (c < 0) { + var match = split(x, l); + return [ + match[0], + match[1], + join(match[2], v, r) + ]; + } + var match$1 = split(x, r); + return [ + join(l, v, match$1[0]), + match$1[1], + match$1[2] + ]; + }; + var is_empty = function (param) { + if (typeof param !== "object") { + return true; + } else { + return false; + } + }; + var mem = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return false; } - if (typeof s2 !== "object") { - return "Empty"; + var c = Curry._2(funarg.compare, x, param.v); + if (c === 0) { + return true; } - var r1 = s1.r; - var v1 = s1.v; - var l1 = s1.l; - var match = split(v1, s2); - var l2 = match[0]; - if (match[1]) { - return join(inter(l1, l2), v1, inter(r1, match[2])); + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var remove = function (x, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return merge(l, r); + } + if (c < 0) { + var ll = remove(x, l); + if (l === ll) { + return param; } else { - return concat(inter(l1, l2), inter(r1, match[2])); + return bal(ll, v, r); + } + } + var rr = remove(x, r); + if (r === rr) { + return param; + } else { + return bal(l, v, rr); + } + }; + var union = function (s1, s2) { + if (typeof s1 !== "object") { + return s2; + } + var h1 = s1.h; + var v1 = s1.v; + if (typeof s2 !== "object") { + return s1; + } + var h2 = s2.h; + var v2 = s2.v; + if (h1 >= h2) { + if (h2 === 1) { + return add(v2, s1); } - }; - var diff = function (s1, s2) { + var match = split(v1, s2); + return join(union(s1.l, match[0]), v1, union(s1.r, match[2])); + } + if (h1 === 1) { + return add(v1, s2); + } + var match$1 = split(v2, s1); + return join(union(match$1[0], s2.l), v2, union(match$1[2], s2.r)); + }; + var inter = function (s1, s2) { + if (typeof s1 !== "object") { + return "Empty"; + } + if (typeof s2 !== "object") { + return "Empty"; + } + var r1 = s1.r; + var v1 = s1.v; + var l1 = s1.l; + var match = split(v1, s2); + var l2 = match[0]; + if (match[1]) { + return join(inter(l1, l2), v1, inter(r1, match[2])); + } else { + return concat(inter(l1, l2), inter(r1, match[2])); + } + }; + var diff = function (s1, s2) { + if (typeof s1 !== "object") { + return "Empty"; + } + if (typeof s2 !== "object") { + return s1; + } + var r1 = s1.r; + var v1 = s1.v; + var l1 = s1.l; + var match = split(v1, s2); + var l2 = match[0]; + if (match[1]) { + return concat(diff(l1, l2), diff(r1, match[2])); + } else { + return join(diff(l1, l2), v1, diff(r1, match[2])); + } + }; + var cons_enum = function (_s, _e) { + while(true) { + var e = _e; + var s = _s; + if (typeof s !== "object") { + return e; + } + _e = { + TAG: "More", + _0: s.v, + _1: s.r, + _2: e + }; + _s = s.l; + continue ; + }; + }; + var compare_aux = function (_e1, _e2) { + while(true) { + var e2 = _e2; + var e1 = _e1; + if (typeof e1 !== "object") { + if (typeof e2 !== "object") { + return 0; + } else { + return -1; + } + } + if (typeof e2 !== "object") { + return 1; + } + var c = Curry._2(funarg.compare, e1._0, e2._0); + if (c !== 0) { + return c; + } + _e2 = cons_enum(e2._1, e2._2); + _e1 = cons_enum(e1._1, e1._2); + continue ; + }; + }; + var compare = function (s1, s2) { + return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); + }; + var equal = function (s1, s2) { + return compare(s1, s2) === 0; + }; + var subset = function (_s1, _s2) { + while(true) { + var s2 = _s2; + var s1 = _s1; if (typeof s1 !== "object") { - return "Empty"; - } - if (typeof s2 !== "object") { - return s1; + return true; } var r1 = s1.r; var v1 = s1.v; var l1 = s1.l; - var match = split(v1, s2); - var l2 = match[0]; - if (match[1]) { - return concat(diff(l1, l2), diff(r1, match[2])); - } else { - return join(diff(l1, l2), v1, diff(r1, match[2])); + if (typeof s2 !== "object") { + return false; } - }; - var cons_enum = function (_s, _e) { - while(true) { - var e = _e; - var s = _s; - if (typeof s !== "object") { - return e; - } - _e = { - TAG: "More", - _0: s.v, - _1: s.r, - _2: e - }; - _s = s.l; - continue ; - }; - }; - var compare_aux = function (_e1, _e2) { - while(true) { - var e2 = _e2; - var e1 = _e1; - if (typeof e1 !== "object") { - if (typeof e2 !== "object") { - return 0; - } else { - return -1; - } - } - if (typeof e2 !== "object") { - return 1; - } - var c = Curry._2(funarg.compare, e1._0, e2._0); - if (c !== 0) { - return c; - } - _e2 = cons_enum(e2._1, e2._2); - _e1 = cons_enum(e1._1, e1._2); - continue ; - }; - }; - var compare = function (s1, s2) { - return compare_aux(cons_enum(s1, "End"), cons_enum(s2, "End")); - }; - var equal = function (s1, s2) { - return compare(s1, s2) === 0; - }; - var subset = function (_s1, _s2) { - while(true) { - var s2 = _s2; - var s1 = _s1; - if (typeof s1 !== "object") { - return true; - } - var r1 = s1.r; - var v1 = s1.v; - var l1 = s1.l; - if (typeof s2 !== "object") { - return false; - } - var r2 = s2.r; - var l2 = s2.l; - var c = Curry._2(funarg.compare, v1, s2.v); - if (c === 0) { - if (!subset(l1, l2)) { - return false; - } - _s2 = r2; - _s1 = r1; - continue ; - } - if (c < 0) { - if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { - return false; - } - _s1 = r1; - continue ; - } - if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + var r2 = s2.r; + var l2 = s2.l; + var c = Curry._2(funarg.compare, v1, s2.v); + if (c === 0) { + if (!subset(l1, l2)) { return false; } - _s1 = l1; + _s2 = r2; + _s1 = r1; continue ; - }; - }; - var iter = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - iter(f, param.l); - Curry._1(f, param.v); - _param = param.r; - continue ; - }; - }; - var fold = function (f, _s, _accu) { - while(true) { - var accu = _accu; - var s = _s; - if (typeof s !== "object") { - return accu; - } - _accu = Curry._2(f, s.v, fold(f, s.l, accu)); - _s = s.r; - continue ; - }; - }; - var for_all = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return true; - } - if (!Curry._1(p, param.v)) { - return false; - } - if (!for_all(p, param.l)) { + } + if (c < 0) { + if (!subset({ + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } - _param = param.r; + _s1 = r1; continue ; - }; + } + if (!subset({ + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { + return false; + } + _s1 = l1; + continue ; }; - var exists = function (p, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return false; - } - if (Curry._1(p, param.v)) { - return true; - } - if (exists(p, param.l)) { - return true; - } - _param = param.r; - continue ; - }; + }; + var iter = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + iter(f, param.l); + Curry._1(f, param.v); + _param = param.r; + continue ; + }; + }; + var fold = function (f, _s, _accu) { + while(true) { + var accu = _accu; + var s = _s; + if (typeof s !== "object") { + return accu; + } + _accu = Curry._2(f, s.v, fold(f, s.l, accu)); + _s = s.r; + continue ; + }; + }; + var for_all = function (p, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return true; + } + if (!Curry._1(p, param.v)) { + return false; + } + if (!for_all(p, param.l)) { + return false; + } + _param = param.r; + continue ; }; - var filter = function (p, param) { + }; + var exists = function (p, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return false; } - var r = param.r; - var v = param.v; - var l = param.l; - var l$p = filter(p, l); - var pv = Curry._1(p, v); - var r$p = filter(p, r); - if (pv) { - if (l === l$p && r === r$p) { - return param; - } else { - return join(l$p, v, r$p); - } + if (Curry._1(p, param.v)) { + return true; + } + if (exists(p, param.l)) { + return true; + } + _param = param.r; + continue ; + }; + }; + var filter = function (p, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var l$p = filter(p, l); + var pv = Curry._1(p, v); + var r$p = filter(p, r); + if (pv) { + if (l === l$p && r === r$p) { + return param; } else { - return concat(l$p, r$p); + return join(l$p, v, r$p); + } + } else { + return concat(l$p, r$p); + } + }; + var partition = function (p, param) { + if (typeof param !== "object") { + return [ + "Empty", + "Empty" + ]; + } + var v = param.v; + var match = partition(p, param.l); + var lf = match[1]; + var lt = match[0]; + var pv = Curry._1(p, v); + var match$1 = partition(p, param.r); + var rf = match$1[1]; + var rt = match$1[0]; + if (pv) { + return [ + join(lt, v, rt), + concat(lf, rf) + ]; + } else { + return [ + concat(lt, rt), + join(lf, v, rf) + ]; + } + }; + var cardinal = function (param) { + if (typeof param !== "object") { + return 0; + } else { + return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + } + }; + var elements_aux = function (_accu, _param) { + while(true) { + var param = _param; + var accu = _accu; + if (typeof param !== "object") { + return accu; } - }; - var partition = function (p, param) { + _param = param.l; + _accu = { + hd: param.v, + tl: elements_aux(accu, param.r) + }; + continue ; + }; + }; + var elements = function (s) { + return elements_aux(/* [] */0, s); + }; + var find = function (x, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return [ - "Empty", - "Empty" - ]; + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; } var v = param.v; - var match = partition(p, param.l); - var lf = match[1]; - var lt = match[0]; - var pv = Curry._1(p, v); - var match$1 = partition(p, param.r); - var rf = match$1[1]; - var rt = match$1[0]; - if (pv) { - return [ - join(lt, v, rt), - concat(lf, rf) - ]; - } else { - return [ - concat(lt, rt), - join(lf, v, rf) - ]; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return v; } + _param = c < 0 ? param.l : param.r; + continue ; }; - var cardinal = function (param) { + }; + var find_first_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; if (typeof param !== "object") { - return 0; - } else { - return (cardinal(param.l) + 1 | 0) + cardinal(param.r) | 0; + return v0; } - }; - var elements_aux = function (_accu, _param) { - while(true) { - var param = _param; - var accu = _accu; - if (typeof param !== "object") { - return accu; - } + var v = param.v; + if (Curry._1(f, v)) { _param = param.l; - _accu = { - hd: param.v, - tl: elements_aux(accu, param.r) - }; + _v0 = v; continue ; - }; + } + _param = param.r; + continue ; }; - var elements = function (s) { - return elements_aux(/* [] */0, s); + }; + var find_first = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_aux(v, f, param.l); + } + _param = param.r; + continue ; }; - var find = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return v; - } - _param = c < 0 ? param.l : param.r; + }; + var find_first_opt_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return Caml_option.some(v0); + } + var v = param.v; + if (Curry._1(f, v)) { + _param = param.l; + _v0 = v; continue ; - }; + } + _param = param.r; + continue ; }; - var find_first_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return v0; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; + }; + var find_first_opt = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_first_opt_aux(v, f, param.l); + } + _param = param.r; + continue ; }; - var find_first = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_aux(v, f, param.l); - } + }; + var find_last_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return v0; + } + var v = param.v; + if (Curry._1(f, v)) { _param = param.r; + _v0 = v; continue ; - }; + } + _param = param.l; + continue ; }; - var find_first_opt_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return Caml_option.some(v0); - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.l; - _v0 = v; - continue ; - } - _param = param.r; - continue ; - }; + }; + var find_last = function (f, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + throw { + RE_EXN_ID: "Not_found", + Error: new Error() + }; + } + var v = param.v; + if (Curry._1(f, v)) { + return find_last_aux(v, f, param.r); + } + _param = param.l; + continue ; }; - var find_first_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_first_opt_aux(v, f, param.l); - } + }; + var find_last_opt_aux = function (_v0, f, _param) { + while(true) { + var param = _param; + var v0 = _v0; + if (typeof param !== "object") { + return Caml_option.some(v0); + } + var v = param.v; + if (Curry._1(f, v)) { _param = param.r; + _v0 = v; continue ; - }; - }; - var find_last_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return v0; - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - throw { - RE_EXN_ID: "Not_found", - Error: new Error() - }; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_aux(v, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_last_opt_aux = function (_v0, f, _param) { - while(true) { - var param = _param; - var v0 = _v0; - if (typeof param !== "object") { - return Caml_option.some(v0); - } - var v = param.v; - if (Curry._1(f, v)) { - _param = param.r; - _v0 = v; - continue ; - } - _param = param.l; - continue ; - }; - }; - var find_last_opt = function (f, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - if (Curry._1(f, v)) { - return find_last_opt_aux(v, f, param.r); - } - _param = param.l; - continue ; - }; - }; - var find_opt = function (x, _param) { - while(true) { - var param = _param; - if (typeof param !== "object") { - return; - } - var v = param.v; - var c = Curry._2(funarg.compare, x, v); - if (c === 0) { - return Caml_option.some(v); - } - _param = c < 0 ? param.l : param.r; - continue ; - }; - }; - var try_join = function (l, v, r) { - if ((l === "Empty" || Curry._2(funarg.compare, max_elt(l), v) < 0) && (r === "Empty" || Curry._2(funarg.compare, v, min_elt(r)) < 0)) { - return join(l, v, r); - } else { - return union(l, add(v, r)); } + _param = param.l; + continue ; }; - var map = function (f, param) { + }; + var find_last_opt = function (f, _param) { + while(true) { + var param = _param; if (typeof param !== "object") { - return "Empty"; + return; } - var r = param.r; var v = param.v; - var l = param.l; - var l$p = map(f, l); - var v$p = Curry._1(f, v); - var r$p = map(f, r); - if (l === l$p && v === v$p && r === r$p) { - return param; - } else { - return try_join(l$p, v$p, r$p); + if (Curry._1(f, v)) { + return find_last_opt_aux(v, f, param.r); } + _param = param.l; + continue ; }; - var of_sorted_list = function (l) { - var sub = function (n, l) { - switch (n) { - case 0 : + }; + var find_opt = function (x, _param) { + while(true) { + var param = _param; + if (typeof param !== "object") { + return; + } + var v = param.v; + var c = Curry._2(funarg.compare, x, v); + if (c === 0) { + return Caml_option.some(v); + } + _param = c < 0 ? param.l : param.r; + continue ; + }; + }; + var try_join = function (l, v, r) { + if ((l === "Empty" || Curry._2(funarg.compare, max_elt(l), v) < 0) && (r === "Empty" || Curry._2(funarg.compare, v, min_elt(r)) < 0)) { + return join(l, v, r); + } else { + return union(l, add(v, r)); + } + }; + var map = function (f, param) { + if (typeof param !== "object") { + return "Empty"; + } + var r = param.r; + var v = param.v; + var l = param.l; + var l$p = map(f, l); + var v$p = Curry._1(f, v); + var r$p = map(f, r); + if (l === l$p && v === v$p && r === r$p) { + return param; + } else { + return try_join(l$p, v$p, r$p); + } + }; + var of_sorted_list = function (l) { + var 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) { + var 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) { - var match = l.tl; - if (match) { + + } + break; + case 3 : + if (l) { + var match$1 = l.tl; + if (match$1) { + var match$2 = match$1.tl; + if (match$2) { return [ { TAG: "Node", @@ -1811,144 +1837,118 @@ var $$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) { - var match$1 = l.tl; - if (match$1) { - var 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: - - } - var nl = n / 2 | 0; - var match$3 = sub(nl, l); - var l$1 = match$3[1]; - if (l$1) { - var match$4 = sub((n - nl | 0) - 1 | 0, l$1.tl); - return [ - create(match$3[0], l$1.hd, match$4[0]), - match$4[1] - ]; - } - throw { - RE_EXN_ID: "Assert_failure", - _1: [ - "setLabels.res", - 691, - 20 - ], - Error: new Error() - }; + + } + break; + default: + + } + var nl = n / 2 | 0; + var match$3 = sub(nl, l); + var l$1 = match$3[1]; + if (l$1) { + var match$4 = sub((n - nl | 0) - 1 | 0, l$1.tl); + return [ + create(match$3[0], l$1.hd, match$4[0]), + match$4[1] + ]; + } + throw { + RE_EXN_ID: "Assert_failure", + _1: [ + "setLabels.res", + 691, + 20 + ], + Error: new Error() }; - return sub(List.length(l), l)[0]; }; - var of_list = function (l) { - if (!l) { - return "Empty"; - } - var match = l.tl; - var x0 = l.hd; - if (!match) { - return singleton(x0); - } - var match$1 = match.tl; - var x1 = match.hd; - if (!match$1) { - return add(x1, singleton(x0)); - } - var match$2 = match$1.tl; - var x2 = match$1.hd; - if (!match$2) { - return add(x2, add(x1, singleton(x0))); - } - var match$3 = match$2.tl; - var x3 = match$2.hd; - if (match$3) { - if (match$3.tl) { - return of_sorted_list(List.sort_uniq(funarg.compare, l)); - } else { - return add(match$3.hd, add(x3, add(x2, add(x1, singleton(x0))))); - } + return sub(List.length(l), l)[0]; + }; + var of_list = function (l) { + if (!l) { + return "Empty"; + } + var match = l.tl; + var x0 = l.hd; + if (!match) { + return singleton(x0); + } + var match$1 = match.tl; + var x1 = match.hd; + if (!match$1) { + return add(x1, singleton(x0)); + } + var match$2 = match$1.tl; + var x2 = match$1.hd; + if (!match$2) { + return add(x2, add(x1, singleton(x0))); + } + var match$3 = match$2.tl; + var x3 = match$2.hd; + if (match$3) { + if (match$3.tl) { + return of_sorted_list(List.sort_uniq(funarg.compare, l)); } else { - return add(x3, add(x2, add(x1, singleton(x0)))); - } - }; - return { - empty: "Empty", - is_empty: is_empty, - mem: mem, - add: add, - singleton: singleton, - remove: remove, - union: union, - inter: inter, - diff: diff, - compare: compare, - equal: equal, - subset: subset, - iter: iter, - map: map, - fold: fold, - for_all: for_all, - exists: exists, - filter: filter, - partition: partition, - cardinal: cardinal, - elements: elements, - min_elt: min_elt, - min_elt_opt: min_elt_opt, - max_elt: max_elt, - max_elt_opt: max_elt_opt, - choose: min_elt, - choose_opt: min_elt_opt, - split: split, - find: find, - find_opt: find_opt, - find_first: find_first, - find_first_opt: find_first_opt, - find_last: find_last, - find_last_opt: find_last_opt, - of_list: of_list - }; - }) + return add(match$3.hd, add(x3, add(x2, add(x1, singleton(x0))))); + } + } else { + return add(x3, add(x2, add(x1, singleton(x0)))); + } + }; + return { + empty: "Empty", + is_empty: is_empty, + mem: mem, + add: add, + singleton: singleton, + remove: remove, + union: union, + inter: inter, + diff: diff, + compare: compare, + equal: equal, + subset: subset, + iter: iter, + map: map, + fold: fold, + for_all: for_all, + exists: exists, + filter: filter, + partition: partition, + cardinal: cardinal, + elements: elements, + min_elt: min_elt, + min_elt_opt: min_elt_opt, + max_elt: max_elt, + max_elt_opt: max_elt_opt, + choose: min_elt, + choose_opt: min_elt_opt, + split: split, + find: find, + find_opt: find_opt, + find_first: find_first, + find_first_opt: find_first_opt, + find_last: find_last, + find_last_opt: find_last_opt, + of_list: of_list + }; + }) }; exports.Hashtbl = Hashtbl; diff --git a/lib/js/parsing.js b/lib/js/parsing.js index ee06d01fcd..d4f86fc0d1 100644 --- a/lib/js/parsing.js +++ b/lib/js/parsing.js @@ -57,8 +57,8 @@ function clear_parser(param) { var current_lookahead_fun = { contents: (function (param) { - return false; - }) + return false; + }) }; function yyparse(tables, start, lexer, lexbuf) { @@ -147,12 +147,12 @@ function yyparse(tables, start, lexer, lexbuf) { return exn$1._1; } current_lookahead_fun.contents = (function (tok) { - if (typeof tok !== "number") { - return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; - } else { - return Caml_array.get(tables.transl_const, tok) === curr_char; - } - }); + if (typeof tok !== "number") { + return Caml_array.get(tables.transl_block, tok.TAG) === curr_char; + } else { + return Caml_array.get(tables.transl_const, tok) === curr_char; + } + }); throw exn$1; } } diff --git a/lib/js/pervasives.js b/lib/js/pervasives.js index b77cd3650f..5b92a088da 100644 --- a/lib/js/pervasives.js +++ b/lib/js/pervasives.js @@ -193,16 +193,16 @@ function print_string(prim) { var exit_function = { contents: (function (prim) { - - }) + + }) }; function at_exit(f) { var g = exit_function.contents; exit_function.contents = (function (param) { - Curry._1(f, undefined); - Curry._1(g, undefined); - }); + Curry._1(f, undefined); + Curry._1(g, undefined); + }); } function exit(retcode) { diff --git a/lib/js/pervasivesU.js b/lib/js/pervasivesU.js index a3727ad9f7..9f14ce6e3e 100644 --- a/lib/js/pervasivesU.js +++ b/lib/js/pervasivesU.js @@ -192,16 +192,16 @@ function print_string(prim) { var exit_function = { contents: (function (prim) { - - }) + + }) }; function at_exit(f) { var g = exit_function.contents; exit_function.contents = (function () { - f(); - g(); - }); + f(); + g(); + }); } function exit(retcode) { diff --git a/lib/js/set.js b/lib/js/set.js index 8aed33180c..d91465c84c 100644 --- a/lib/js/set.js +++ b/lib/js/set.js @@ -460,24 +460,24 @@ function Make(funarg) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/lib/js/setLabels.js b/lib/js/setLabels.js index 545749675b..1b49b5cb1a 100644 --- a/lib/js/setLabels.js +++ b/lib/js/setLabels.js @@ -464,24 +464,24 @@ function Make(Ord) { } if (c < 0) { if (!subset({ - TAG: "Node", - l: l1, - v: v1, - r: "Empty", - h: 0 - }, l2)) { + TAG: "Node", + l: l1, + v: v1, + r: "Empty", + h: 0 + }, l2)) { return false; } _s1 = r1; continue ; } if (!subset({ - TAG: "Node", - l: "Empty", - v: v1, - r: r1, - h: 0 - }, r2)) { + TAG: "Node", + l: "Empty", + v: v1, + r: r1, + h: 0 + }, r2)) { return false; } _s1 = l1; diff --git a/lib/js/stream.js b/lib/js/stream.js index c661f3b27f..076f6487d4 100644 --- a/lib/js/stream.js +++ b/lib/js/stream.js @@ -285,12 +285,12 @@ function of_list(l) { return { count: 0, data: List.fold_right((function (x, l) { - return { - TAG: "Scons", - _0: x, - _1: l - }; - }), l, "Sempty") + return { + TAG: "Scons", + _0: x, + _1: l + }; + }), l, "Sempty") }; } @@ -299,13 +299,13 @@ function of_string(s) { contents: 0 }; return from(function (param) { - var c = count.contents; - if (c < s.length) { - count.contents = count.contents + 1 | 0; - return Caml_string.get(s, c); - } - - }); + var c = count.contents; + if (c < s.length) { + count.contents = count.contents + 1 | 0; + return Caml_string.get(s, c); + } + + }); } function of_bytes(s) { @@ -313,13 +313,13 @@ function of_bytes(s) { contents: 0 }; return from(function (param) { - var c = count.contents; - if (c < s.length) { - count.contents = count.contents + 1 | 0; - return Caml_bytes.get(s, c); - } - - }); + var c = count.contents; + if (c < s.length) { + count.contents = count.contents + 1 | 0; + return Caml_bytes.get(s, c); + } + + }); } function iapp(i, s) { @@ -361,12 +361,12 @@ function lapp(f, s) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Sapp", - _0: data(Curry._1(f, undefined)), - _1: data(s) - }; - }) + return { + TAG: "Sapp", + _0: data(Curry._1(f, undefined)), + _1: data(s) + }; + }) } }; } @@ -377,12 +377,12 @@ function lcons(f, s) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Scons", - _0: Curry._1(f, undefined), - _1: data(s) - }; - }) + return { + TAG: "Scons", + _0: Curry._1(f, undefined), + _1: data(s) + }; + }) } }; } @@ -393,12 +393,12 @@ function lsing(f) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return { - TAG: "Scons", - _0: Curry._1(f, undefined), - _1: "Sempty" - }; - }) + return { + TAG: "Scons", + _0: Curry._1(f, undefined), + _1: "Sempty" + }; + }) } }; } @@ -409,8 +409,8 @@ function slazy(f) { data: { TAG: "Slazy", _0: CamlinternalLazy.from_fun(function () { - return data(Curry._1(f, undefined)); - }) + return data(Curry._1(f, undefined)); + }) } }; }